summaryrefslogtreecommitdiffstats
path: root/remoting/client/audio_decode_scheduler.h
blob: 95f745d67cce1b21802e2ad902f8dc7aa99628df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_
#define REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_

#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "remoting/protocol/audio_stub.h"

namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace remoting {

namespace protocol {
class SessionConfig;
}  // namespace protocol

class AudioDecoder;
class AudioPacket;
class AudioPlayer;

class AudioDecodeScheduler : public protocol::AudioStub {
 public:
  AudioDecodeScheduler(
      scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
      scoped_refptr<base::SingleThreadTaskRunner> audio_decode_task_runner,
      scoped_ptr<AudioPlayer> audio_player);
  virtual ~AudioDecodeScheduler();

  // Initializes decoder with the information from the protocol config.
  void Initialize(const protocol::SessionConfig& config);

  // AudioStub implementation.
  virtual void ProcessAudioPacket(scoped_ptr<AudioPacket> packet,
                                  const base::Closure& done) OVERRIDE;

 private:
  class Core;

  scoped_refptr<Core> core_;

  DISALLOW_COPY_AND_ASSIGN(AudioDecodeScheduler);
};

}  // namespace remoting

#endif  // REMOTING_CLIENT_AUDIO_DECODE_SCHEDULER_H_