Fix bugs introduced by https://code.google.com/p/webrtc/source/detail?r=6667 .
A few places were relying on temporalIdx being signed. Fix to explicitly check for kNoTemporalIdx. TBR=pbos,stefan Review URL: https://webrtc-codereview.appspot.com/13939005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6669 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
dd6780d85d
commit
9e1acc8728
@ -434,17 +434,18 @@ RTPSenderVideo::SendVP8(const FrameType frameType,
|
||||
if (rtpTypeHdr->VP8.temporalIdx == 0 &&
|
||||
!(_retransmissionSettings & kRetransmitBaseLayer)) {
|
||||
storage = kDontRetransmit;
|
||||
}
|
||||
if (rtpTypeHdr->VP8.temporalIdx > 0 &&
|
||||
} else if (rtpTypeHdr->VP8.temporalIdx != kNoTemporalIdx &&
|
||||
!(_retransmissionSettings & kRetransmitHigherLayers)) {
|
||||
storage = kDontRetransmit;
|
||||
}
|
||||
|
||||
bool last = false;
|
||||
_numberFirstPartition = 0;
|
||||
// |rtpTypeHdr->VP8.temporalIdx| is zero for base layers, or -1 if the field
|
||||
// isn't used. We currently only protect base layers.
|
||||
bool protect = (rtpTypeHdr->VP8.temporalIdx < 1);
|
||||
// |rtpTypeHdr->VP8.temporalIdx| is zero for base layers, or kNoTemporalIdx
|
||||
// if the field isn't used (so all layers are the base layer). We currently
|
||||
// only protect base layers, so look for these two cases.
|
||||
bool protect = rtpTypeHdr->VP8.temporalIdx == 0 ||
|
||||
rtpTypeHdr->VP8.temporalIdx == kNoTemporalIdx;
|
||||
while (!last)
|
||||
{
|
||||
// Write VP8 Payload Descriptor and VP8 payload.
|
||||
|
@ -141,10 +141,10 @@ class PacketizationCallback : public VCMPacketizationCallback {
|
||||
int frames = 0;
|
||||
for (size_t i = 0; i < frame_data_.size(); ++i) {
|
||||
EXPECT_EQ(kRtpVideoVp8, frame_data_[i].rtp_video_header.codec);
|
||||
if (frame_data_[i].rtp_video_header.codecHeader.VP8.temporalIdx <=
|
||||
temporal_layer) {
|
||||
const uint8_t temporal_idx =
|
||||
frame_data_[i].rtp_video_header.codecHeader.VP8.temporalIdx;
|
||||
if (temporal_idx <= temporal_layer || temporal_idx == kNoTemporalIdx)
|
||||
frames++;
|
||||
}
|
||||
}
|
||||
return frames;
|
||||
}
|
||||
@ -153,10 +153,10 @@ class PacketizationCallback : public VCMPacketizationCallback {
|
||||
int payload_size = 0;
|
||||
for (size_t i = 0; i < frame_data_.size(); ++i) {
|
||||
EXPECT_EQ(kRtpVideoVp8, frame_data_[i].rtp_video_header.codec);
|
||||
if (frame_data_[i].rtp_video_header.codecHeader.VP8.temporalIdx <=
|
||||
temporal_layer) {
|
||||
const uint8_t temporal_idx =
|
||||
frame_data_[i].rtp_video_header.codecHeader.VP8.temporalIdx;
|
||||
if (temporal_idx <= temporal_layer || temporal_idx == kNoTemporalIdx)
|
||||
payload_size += frame_data_[i].payload_size;
|
||||
}
|
||||
}
|
||||
return payload_size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user