Ignore title parameter for navigator.registerProtocolHandler
[chromium-blink-merge.git] / media / cast / audio_sender / audio_encoder.h
blobd4c9e0f3929c44f682446665645e8082a8c4e93f
1 // Copyright 2013 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 MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_
6 #define MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "media/base/audio_bus.h"
12 #include "media/cast/cast_config.h"
13 #include "media/cast/cast_environment.h"
15 namespace base {
16 class TimeTicks;
19 namespace media {
20 namespace cast {
22 class AudioEncoder {
23 public:
24 typedef base::Callback<void(scoped_ptr<transport::EncodedAudioFrame>,
25 const base::TimeTicks&)> FrameEncodedCallback;
27 AudioEncoder(const scoped_refptr<CastEnvironment>& cast_environment,
28 const AudioSenderConfig& audio_config,
29 const FrameEncodedCallback& frame_encoded_callback);
30 virtual ~AudioEncoder();
32 CastInitializationStatus InitializationResult() const;
34 void InsertAudio(scoped_ptr<AudioBus> audio_bus,
35 const base::TimeTicks& recorded_time);
37 private:
38 class ImplBase;
39 class OpusImpl;
40 class Pcm16Impl;
42 const scoped_refptr<CastEnvironment> cast_environment_;
43 scoped_refptr<ImplBase> impl_;
45 // Used to ensure only one thread invokes InsertAudio().
46 base::ThreadChecker insert_thread_checker_;
48 DISALLOW_COPY_AND_ASSIGN(AudioEncoder);
51 } // namespace cast
52 } // namespace media
54 #endif // MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_