| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ | 5 #ifndef REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ |
| 6 #define REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ | 6 #define REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ |
| 7 | 7 |
| 8 #include "remoting/protocol/rtp_reader.h" | 8 #include "remoting/protocol/rtp_reader.h" |
| 9 #include "remoting/protocol/video_reader.h" | 9 #include "remoting/protocol/video_reader.h" |
| 10 | 10 |
| 11 namespace remoting { | 11 namespace remoting { |
| 12 namespace protocol { | 12 namespace protocol { |
| 13 | 13 |
| 14 class Session; | 14 class Session; |
| 15 | 15 |
| 16 class RtpVideoReader : public VideoReader { | 16 class RtpVideoReader : public VideoReader { |
| 17 public: | 17 public: |
| 18 RtpVideoReader(); | 18 RtpVideoReader(); |
| 19 virtual ~RtpVideoReader(); | 19 virtual ~RtpVideoReader(); |
| 20 | 20 |
| 21 // VideoReader interface. | 21 // VideoReader interface. |
| 22 virtual void Init(protocol::Session* session, VideoStub* video_stub); | 22 virtual void Init(protocol::Session* session, VideoStub* video_stub); |
| 23 virtual void Close(); | 23 virtual void Close(); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 void OnRtpPacket(const RtpPacket& rtp_packet); | 26 friend class RtpVideoReaderTest; |
| 27 |
| 28 typedef std::deque<const RtpPacket*> PacketsQueue; |
| 29 |
| 30 void OnRtpPacket(const RtpPacket* rtp_packet); |
| 31 void CheckFullPacket(PacketsQueue::iterator pos); |
| 32 void RebuildVideoPacket(PacketsQueue::iterator from, |
| 33 PacketsQueue::iterator to); |
| 34 void ResetQueue(); |
| 27 | 35 |
| 28 RtpReader rtp_reader_; | 36 RtpReader rtp_reader_; |
| 29 | 37 |
| 38 PacketsQueue packets_queue_; |
| 39 uint32 last_sequence_number_; |
| 40 |
| 30 // The stub that processes all received packets. | 41 // The stub that processes all received packets. |
| 31 VideoStub* video_stub_; | 42 VideoStub* video_stub_; |
| 32 | 43 |
| 33 DISALLOW_COPY_AND_ASSIGN(RtpVideoReader); | 44 DISALLOW_COPY_AND_ASSIGN(RtpVideoReader); |
| 34 }; | 45 }; |
| 35 | 46 |
| 36 } // namespace protocol | 47 } // namespace protocol |
| 37 } // namespace remoting | 48 } // namespace remoting |
| 38 | 49 |
| 39 #endif // REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ | 50 #endif // REMOTING_PROTOCOL_RTP_VIDEO_READER_H_ |
| OLD | NEW |