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

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

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/content_renderer.gypi ('k') | content/renderer/media/media_stream_audio_source.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.h
diff --git a/content/renderer/media/media_stream_audio_source.h b/content/renderer/media/media_stream_audio_source.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e73395f7b5acc55abb303b9d41e5667b5105446
--- /dev/null
+++ b/content/renderer/media/media_stream_audio_source.h
@@ -0,0 +1,67 @@
+// 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.
+
+#ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
+#define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
+
+#include "base/compiler_specific.h"
+#include "content/common/content_export.h"
+#include "content/renderer/media/media_stream_dependency_factory.h"
+#include "content/renderer/media/media_stream_source.h"
+#include "content/renderer/media/webrtc_audio_capturer.h"
+#include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
+
+namespace content {
+
+class CONTENT_EXPORT MediaStreamAudioSource
+ : NON_EXPORTED_BASE(public MediaStreamSource) {
+ public:
+ MediaStreamAudioSource(int render_view_id,
+ const StreamDeviceInfo& device_info,
+ const SourceStoppedCallback& stop_callback,
+ MediaStreamDependencyFactory* factory);
+ MediaStreamAudioSource();
+ virtual ~MediaStreamAudioSource();
+
+ virtual void AddTrack(const blink::WebMediaStreamTrack& track,
+ const blink::WebMediaConstraints& constraints,
+ const ConstraintsCallback& callback) OVERRIDE;
+ virtual void RemoveTrack(const blink::WebMediaStreamTrack& track) OVERRIDE;
+
+ void SetLocalAudioSource(webrtc::AudioSourceInterface* source) {
+ local_audio_source_ = source;
+ }
+
+ void SetAudioCapturer(WebRtcAudioCapturer* capturer) {
+ DCHECK(!audio_capturer_);
+ audio_capturer_ = capturer;
+ }
+
+ const scoped_refptr<WebRtcAudioCapturer>& GetAudioCapturer() {
+ return audio_capturer_;
+ }
+
+ webrtc::AudioSourceInterface* local_audio_source() {
+ return local_audio_source_.get();
+ }
+
+ protected:
+ virtual void DoStopSource() OVERRIDE;
+
+ private:
+ int render_view_id_; // Render view ID that created this source.
+ // This member holds an instance of webrtc::LocalAudioSource. This is used
+ // as a container for audio options.
+ scoped_refptr<webrtc::AudioSourceInterface> local_audio_source_;
+
+ scoped_refptr<WebRtcAudioCapturer> audio_capturer_;
+
+ MediaStreamDependencyFactory* factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/media/media_stream_audio_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698