Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 // | |
| 5 // Subclass of media::AudioOutputDevice to support additional concepts within | |
| 6 // the content component. Use AudioDeviceFactory to instantiate this class. | |
|
scherkus (not reviewing)
2012/11/30 22:09:43
nit: while chromium is overall inconsistent, most
miu
2012/12/01 00:40:17
Done.
| |
| 7 | |
| 8 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_OUTPUT_DEVICE_H_ | |
| 9 #define CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_OUTPUT_DEVICE_H_ | |
| 10 | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 #include "media/audio/audio_output_device.h" | |
| 13 | |
| 14 namespace base { | |
| 15 class MessageLoopProxy; | |
| 16 } | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 class AudioDeviceFactory; | |
| 21 class AudioMessageFilter; | |
| 22 | |
| 23 class RendererAudioOutputDevice | |
| 24 : NON_EXPORTED_BASE(public media::AudioOutputDevice) { | |
| 25 public: | |
| 26 // Set the source of the rendered audio data to the RenderView specified by | |
| 27 // |render_view_id|. Callers should keep in mind that the RenderView which | |
| 28 // caused the instantiation of RendererAudioOutputDevice might not necessarily | |
| 29 // be same as the RenderView which actually renders the audio data. | |
| 30 void SetSourceRenderView(int render_view_id); | |
| 31 | |
| 32 virtual void Start() OVERRIDE; | |
| 33 virtual void Stop() OVERRIDE; | |
| 34 | |
| 35 protected: | |
| 36 friend class AudioDeviceFactory; | |
| 37 | |
| 38 // Creates an uninitialized RendererAudioOutputDevice. Clients must call | |
| 39 // Initialize() before using. | |
| 40 RendererAudioOutputDevice( | |
| 41 AudioMessageFilter* message_filter, | |
| 42 const scoped_refptr<base::MessageLoopProxy>& io_loop); | |
| 43 | |
| 44 private: | |
| 45 // Note: Base class is ref-counted. | |
|
scherkus (not reviewing)
2012/11/30 22:09:43
no need -- ref-counting is (sadly) common enough
miu
2012/12/01 00:40:17
Done.
| |
| 46 virtual ~RendererAudioOutputDevice(); | |
| 47 | |
| 48 void OnStart(); | |
| 49 void OnStop(); | |
| 50 void OnSourceChange(int render_view_id); | |
| 51 | |
| 52 int source_render_view_id_; | |
| 53 bool is_after_stream_created_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(RendererAudioOutputDevice); | |
|
scherkus (not reviewing)
2012/11/30 22:09:43
s/C_A_A/I_C/
miu
2012/12/01 00:40:17
Done.
| |
| 56 }; | |
| 57 | |
| 58 } // namespace content | |
| 59 | |
| 60 #endif // CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_OUTPUT_DEVICE_H_ | |
| OLD | NEW |