| 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_AUDIO_WRITER_H_ | 5 #ifndef REMOTING_PROTOCOL_AUDIO_WRITER_H_ |
| 6 #define REMOTING_PROTOCOL_AUDIO_WRITER_H_ | 6 #define REMOTING_PROTOCOL_AUDIO_WRITER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "remoting/protocol/audio_stub.h" | 14 #include "remoting/protocol/audio_stub.h" |
| 15 #include "remoting/protocol/channel_dispatcher_base.h" | 15 #include "remoting/protocol/channel_dispatcher_base.h" |
| 16 | 16 |
| 17 namespace net { | |
| 18 class StreamSocket; | |
| 19 } // namespace net | |
| 20 | |
| 21 namespace remoting { | 17 namespace remoting { |
| 22 namespace protocol { | 18 namespace protocol { |
| 23 | 19 |
| 24 class Session; | |
| 25 class SessionConfig; | 20 class SessionConfig; |
| 26 | 21 |
| 27 class AudioWriter : public ChannelDispatcherBase, | 22 class AudioWriter : public ChannelDispatcherBase, |
| 28 public AudioStub { | 23 public AudioStub { |
| 29 public: | 24 public: |
| 30 // Once AudioWriter is created, the Init() method of ChannelDispatcherBase | 25 // Once AudioWriter is created, the Init() method of ChannelDispatcherBase |
| 31 // should be used to initialize it for the session. | 26 // should be used to initialize it for the session. |
| 32 static std::unique_ptr<AudioWriter> Create(const SessionConfig& config); | 27 static std::unique_ptr<AudioWriter> Create(const SessionConfig& config); |
| 33 | 28 |
| 34 ~AudioWriter() override; | 29 ~AudioWriter() override; |
| 35 | 30 |
| 36 // AudioStub interface. | 31 // AudioStub interface. |
| 37 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet, | 32 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet, |
| 38 const base::Closure& done) override; | 33 const base::Closure& done) override; |
| 39 | 34 |
| 40 private: | 35 private: |
| 41 AudioWriter(); | 36 AudioWriter(); |
| 42 | 37 |
| 43 void OnIncomingMessage(std::unique_ptr<CompoundBuffer> message) override; | 38 void OnIncomingMessage(std::unique_ptr<CompoundBuffer> message) override; |
| 44 | 39 |
| 45 DISALLOW_COPY_AND_ASSIGN(AudioWriter); | 40 DISALLOW_COPY_AND_ASSIGN(AudioWriter); |
| 46 }; | 41 }; |
| 47 | 42 |
| 48 } // namespace protocol | 43 } // namespace protocol |
| 49 } // namespace remoting | 44 } // namespace remoting |
| 50 | 45 |
| 51 #endif // REMOTING_PROTOCOL_AUDIO_WRITER_H_ | 46 #endif // REMOTING_PROTOCOL_AUDIO_WRITER_H_ |
| OLD | NEW |