Will now correctly identify the first-ever received packet as the first packet in its frame.
We used to flag the _second_ packet in the first frame as the first. Subsequent frames worked as intended. BUG=1103 TEST=vie_auto_test --automated, rtp_rtcp_unittests Review URL: https://webrtc-codereview.appspot.com/964020 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3164 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
7c894b7cc7
commit
ef90c3227e
@ -40,6 +40,8 @@ class MockRTPReceiverVideo : public RTPReceiverVideo {
|
|||||||
const WebRtc_UWord32 rtpTimeStamp));
|
const WebRtc_UWord32 rtpTimeStamp));
|
||||||
MOCK_CONST_METHOD0(REDPayloadType,
|
MOCK_CONST_METHOD0(REDPayloadType,
|
||||||
WebRtc_Word8());
|
WebRtc_Word8());
|
||||||
|
MOCK_CONST_METHOD0(HaveNotReceivedPackets,
|
||||||
|
bool());
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -157,6 +157,11 @@ RTPReceiver::SetPacketTimeout(const WebRtc_UWord32 timeoutMS)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RTPReceiver::HaveNotReceivedPackets() const
|
||||||
|
{
|
||||||
|
return _lastReceiveTime == 0;
|
||||||
|
}
|
||||||
|
|
||||||
void RTPReceiver::PacketTimeout()
|
void RTPReceiver::PacketTimeout()
|
||||||
{
|
{
|
||||||
bool packetTimeOut = false;
|
bool packetTimeOut = false;
|
||||||
@ -168,7 +173,7 @@ void RTPReceiver::PacketTimeout()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_lastReceiveTime == 0)
|
if (HaveNotReceivedPackets())
|
||||||
{
|
{
|
||||||
// not active
|
// not active
|
||||||
return;
|
return;
|
||||||
|
@ -169,6 +169,8 @@ protected:
|
|||||||
|
|
||||||
virtual WebRtc_Word8 REDPayloadType() const;
|
virtual WebRtc_Word8 REDPayloadType() const;
|
||||||
|
|
||||||
|
bool HaveNotReceivedPackets() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Is RED configured with payload type payloadType
|
// Is RED configured with payload type payloadType
|
||||||
bool REDPayloadType(const WebRtc_Word8 payloadType) const;
|
bool REDPayloadType(const WebRtc_Word8 payloadType) const;
|
||||||
|
@ -321,8 +321,11 @@ WebRtc_Word32 RTPReceiverVideo::ReceiveGenericCodec(
|
|||||||
const WebRtc_UWord16 payloadDataLength) {
|
const WebRtc_UWord16 payloadDataLength) {
|
||||||
rtpHeader->frameType = kVideoFrameKey;
|
rtpHeader->frameType = kVideoFrameKey;
|
||||||
|
|
||||||
if(((SequenceNumber() + 1) == rtpHeader->header.sequenceNumber) &&
|
bool isFirstPacketInFrame =
|
||||||
(TimeStamp() != rtpHeader->header.timestamp)) {
|
(SequenceNumber() + 1) == rtpHeader->header.sequenceNumber &&
|
||||||
|
TimeStamp() != rtpHeader->header.timestamp;
|
||||||
|
|
||||||
|
if (isFirstPacketInFrame || HaveNotReceivedPackets()) {
|
||||||
rtpHeader->type.Video.isFirstPacket = true;
|
rtpHeader->type.Video.isFirstPacket = true;
|
||||||
}
|
}
|
||||||
_criticalSectionReceiverVideo->Leave();
|
_criticalSectionReceiverVideo->Leave();
|
||||||
|
@ -71,6 +71,7 @@ class RTPReceiverVideo {
|
|||||||
const WebRtc_UWord32 rtpTimeStamp) const = 0;
|
const WebRtc_UWord32 rtpTimeStamp) const = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word8 REDPayloadType() const = 0;
|
virtual WebRtc_Word8 REDPayloadType() const = 0;
|
||||||
|
virtual bool HaveNotReceivedPackets() const = 0;
|
||||||
|
|
||||||
WebRtc_Word32 SetCodecType(const RtpVideoCodecTypes videoType,
|
WebRtc_Word32 SetCodecType(const RtpVideoCodecTypes videoType,
|
||||||
WebRtcRTPHeader* rtpHeader) const;
|
WebRtcRTPHeader* rtpHeader) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user