Move Word32Align helper next to the only place it is used in

Bug: None
Change-Id: I99b34b78c6a560afa3638e2ba2f403e25602b12e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226862
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34583}
This commit is contained in:
Danil Chapovalov 2021-07-27 22:17:04 +02:00 committed by WebRTC LUCI CQ
parent 481698e6f5
commit 64a59f1bf8
4 changed files with 11 additions and 20 deletions

View File

@ -16,7 +16,6 @@
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/byte_io.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
#include "modules/rtp_rtcp/source/rtp_utility.h"
#include "rtc_base/checks.h"
namespace webrtc {
@ -24,6 +23,9 @@ namespace test {
namespace fec {
namespace {
constexpr uint8_t kRtpMarkerBitMask = 0x80;
constexpr uint8_t kFecPayloadType = 96;
constexpr uint8_t kRedPayloadType = 97;
constexpr uint8_t kVp8PayloadType = 120;

View File

@ -18,7 +18,6 @@
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
#include "modules/rtp_rtcp/source/rtp_sender.h"
#include "modules/rtp_rtcp/source/rtp_utility.h"
#include "system_wrappers/include/clock.h"
#include "test/gtest.h"
@ -26,7 +25,6 @@ namespace webrtc {
namespace {
using RtpUtility::Word32Align;
using test::fec::AugmentedPacket;
using test::fec::AugmentedPacketGenerator;
@ -46,6 +44,14 @@ constexpr int64_t kInitialSimulatedClockTime = 1;
constexpr uint16_t kDeterministicSequenceNumber = 28732;
constexpr uint32_t kDeterministicTimestamp = 2305613085;
// Round up to the nearest size that is a multiple of 4.
size_t Word32Align(size_t size) {
uint32_t remainder = size % 4;
if (remainder != 0)
return size + 4 - remainder;
return size;
}
std::unique_ptr<RtpPacketToSend> GenerateSingleFlexfecPacket(
FlexfecSender* sender) {
// Parameters selected to generate a single FEC packet.

View File

@ -38,17 +38,6 @@ enum {
kRtpMinParseLength = 12
};
/*
* Misc utility routines
*/
size_t Word32Align(size_t size) {
uint32_t remainder = size % 4;
if (remainder != 0)
return size + 4 - remainder;
return size;
}
RtpHeaderParser::RtpHeaderParser(const uint8_t* rtpData,
const size_t rtpDataLength)
: _ptrRTPDataBegin(rtpData),

View File

@ -22,14 +22,8 @@
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
namespace webrtc {
const uint8_t kRtpMarkerBitMask = 0x80;
namespace RtpUtility {
// Round up to the nearest size that is a multiple of 4.
size_t Word32Align(size_t size);
class RtpHeaderParser {
public:
RtpHeaderParser(const uint8_t* rtpData, size_t rtpDataLength);