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

Side by Side 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: Move initialization of the audio source object to MediaStreamAudioSource::AddTrack and check result. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
7
8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h"
10 #include "content/renderer/media/media_stream_dependency_factory.h"
11 #include "content/renderer/media/media_stream_source.h"
12 #include "content/renderer/media/webrtc_audio_capturer.h"
13 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
14
15 namespace content {
16
17 class CONTENT_EXPORT MediaStreamAudioSource
18 : NON_EXPORTED_BASE(public MediaStreamSource) {
19 public:
20 MediaStreamAudioSource(int render_view_id,
21 const StreamDeviceInfo& device_info,
22 const SourceStoppedCallback& stop_callback,
23 MediaStreamDependencyFactory* factory);
24 MediaStreamAudioSource();
25 virtual ~MediaStreamAudioSource();
26
27 virtual void AddTrack(const blink::WebMediaStreamTrack& track,
28 const blink::WebMediaConstraints& constraints,
29 const ConstraintsCallback& callback) OVERRIDE;
30 virtual void RemoveTrack(const blink::WebMediaStreamTrack& track) OVERRIDE;
31
32 void SetLocalAudioSource(webrtc::AudioSourceInterface* source) {
33 local_audio_source_ = source;
34 }
35
36 void SetAudioCapturer(WebRtcAudioCapturer* capturer) {
37 DCHECK(!audio_capturer_);
38 audio_capturer_ = capturer;
39 }
40
41 const scoped_refptr<WebRtcAudioCapturer>& GetAudioCapturer() {
42 return audio_capturer_;
43 }
44
45 webrtc::AudioSourceInterface* local_audio_source() {
46 return local_audio_source_.get();
47 }
48
49 protected:
50 virtual void DoStopSource() OVERRIDE;
51
52 private:
53 int render_view_id_; // Render view Id that created this source.
Jói 2014/01/27 22:14:57 nit: Two spaces before // Also, Id -> ID
perkj_chrome 2014/01/28 08:31:43 Done.
54 // This member holds an instance of webrtc::LocalAudioSource. This is used
55 // as a container for audio options.
56 scoped_refptr<webrtc::AudioSourceInterface> local_audio_source_;
57
58 scoped_refptr<WebRtcAudioCapturer> audio_capturer_;
59
60 MediaStreamDependencyFactory* factory_;
no longer working on chromium 2014/01/28 12:09:22 Could you please add a TODO here to remind me remo
61
62 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSource);
63 };
64
65 } // namespace content
66
67 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698