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

Side by Side 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, 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 #include "content/renderer/media/media_stream_audio_source.h"
6
7 namespace content {
8
9 MediaStreamAudioSource::MediaStreamAudioSource(
10 int render_view_id,
11 const StreamDeviceInfo& device_info,
12 const SourceStoppedCallback& stop_callback,
13 MediaStreamDependencyFactory* factory)
14 : render_view_id_(render_view_id),
15 factory_(factory) {
16 SetDeviceInfo(device_info);
17 SetStopCallback(stop_callback);
18 }
19
20 MediaStreamAudioSource::MediaStreamAudioSource()
21 : render_view_id_(-1),
22 factory_(NULL) {
23 }
24
25 MediaStreamAudioSource::~MediaStreamAudioSource() {}
26
27 void MediaStreamAudioSource::DoStopSource() {
28 audio_capturer_->Stop();
29 }
30
31 void MediaStreamAudioSource::AddTrack(
32 const blink::WebMediaStreamTrack& track,
33 const blink::WebMediaConstraints& constraints,
34 const ConstraintsCallback& callback) {
35 // TODO(xians): Properly implement for audio sources.
36 bool result = true;
37 if (factory_ && !local_audio_source_) {
38 result = factory_->InitializeMediaStreamAudioSource(render_view_id_,
39 constraints,
40 this);
41 }
42 callback.Run(this, result);
43 }
44
45 void MediaStreamAudioSource::RemoveTrack(
46 const blink::WebMediaStreamTrack& track) {
47 NOTIMPLEMENTED();
48 }
49
50 } // namespace content
OLDNEW
« 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