From 5ddaa0ac4c4d01677f469e65a02ff584d3035de2 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Wed, 17 Nov 2010 23:05:15 +0000 Subject: Unittests for RTP packetizer and depacketizer. BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/4946001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66536 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/protocol/rtp_video_reader.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'remoting/protocol/rtp_video_reader.h') diff --git a/remoting/protocol/rtp_video_reader.h b/remoting/protocol/rtp_video_reader.h index 9a0ae89..412a4f0 100644 --- a/remoting/protocol/rtp_video_reader.h +++ b/remoting/protocol/rtp_video_reader.h @@ -25,7 +25,23 @@ class RtpVideoReader : public VideoReader { private: friend class RtpVideoReaderTest; - typedef std::deque PacketsQueue; + // Following struct is used to store pending packets in |packets_queue_|. + // Each entry may be in three different states: + // |received| == false, |packet| == NULL - packet with the corresponding + // sequence number hasn't been received. + // |received| == true, |packet| != NULL - packet with the corresponding + // sequence number has been received, but hasn't been processed, still + // waiting for other fragments. + // |received| == true, |packet| == NULL - packet with the corresponding + // sequence number has been received and processed. Ignore any additional + // packet with the same sequence number. + struct PacketsQueueEntry { + PacketsQueueEntry(); + bool received; + const RtpPacket* packet; + }; + + typedef std::deque PacketsQueue; void OnRtpPacket(const RtpPacket* rtp_packet); void CheckFullPacket(PacketsQueue::iterator pos); @@ -36,7 +52,7 @@ class RtpVideoReader : public VideoReader { RtpReader rtp_reader_; PacketsQueue packets_queue_; - uint32 last_sequence_number_; + uint16 last_sequence_number_; // The stub that processes all received packets. VideoStub* video_stub_; -- cgit v1.1