OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_ | |
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "content/common/content_export.h" | |
12 | |
13 namespace blink { | |
14 class WebMediaStreamTrack; | |
15 } | |
16 | |
17 namespace media { | |
18 class AudioParameters; | |
19 } | |
20 | |
21 namespace content { | |
22 | |
23 class CONTENT_EXPORT MediaStreamAudioSink { | |
24 public: | |
25 // Callback on delivering the audio interleaved data. | |
Jói
2013/11/27 17:35:02
audio interleaved data -> interleaved audio data
(
no longer working on chromium
2013/11/28 17:27:18
Done.
| |
26 // |audio_data| is the pointer to the audio data. | |
27 // |sample_rate| is the sample frequency of audio data. | |
Jói
2013/11/27 17:35:02
audio data -> |audio_data|
no longer working on chromium
2013/11/28 17:27:18
Done.
no longer working on chromium
2013/11/28 17:27:18
Done.
| |
28 // |number_of_channels| is the number of channels reflecting the order of | |
Jói
2013/11/27 17:35:02
"reflecting the order of surround sound channels"
no longer working on chromium
2013/11/28 17:27:18
OK, I just changed it to is the number of audio ch
| |
29 // surround sound channels. | |
30 // |number_of_frames| is the number of audio frames in the buffer. | |
Jói
2013/11/27 17:35:02
buffer -> |audio_data|
no longer working on chromium
2013/11/28 17:27:18
Done.
| |
31 virtual void OnData(const int16* audio_data, | |
32 int sample_rate, | |
33 int number_of_channels, | |
34 int number_of_frames) = 0; | |
35 | |
36 // Callback called when the forma of the audio stream has changed, and | |
Jói
2013/11/27 17:35:02
forma -> format
Suggest period after "changed" th
no longer working on chromium
2013/11/28 17:27:18
Done.
| |
37 // it will be called on the same thread as calling OnData(). | |
38 virtual void OnSetFormat(const media::AudioParameters& params) = 0; | |
39 | |
40 protected: | |
41 virtual ~MediaStreamAudioSink() {} | |
42 }; | |
43 | |
44 CONTENT_EXPORT void AddToAudioTrack(MediaStreamAudioSink* sink, | |
Jói
2013/11/27 17:35:02
nit: For consistency with RemoveFromAudioTrack, su
no longer working on chromium
2013/11/28 17:27:18
Done.
| |
45 const blink::WebMediaStreamTrack& track); | |
46 | |
47 CONTENT_EXPORT void RemoveFromAudioTrack( | |
48 MediaStreamAudioSink* sink, const blink::WebMediaStreamTrack& track); | |
49 | |
50 } // namespace content | |
51 | |
52 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_ | |
OLD | NEW |