OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "webkit/media/media_stream_audio_renderer.h" | 12 #include "webkit/media/media_stream_audio_renderer.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 class AudioBus; | 15 class AudioBus; |
| 16 class AudioOutputDevice; |
16 class AudioParameters; | 17 class AudioParameters; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 | 21 |
21 class RendererAudioOutputDevice; | |
22 class WebRtcAudioCapturer; | 22 class WebRtcAudioCapturer; |
23 | 23 |
24 // WebRtcLocalAudioRenderer is a webkit_media::MediaStreamAudioRenderer | 24 // WebRtcLocalAudioRenderer is a webkit_media::MediaStreamAudioRenderer |
25 // designed for rendering local audio media stream tracks, | 25 // designed for rendering local audio media stream tracks, |
26 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack | 26 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack |
27 // It also implements media::AudioRendererSink::RenderCallback to render audio | 27 // It also implements media::AudioRendererSink::RenderCallback to render audio |
28 // data provided from a WebRtcAudioCapturer source which is set at construction. | 28 // data provided from a WebRtcAudioCapturer source which is set at construction. |
29 // When the audio layer in the browser process asks for data to render, this | 29 // When the audio layer in the browser process asks for data to render, this |
30 // class provides the data by reading from the source using the registered | 30 // class provides the data by reading from the source using the registered |
31 // WebRtcAudioCapturer source. | 31 // WebRtcAudioCapturer source. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // loopback, the source is a capture instance reading data from the | 84 // loopback, the source is a capture instance reading data from the |
85 // selected microphone. The recorded data is stored in a FIFO and consumed | 85 // selected microphone. The recorded data is stored in a FIFO and consumed |
86 // by this class when the sink asks for new data. | 86 // by this class when the sink asks for new data. |
87 // The WebRtcAudioCapturer is today created by WebRtcAudioDeviceImpl. | 87 // The WebRtcAudioCapturer is today created by WebRtcAudioDeviceImpl. |
88 scoped_refptr<WebRtcAudioCapturer> source_; | 88 scoped_refptr<WebRtcAudioCapturer> source_; |
89 | 89 |
90 // The render view in which the audio is rendered into |sink_|. | 90 // The render view in which the audio is rendered into |sink_|. |
91 const int source_render_view_id_; | 91 const int source_render_view_id_; |
92 | 92 |
93 // The sink (destination) for rendered audio. | 93 // The sink (destination) for rendered audio. |
94 scoped_refptr<RendererAudioOutputDevice> sink_; | 94 scoped_refptr<media::AudioOutputDevice> sink_; |
95 | 95 |
96 // Used to DCHECK that we are called on the correct thread. | 96 // Used to DCHECK that we are called on the correct thread. |
97 base::ThreadChecker thread_checker_; | 97 base::ThreadChecker thread_checker_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer); | 99 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace content | 102 } // namespace content |
103 | 103 |
104 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ | 104 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
OLD | NEW |