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

Unified 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: addressed Per's comments. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/public/renderer/media_stream_audio_sink.h
diff --git a/content/public/renderer/media_stream_audio_sink.h b/content/public/renderer/media_stream_audio_sink.h
new file mode 100644
index 0000000000000000000000000000000000000000..6e80470e16c1c42628c0701e4ad0eb162cae58ed
--- /dev/null
+++ b/content/public/renderer/media_stream_audio_sink.h
@@ -0,0 +1,52 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_
+#define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "content/common/content_export.h"
+
+namespace blink {
+class WebMediaStreamTrack;
+}
+
+namespace media {
+class AudioParameters;
+}
+
+namespace content {
+
+class CONTENT_EXPORT MediaStreamAudioSink {
+ public:
+ // 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.
+ // |audio_data| is the pointer to the audio data.
+ // |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.
+ // |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
+ // surround sound channels.
+ // |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.
+ virtual void OnData(const int16* audio_data,
+ int sample_rate,
+ int number_of_channels,
+ int number_of_frames) = 0;
+
+ // 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.
+ // it will be called on the same thread as calling OnData().
+ virtual void OnSetFormat(const media::AudioParameters& params) = 0;
+
+ protected:
+ virtual ~MediaStreamAudioSink() {}
+};
+
+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.
+ const blink::WebMediaStreamTrack& track);
+
+CONTENT_EXPORT void RemoveFromAudioTrack(
+ MediaStreamAudioSink* sink, const blink::WebMediaStreamTrack& track);
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_SINK_H_

Powered by Google App Engine
This is Rietveld 408576698