diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-17 23:05:15 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-17 23:05:15 +0000 |
commit | 5ddaa0ac4c4d01677f469e65a02ff584d3035de2 (patch) | |
tree | a69cd3af68055724bae9ee9d4ddcac69bed8c666 /remoting/protocol/rtp_video_reader.h | |
parent | ee97fb0629b6dc336f9c7d69e8595dd9637b336c (diff) | |
download | chromium_src-5ddaa0ac4c4d01677f469e65a02ff584d3035de2.zip chromium_src-5ddaa0ac4c4d01677f469e65a02ff584d3035de2.tar.gz chromium_src-5ddaa0ac4c4d01677f469e65a02ff584d3035de2.tar.bz2 |
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
Diffstat (limited to 'remoting/protocol/rtp_video_reader.h')
-rw-r--r-- | remoting/protocol/rtp_video_reader.h | 20 |
1 files changed, 18 insertions, 2 deletions
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<const RtpPacket*> 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<PacketsQueueEntry> 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_; |