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"
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
);
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
);
54 #endif // MEDIA_CAST_AUDIO_SENDER_AUDIO_ENCODER_H_