Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: content/public/renderer/media_stream_audio_sink.h

Issue 90743004: Add generic interfaces for the sinks of the media stream audio track (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
6 #include "content/common/content_export.h"
7
8 namespace blink {
9 class WebMediaStreamTrack;
10 }
11
12 namespace content {
13
14 class CONTENT_EXPORT MediaStreamAudioSink {
no longer working on chromium 2013/11/27 13:36:20 it will inherit MediaStreamSink after Per lands hi
15 // Callback on delivering the audio interleaved data.
16 // |audio_data| is the pointer to the audio data.
17 // |sample_rate| is the sample frequency of audio data.
18 // |number_of_channels| is the number of channels reflecting the order of
19 // surround sound channels.
20 // |number_of_frames| is the number of audio freams in the buffer.
perkj_chrome 2013/11/27 14:56:40 spelling
no longer working on chromium 2013/11/27 16:27:57 Done.
21 // |channels| contains a vector of WebRtc VoE channels.
22 // |audio_delay_milliseconds| is recording delay value.
23 // |current_volume| is current microphone volume, in range of |0, 255].
24 // |need_audio_processing| indicates if the audio needs WebRtc AEC/NS/AGC
25 // audio processing.
26 // |key_pressed| is the flag to help typing detection.
27 // Note, |channels|, |audio_delay_milliseconds|, |current_volume|,
28 // |need_audio_processing| and |key_pressed| are needed by WebRtc, for other
29 // clients, those variables can be ignore.
30 // TODO(xians): Remove those WebRtc specific variables after moving the
no longer working on chromium 2013/11/27 13:36:20 I hope these comments and TODO can explain why we
31 // APM from WebRtc to Chrome.
32 // The return value is the new microphone volume, in the range of |0, 255].
33 // When the volume does not need to be updated, it returns 0.
34 virtual int OnData(const int16* audio_data,
35 int sample_rate,
36 int number_of_channels,
37 int number_of_frames,
38 const std::vector<int>& channels,
39 int audio_delay_milliseconds,
40 int current_volume,
41 bool need_audio_processing,
42 bool key_pressed) = 0;
43
44 // Callback called when the forma of the audio stream has changed, and
45 // it will be called on the same thread as calling OnData().
46 virtual void OnSetFormat(const media::AudioParameters& params) = 0;
47
48 protected:
49 virtual ~MediaStreamAudioSink() {}
50 };
51
52 CONTENT_EXPORT void AddToAudioTrack(MediaStreamAudioSink* sink,
53 const blink::WebMediaStreamTrack& track);
54
55 CONTENT_EXPORT void RemoveFromAudioTrack(
56 MediaStreamAudioSink* sink, const blink::WebMediaStreamTrack& track);
57
58 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698