scheduler: Implement task observers
[chromium-blink-merge.git] / remoting / client / audio_decode_scheduler.h
blob7848d67c3b3428f233dd26e69c8d3dc45c8e2644
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
3 // found in the LICENSE file.
5 #ifndef REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_
6 #define REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/protocol/audio_stub.h"
12 namespace base {
13 class SingleThreadTaskRunner;
14 } // namespace base
16 namespace remoting {
18 namespace protocol {
19 class SessionConfig;
20 } // namespace protocol
22 class AudioDecoder;
23 class AudioPacket;
24 class AudioPlayer;
26 class AudioDecodeScheduler : public protocol::AudioStub {
27 public:
28 AudioDecodeScheduler(
29 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
30 scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner,
31 scoped_ptr<AudioPlayer> audio_player);
32 ~AudioDecodeScheduler() override;
34 // Initializes decoder with the information from the protocol config.
35 void Initialize(const protocol::SessionConfig& config);
37 // AudioStub implementation.
38 void ProcessAudioPacket(scoped_ptr<AudioPacket> packet,
39 const base::Closure& done) override;
41 private:
42 class Core;
44 scoped_refptr<Core> core_;
46 DISALLOW_COPY_AND_ASSIGN(AudioDecodeScheduler);
49 } // namespace remoting
51 #endif // REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_