Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information. This CL was reviewed and approved in pieces in the following CLs: https://webrtc-codereview.appspot.com/24209004/ https://webrtc-codereview.appspot.com/24229004/ https://webrtc-codereview.appspot.com/24259004/ https://webrtc-codereview.appspot.com/25109004/ https://webrtc-codereview.appspot.com/26099004/ https://webrtc-codereview.appspot.com/27069004/ https://webrtc-codereview.appspot.com/27969004/ https://webrtc-codereview.appspot.com/27989004/ https://webrtc-codereview.appspot.com/29009004/ https://webrtc-codereview.appspot.com/30929004/ https://webrtc-codereview.appspot.com/30939004/ https://webrtc-codereview.appspot.com/31999004/ Committing as TBR to the original reviewers. BUG=chromium:81439 TEST=none TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom Review URL: https://webrtc-codereview.appspot.com/23129004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -41,7 +41,7 @@ enum {
|
||||
|
||||
class RawRtpPacket {
|
||||
public:
|
||||
RawRtpPacket(const uint8_t* data, uint32_t length, uint32_t ssrc,
|
||||
RawRtpPacket(const uint8_t* data, size_t length, uint32_t ssrc,
|
||||
uint16_t seq_num)
|
||||
: data_(new uint8_t[length]),
|
||||
length_(length),
|
||||
@ -53,7 +53,7 @@ class RawRtpPacket {
|
||||
}
|
||||
|
||||
const uint8_t* data() const { return data_.get(); }
|
||||
uint32_t length() const { return length_; }
|
||||
size_t length() const { return length_; }
|
||||
int64_t resend_time_ms() const { return resend_time_ms_; }
|
||||
void set_resend_time_ms(int64_t timeMs) { resend_time_ms_ = timeMs; }
|
||||
uint32_t ssrc() const { return ssrc_; }
|
||||
@ -61,7 +61,7 @@ class RawRtpPacket {
|
||||
|
||||
private:
|
||||
scoped_ptr<uint8_t[]> data_;
|
||||
uint32_t length_;
|
||||
size_t length_;
|
||||
int64_t resend_time_ms_;
|
||||
uint32_t ssrc_;
|
||||
uint16_t seq_num_;
|
||||
@ -251,7 +251,7 @@ class SsrcHandlers {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void IncomingPacket(const uint8_t* data, uint32_t length) {
|
||||
void IncomingPacket(const uint8_t* data, size_t length) {
|
||||
for (HandlerMapIt it = handlers_.begin(); it != handlers_.end(); ++it) {
|
||||
if (!it->second->rtp_header_parser_->IsRtcp(data, length)) {
|
||||
RTPHeader header;
|
||||
@ -375,14 +375,10 @@ class RtpPlayerImpl : public RtpPlayerInterface {
|
||||
|
||||
if (reordering_ && reorder_buffer_.get() == NULL) {
|
||||
reorder_buffer_.reset(
|
||||
new RawRtpPacket(next_packet_.data,
|
||||
static_cast<uint32_t>(next_packet_.length),
|
||||
0,
|
||||
0));
|
||||
new RawRtpPacket(next_packet_.data, next_packet_.length, 0, 0));
|
||||
return 0;
|
||||
}
|
||||
int ret = SendPacket(next_packet_.data,
|
||||
static_cast<uint32_t>(next_packet_.length));
|
||||
int ret = SendPacket(next_packet_.data, next_packet_.length);
|
||||
if (reorder_buffer_.get()) {
|
||||
SendPacket(reorder_buffer_->data(), reorder_buffer_->length());
|
||||
reorder_buffer_.reset(NULL);
|
||||
@ -421,7 +417,7 @@ class RtpPlayerImpl : public RtpPlayerInterface {
|
||||
}
|
||||
|
||||
private:
|
||||
int SendPacket(const uint8_t* data, uint32_t length) {
|
||||
int SendPacket(const uint8_t* data, size_t length) {
|
||||
assert(data);
|
||||
assert(length > 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user