OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" | 8 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" |
9 #include "content/renderer/media/webrtc_local_audio_source_provider.h" | 9 #include "content/renderer/media/webrtc_local_audio_source_provider.h" |
10 #include "content/renderer/media/webrtc_local_audio_track.h" | 10 #include "content/renderer/media/webrtc_local_audio_track.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize); | 28 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize); |
29 sink_bus_ = media::AudioBus::Create(sink_params_); | 29 sink_bus_ = media::AudioBus::Create(sink_params_); |
30 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( | 30 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( |
31 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); | 31 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); |
32 std::unique_ptr<WebRtcLocalAudioTrack> native_track( | 32 std::unique_ptr<WebRtcLocalAudioTrack> native_track( |
33 new WebRtcLocalAudioTrack(adapter.get())); | 33 new WebRtcLocalAudioTrack(adapter.get())); |
34 blink::WebMediaStreamSource audio_source; | 34 blink::WebMediaStreamSource audio_source; |
35 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"), | 35 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"), |
36 blink::WebMediaStreamSource::TypeAudio, | 36 blink::WebMediaStreamSource::TypeAudio, |
37 blink::WebString::fromUTF8("dummy_source_name"), | 37 blink::WebString::fromUTF8("dummy_source_name"), |
38 false /* remote */, true /* readonly */); | 38 false /* remote */); |
39 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), | 39 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), |
40 audio_source); | 40 audio_source); |
41 blink_track_.setExtraData(native_track.release()); | 41 blink_track_.setExtraData(native_track.release()); |
42 source_provider_.reset(new WebRtcLocalAudioSourceProvider(blink_track_)); | 42 source_provider_.reset(new WebRtcLocalAudioSourceProvider(blink_track_)); |
43 source_provider_->SetSinkParamsForTesting(sink_params_); | 43 source_provider_->SetSinkParamsForTesting(sink_params_); |
44 source_provider_->OnSetFormat(source_params_); | 44 source_provider_->OnSetFormat(source_params_); |
45 } | 45 } |
46 | 46 |
47 void TearDown() override { | 47 void TearDown() override { |
48 source_provider_.reset(); | 48 source_provider_.reset(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Stop the audio track. | 129 // Stop the audio track. |
130 WebRtcLocalAudioTrack* native_track = static_cast<WebRtcLocalAudioTrack*>( | 130 WebRtcLocalAudioTrack* native_track = static_cast<WebRtcLocalAudioTrack*>( |
131 MediaStreamTrack::GetTrack(blink_track_)); | 131 MediaStreamTrack::GetTrack(blink_track_)); |
132 native_track->Stop(); | 132 native_track->Stop(); |
133 | 133 |
134 // Delete the source provider. | 134 // Delete the source provider. |
135 source_provider_.reset(); | 135 source_provider_.reset(); |
136 } | 136 } |
137 | 137 |
138 } // namespace content | 138 } // namespace content |
OLD | NEW |