1 // Copyright 2014 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_SENDER_AUDIO_ENCODER_H_
6 #define MEDIA_CAST_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_environment.h"
23 typedef base::Callback
<void(scoped_ptr
<EncodedFrame
>)>
26 AudioEncoder(const scoped_refptr
<CastEnvironment
>& cast_environment
,
31 const FrameEncodedCallback
& frame_encoded_callback
);
32 virtual ~AudioEncoder();
34 CastInitializationStatus
InitializationResult() const;
36 void InsertAudio(scoped_ptr
<AudioBus
> audio_bus
,
37 const base::TimeTicks
& recorded_time
);
44 const scoped_refptr
<CastEnvironment
> cast_environment_
;
45 scoped_refptr
<ImplBase
> impl_
;
47 // Used to ensure only one thread invokes InsertAudio().
48 base::ThreadChecker insert_thread_checker_
;
50 DISALLOW_COPY_AND_ASSIGN(AudioEncoder
);
56 #endif // MEDIA_CAST_SENDER_AUDIO_ENCODER_H_