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_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 { |
| 13 class MessageLoopProxy; |
| 14 } // namespace base |
| 15 |
12 namespace remoting { | 16 namespace remoting { |
13 namespace protocol { | 17 namespace protocol { |
14 | 18 |
15 class Session; | 19 class Session; |
16 | 20 |
17 class RtpVideoWriter : public VideoWriter { | 21 class RtpVideoWriter : public VideoWriter { |
18 public: | 22 public: |
19 RtpVideoWriter(); | 23 RtpVideoWriter(base::MessageLoopProxy* message_loop); |
20 virtual ~RtpVideoWriter(); | 24 virtual ~RtpVideoWriter(); |
21 | 25 |
22 // VideoWriter interface. | 26 // VideoWriter interface. |
23 virtual void Init(protocol::Session* session, | 27 virtual void Init(protocol::Session* session, |
24 const InitializedCallback& callback) OVERRIDE; | 28 const InitializedCallback& callback) OVERRIDE; |
25 virtual void Close() OVERRIDE; | 29 virtual void Close() OVERRIDE; |
26 | 30 |
27 // VideoStub interface. | 31 // VideoStub interface. |
28 virtual void ProcessVideoPacket(const VideoPacket* packet, | 32 virtual void ProcessVideoPacket(const VideoPacket* packet, |
29 Task* done) OVERRIDE; | 33 Task* done) OVERRIDE; |
30 virtual int GetPendingPackets() OVERRIDE; | 34 virtual int GetPendingPackets() OVERRIDE; |
31 | 35 |
32 private: | 36 private: |
33 void OnChannelReady(bool rtp, net::Socket* socket); | 37 void OnChannelReady(bool rtp, net::Socket* socket); |
34 | 38 |
35 bool initialized_; | 39 bool initialized_; |
36 InitializedCallback initialized_callback_; | 40 InitializedCallback initialized_callback_; |
37 | 41 |
38 scoped_ptr<net::Socket> rtp_channel_; | 42 scoped_ptr<net::Socket> rtp_channel_; |
39 RtpWriter rtp_writer_; | 43 RtpWriter rtp_writer_; |
40 scoped_ptr<net::Socket> rtcp_channel_; | 44 scoped_ptr<net::Socket> rtcp_channel_; |
41 | 45 |
42 DISALLOW_COPY_AND_ASSIGN(RtpVideoWriter); | 46 DISALLOW_COPY_AND_ASSIGN(RtpVideoWriter); |
43 }; | 47 }; |
44 | 48 |
45 } // namespace protocol | 49 } // namespace protocol |
46 } // namespace remoting | 50 } // namespace remoting |
47 | 51 |
48 #endif // REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ | 52 #endif // REMOTING_PROTOCOL_RTP_VIDEO_WRITER_H_ |
OLD | NEW |