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));
|
||||
MOCK_CONST_METHOD0(REDPayloadType,
|
||||
WebRtc_Word8());
|
||||
MOCK_CONST_METHOD0(HaveNotReceivedPackets,
|
||||
bool());
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -157,6 +157,11 @@ RTPReceiver::SetPacketTimeout(const WebRtc_UWord32 timeoutMS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool RTPReceiver::HaveNotReceivedPackets() const
|
||||
{
|
||||
return _lastReceiveTime == 0;
|
||||
}
|
||||
|
||||
void RTPReceiver::PacketTimeout()
|
||||
{
|
||||
bool packetTimeOut = false;
|
||||
@ -168,7 +173,7 @@ void RTPReceiver::PacketTimeout()
|
||||
return;
|
||||
}
|
||||
|
||||
if(_lastReceiveTime == 0)
|
||||
if (HaveNotReceivedPackets())
|
||||
{
|
||||
// not active
|
||||
return;
|
||||
@ -937,7 +942,7 @@ bool RTPReceiver::RetransmitOfOldPacket(
|
||||
|
||||
// Min maxDelayMs is 1.
|
||||
if (maxDelayMs == 0) {
|
||||
maxDelayMs = 1;
|
||||
maxDelayMs = 1;
|
||||
}
|
||||
} else {
|
||||
maxDelayMs = (minRTT / 3) + 1;
|
||||
|
@ -169,6 +169,8 @@ protected:
|
||||
|
||||
virtual WebRtc_Word8 REDPayloadType() const;
|
||||
|
||||
bool HaveNotReceivedPackets() const;
|
||||
|
||||
private:
|
||||
// Is RED configured with payload type payloadType
|
||||
bool REDPayloadType(const WebRtc_Word8 payloadType) const;
|
||||
|
@ -321,14 +321,17 @@ WebRtc_Word32 RTPReceiverVideo::ReceiveGenericCodec(
|
||||
const WebRtc_UWord16 payloadDataLength) {
|
||||
rtpHeader->frameType = kVideoFrameKey;
|
||||
|
||||
if(((SequenceNumber() + 1) == rtpHeader->header.sequenceNumber) &&
|
||||
(TimeStamp() != rtpHeader->header.timestamp)) {
|
||||
bool isFirstPacketInFrame =
|
||||
(SequenceNumber() + 1) == rtpHeader->header.sequenceNumber &&
|
||||
TimeStamp() != rtpHeader->header.timestamp;
|
||||
|
||||
if (isFirstPacketInFrame || HaveNotReceivedPackets()) {
|
||||
rtpHeader->type.Video.isFirstPacket = true;
|
||||
}
|
||||
_criticalSectionReceiverVideo->Leave();
|
||||
|
||||
if(CallbackOfReceivedPayloadData(payloadData, payloadDataLength,
|
||||
rtpHeader) != 0) {
|
||||
if (CallbackOfReceivedPayloadData(payloadData, payloadDataLength,
|
||||
rtpHeader) != 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -71,6 +71,7 @@ class RTPReceiverVideo {
|
||||
const WebRtc_UWord32 rtpTimeStamp) const = 0;
|
||||
|
||||
virtual WebRtc_Word8 REDPayloadType() const = 0;
|
||||
virtual bool HaveNotReceivedPackets() const = 0;
|
||||
|
||||
WebRtc_Word32 SetCodecType(const RtpVideoCodecTypes videoType,
|
||||
WebRtcRTPHeader* rtpHeader) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user