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

Side by Side Diff: content/renderer/media/webrtc_local_audio_source_provider_unittest.cc

Issue 218763007: Update MediaStreamTrack::Stop to latest draft. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 8 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
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 7 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
8 #include "content/renderer/media/webrtc_audio_capturer.h" 8 #include "content/renderer/media/webrtc_audio_capturer.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 14 matching lines...) Expand all
25 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 25 media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
26 media::CHANNEL_LAYOUT_STEREO, 2, 0, 44100, 16, 26 media::CHANNEL_LAYOUT_STEREO, 2, 0, 44100, 16,
27 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize); 27 WebRtcLocalAudioSourceProvider::kWebAudioRenderBufferSize);
28 const int length = 28 const int length =
29 source_params_.frames_per_buffer() * source_params_.channels(); 29 source_params_.frames_per_buffer() * source_params_.channels();
30 source_data_.reset(new int16[length]); 30 source_data_.reset(new int16[length]);
31 sink_bus_ = media::AudioBus::Create(sink_params_); 31 sink_bus_ = media::AudioBus::Create(sink_params_);
32 blink::WebMediaConstraints constraints; 32 blink::WebMediaConstraints constraints;
33 scoped_refptr<WebRtcAudioCapturer> capturer( 33 scoped_refptr<WebRtcAudioCapturer> capturer(
34 WebRtcAudioCapturer::CreateCapturer(-1, StreamDeviceInfo(), 34 WebRtcAudioCapturer::CreateCapturer(-1, StreamDeviceInfo(),
35 constraints, NULL)); 35 constraints, NULL, NULL));
36 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter( 36 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter(
37 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)); 37 WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL));
38 scoped_ptr<WebRtcLocalAudioTrack> native_track( 38 scoped_ptr<WebRtcLocalAudioTrack> native_track(
39 new WebRtcLocalAudioTrack(adapter, capturer, NULL)); 39 new WebRtcLocalAudioTrack(adapter, capturer, NULL));
40 blink::WebMediaStreamSource audio_source; 40 blink::WebMediaStreamSource audio_source;
41 audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"), 41 audio_source.initialize(base::UTF8ToUTF16("dummy_source_id"),
42 blink::WebMediaStreamSource::TypeAudio, 42 blink::WebMediaStreamSource::TypeAudio,
43 base::UTF8ToUTF16("dummy_source_name")); 43 base::UTF8ToUTF16("dummy_source_name"));
44 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), 44 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"),
45 audio_source); 45 audio_source);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Stop the audio track. 128 // Stop the audio track.
129 WebRtcLocalAudioTrack* native_track = static_cast<WebRtcLocalAudioTrack*>( 129 WebRtcLocalAudioTrack* native_track = static_cast<WebRtcLocalAudioTrack*>(
130 MediaStreamTrack::GetTrack(blink_track_)); 130 MediaStreamTrack::GetTrack(blink_track_));
131 native_track->Stop(); 131 native_track->Stop();
132 132
133 // Delete the source provider. 133 // Delete the source provider.
134 source_provider_.reset(); 134 source_provider_.reset();
135 } 135 }
136 136
137 } // namespace content 137 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer_unittest.cc ('k') | content/renderer/media/webrtc_local_audio_track.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698