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

Unified Diff: content/renderer/media/media_stream_audio_source.cc

Issue 131763002: Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 11 months 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
« no previous file with comments | « content/renderer/media/media_stream_audio_source.h ('k') | content/renderer/media/media_stream_center.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_audio_source.cc
diff --git a/content/renderer/media/media_stream_audio_source.cc b/content/renderer/media/media_stream_audio_source.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1d0e3276fa5fc9589e35dcaf1a9742146b3728c6
--- /dev/null
+++ b/content/renderer/media/media_stream_audio_source.cc
@@ -0,0 +1,50 @@
+// Copyright 2014 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.
+
+#include "content/renderer/media/media_stream_audio_source.h"
+
+namespace content {
+
+MediaStreamAudioSource::MediaStreamAudioSource(
+ int render_view_id,
+ const StreamDeviceInfo& device_info,
+ const SourceStoppedCallback& stop_callback,
+ MediaStreamDependencyFactory* factory)
+ : render_view_id_(render_view_id),
+ factory_(factory) {
+ SetDeviceInfo(device_info);
+ SetStopCallback(stop_callback);
+}
+
+MediaStreamAudioSource::MediaStreamAudioSource()
+ : render_view_id_(-1),
+ factory_(NULL) {
+}
+
+MediaStreamAudioSource::~MediaStreamAudioSource() {}
+
+void MediaStreamAudioSource::DoStopSource() {
+ audio_capturer_->Stop();
+}
+
+void MediaStreamAudioSource::AddTrack(
+ const blink::WebMediaStreamTrack& track,
+ const blink::WebMediaConstraints& constraints,
+ const ConstraintsCallback& callback) {
+ // TODO(xians): Properly implement for audio sources.
+ bool result = true;
+ if (factory_ && !local_audio_source_) {
+ result = factory_->InitializeMediaStreamAudioSource(render_view_id_,
+ constraints,
+ this);
+ }
+ callback.Run(this, result);
+}
+
+void MediaStreamAudioSource::RemoveTrack(
+ const blink::WebMediaStreamTrack& track) {
+ NOTIMPLEMENTED();
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_audio_source.h ('k') | content/renderer/media/media_stream_center.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698