| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WRITER_H_ | 5 #ifndef REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ |
| 6 #define REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ | 6 #define REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "remoting/protocol/rtp_writer.h" | 9 #include "remoting/protocol/rtp_writer.h" |
| 10 #include "remoting/protocol/video_writer.h" | 10 #include "remoting/protocol/video_writer.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class MessageLoopProxy; | 13 class MessageLoopProxy; |
| 14 } // namespace base | 14 } // namespace base |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 namespace protocol { | 17 namespace protocol { |
| 18 | 18 |
| 19 class Session; | 19 class Session; |
| 20 | 20 |
| 21 class RtpVideoWriter : public VideoWriter { | 21 class RtpVideoWriter : public VideoWriter { |
| 22 public: | 22 public: |
| 23 RtpVideoWriter(base::MessageLoopProxy* message_loop); | 23 RtpVideoWriter(base::MessageLoopProxy* message_loop); |
| 24 virtual ~RtpVideoWriter(); | 24 virtual ~RtpVideoWriter(); |
| 25 | 25 |
| 26 // VideoWriter interface. | 26 // VideoWriter interface. |
| 27 virtual void Init(Session* session, | 27 virtual void Init(Session* session, |
| 28 const InitializedCallback& callback) OVERRIDE; | 28 const InitializedCallback& callback) OVERRIDE; |
| 29 virtual bool is_connected() OVERRIDE; |
| 29 virtual void Close() OVERRIDE; | 30 virtual void Close() OVERRIDE; |
| 30 | 31 |
| 31 // VideoStub interface. | 32 // VideoStub interface. |
| 32 virtual void ProcessVideoPacket(const VideoPacket* packet, | 33 virtual void ProcessVideoPacket(const VideoPacket* packet, |
| 33 const base::Closure& done) OVERRIDE; | 34 const base::Closure& done) OVERRIDE; |
| 34 virtual int GetPendingPackets() OVERRIDE; | 35 virtual int GetPendingPackets() OVERRIDE; |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 void OnChannelReady(bool rtp, net::Socket* socket); | 38 void OnChannelReady(bool rtp, net::Socket* socket); |
| 38 | 39 |
| 39 Session* session_; | 40 Session* session_; |
| 40 | 41 |
| 41 bool initialized_; | 42 bool initialized_; |
| 42 InitializedCallback initialized_callback_; | 43 InitializedCallback initialized_callback_; |
| 43 | 44 |
| 44 scoped_ptr<net::Socket> rtp_channel_; | 45 scoped_ptr<net::Socket> rtp_channel_; |
| 45 RtpWriter rtp_writer_; | 46 RtpWriter rtp_writer_; |
| 46 scoped_ptr<net::Socket> rtcp_channel_; | 47 scoped_ptr<net::Socket> rtcp_channel_; |
| 47 | 48 |
| 48 DISALLOW_COPY_AND_ASSIGN(RtpVideoWriter); | 49 DISALLOW_COPY_AND_ASSIGN(RtpVideoWriter); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace protocol | 52 } // namespace protocol |
| 52 } // namespace remoting | 53 } // namespace remoting |
| 53 | 54 |
| 54 #endif // REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ | 55 #endif // REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ |
| OLD | NEW |