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.
5 #include "content/renderer/media/media_stream_audio_source.h"
9 MediaStreamAudioSource::MediaStreamAudioSource(
11 const StreamDeviceInfo& device_info,
12 const SourceStoppedCallback& stop_callback,
13 MediaStreamDependencyFactory* factory)
14 : render_view_id_(render_view_id),
16 SetDeviceInfo(device_info);
17 SetStopCallback(stop_callback);
20 MediaStreamAudioSource::MediaStreamAudioSource()
21 : render_view_id_(-1),
25 MediaStreamAudioSource::~MediaStreamAudioSource() {}
27 void MediaStreamAudioSource::DoStopSource() {
28 if (audio_capturer_.get())
29 audio_capturer_->Stop();
32 void MediaStreamAudioSource::AddTrack(
33 const blink::WebMediaStreamTrack& track,
34 const blink::WebMediaConstraints& constraints,
35 const ConstraintsCallback& callback) {
36 // TODO(xians): Properly implement for audio sources.
38 if (factory_ && !local_audio_source_) {
39 result = factory_->InitializeMediaStreamAudioSource(render_view_id_,
43 callback.Run(this, result);
46 void MediaStreamAudioSource::RemoveTrack(
47 const blink::WebMediaStreamTrack& track) {
51 } // namespace content