| 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_CLIENT_AUDIO_DECODE_SCHEDULER_H_ | 5 #ifndef REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_ |
| 6 #define REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_ | 6 #define REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 12 #include "remoting/protocol/audio_stub.h" | 13 #include "remoting/protocol/audio_stub.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 16 } // namespace base | 17 } // namespace base |
| 17 | 18 |
| 18 namespace remoting { | 19 namespace remoting { |
| 19 | 20 |
| 20 namespace protocol { | 21 namespace protocol { |
| 21 class SessionConfig; | 22 class SessionConfig; |
| 22 } // namespace protocol | 23 } // namespace protocol |
| 23 | 24 |
| 24 class AudioDecoder; | 25 class AudioDecoder; |
| 25 class AudioPacket; | 26 class AudioPacket; |
| 26 class AudioPlayer; | 27 class AudioConsumer; |
| 27 | 28 |
| 28 class AudioDecodeScheduler : public protocol::AudioStub { | 29 class AudioDecodeScheduler : public protocol::AudioStub { |
| 29 public: | 30 public: |
| 30 AudioDecodeScheduler( | 31 AudioDecodeScheduler( |
| 31 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 32 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 32 scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner, | 33 scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner, |
| 33 std::unique_ptr<AudioPlayer> audio_player); | 34 base::WeakPtr<AudioConsumer> audio_consumer); |
| 34 ~AudioDecodeScheduler() override; | 35 ~AudioDecodeScheduler() override; |
| 35 | 36 |
| 36 // Initializes decoder with the information from the protocol config. | 37 // Initializes decoder with the information from the protocol config. |
| 37 void Initialize(const protocol::SessionConfig& config); | 38 void Initialize(const protocol::SessionConfig& config); |
| 38 | 39 |
| 39 // AudioStub implementation. | 40 // AudioStub implementation. |
| 40 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet, | 41 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet, |
| 41 const base::Closure& done) override; | 42 const base::Closure& done) override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 class Core; | 45 class Core; |
| 45 | 46 |
| 46 scoped_refptr<Core> core_; | 47 scoped_refptr<Core> core_; |
| 47 | 48 |
| 48 DISALLOW_COPY_AND_ASSIGN(AudioDecodeScheduler); | 49 DISALLOW_COPY_AND_ASSIGN(AudioDecodeScheduler); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace remoting | 52 } // namespace remoting |
| 52 | 53 |
| 53 #endif // REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_ | 54 #endif // REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_ |
| OLD | NEW |