Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOBUF_VIDEO_WRITER_H_ | 5 #ifndef REMOTING_PROTOCOL_PROTOBUF_AUDIO_WRITER_H_ |
| 6 #define REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ | 6 #define REMOTING_PROTOCOL_PROTOBUF_AUDIO_WRITER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "remoting/protocol/audio_writer.h" | |
| 13 #include "remoting/protocol/buffered_socket_writer.h" | 14 #include "remoting/protocol/buffered_socket_writer.h" |
| 14 #include "remoting/protocol/video_writer.h" | |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 class StreamSocket; | 17 class StreamSocket; |
| 18 } // namespace net | 18 } // namespace net |
| 19 | 19 |
| 20 namespace remoting { | 20 namespace remoting { |
| 21 namespace protocol { | 21 namespace protocol { |
| 22 | 22 |
| 23 class Session; | 23 class Session; |
| 24 | 24 |
| 25 class ProtobufVideoWriter : public VideoWriter { | 25 class ProtobufAudioWriter : public AudioWriter { |
| 26 public: | 26 public: |
| 27 ProtobufVideoWriter(); | 27 ProtobufAudioWriter(); |
| 28 virtual ~ProtobufVideoWriter(); | 28 virtual ~ProtobufAudioWriter(); |
| 29 | 29 |
| 30 // VideoWriter interface. | 30 // AudioWriter interface. |
| 31 virtual void Init(protocol::Session* session, | 31 virtual void Init(protocol::Session* session, |
| 32 const InitializedCallback& callback) OVERRIDE; | 32 const InitializedCallback& callback) OVERRIDE; |
| 33 virtual void Close() OVERRIDE; | 33 virtual void Close() OVERRIDE; |
| 34 virtual bool is_connected() OVERRIDE; | 34 virtual bool is_connected() OVERRIDE; |
| 35 | 35 |
| 36 // VideoStub interface. | 36 // AudioStub interface. |
| 37 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, | 37 virtual void ProcessAudioPacket(scoped_ptr<AudioPacket> packet, |
| 38 const base::Closure& done) OVERRIDE; | 38 const base::Closure& done) OVERRIDE; |
| 39 virtual int GetPendingPackets() OVERRIDE; | |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); | 41 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); |
| 43 | 42 |
| 44 Session* session_; | 43 Session* session_; |
| 45 | 44 |
| 46 InitializedCallback initialized_callback_; | 45 InitializedCallback initialized_callback_; |
| 47 | 46 |
| 48 // TODO(sergeyu): Remove |channel_| and let |buffered_writer_| own it. | 47 // TODO(kxing): Remove |channel_| and let |buffered_writer_| own it. |
|
garykac
2012/06/14 17:50:02
Can you create a bug for this and then do it (for
Sergey Ulanov
2012/06/14 17:53:17
Here and in all other places - don't change the na
kxing
2012/06/14 22:30:42
Done.
kxing
2012/06/14 22:30:42
Done.
| |
| 49 scoped_ptr<net::StreamSocket> channel_; | 48 scoped_ptr<net::StreamSocket> channel_; |
| 50 | 49 |
| 51 BufferedSocketWriter buffered_writer_; | 50 BufferedSocketWriter buffered_writer_; |
| 52 | 51 |
| 53 DISALLOW_COPY_AND_ASSIGN(ProtobufVideoWriter); | 52 DISALLOW_COPY_AND_ASSIGN(ProtobufAudioWriter); |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 } // namespace protocol | 55 } // namespace protocol |
| 57 } // namespace remoting | 56 } // namespace remoting |
| 58 | 57 |
| 59 #endif // REMOTING_PROTOCOL_PROTOBUF_VIDEO_WRITER_H_ | 58 #endif // REMOTING_PROTOCOL_PROTOBUF_AUDIO_WRITER_H_ |
| OLD | NEW |