| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/media/audio_track_recorder.h" | 5 #include "content/renderer/media/audio_track_recorder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 std::unique_ptr<float[]> buffer_; | 210 std::unique_ptr<float[]> buffer_; |
| 211 | 211 |
| 212 private: | 212 private: |
| 213 // Prepares a blink track of a given MediaStreamType and attaches the native | 213 // Prepares a blink track of a given MediaStreamType and attaches the native |
| 214 // track, which can be used to capture audio data and pass it to the producer. | 214 // track, which can be used to capture audio data and pass it to the producer. |
| 215 // Adapted from media::WebRTCLocalAudioSourceProviderTest. | 215 // Adapted from media::WebRTCLocalAudioSourceProviderTest. |
| 216 void PrepareBlinkTrack() { | 216 void PrepareBlinkTrack() { |
| 217 blink::WebMediaStreamSource audio_source; | 217 blink::WebMediaStreamSource audio_source; |
| 218 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"), | 218 audio_source.initialize(blink::WebString::fromUTF8("dummy_source_id"), |
| 219 blink::WebMediaStreamSource::TypeAudio, | 219 blink::WebMediaStreamSource::TypeAudio, |
| 220 blink::WebString::fromUTF8("dummy_source_name"), | 220 blink::WebString::fromUTF8("dummy_source_name")); |
| 221 false /* remote */); | |
| 222 audio_source.setExtraData(new MediaStreamAudioSource(true)); | 221 audio_source.setExtraData(new MediaStreamAudioSource(true)); |
| 223 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), | 222 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), |
| 224 audio_source); | 223 audio_source); |
| 225 CHECK(MediaStreamAudioSource::From(audio_source) | 224 CHECK(MediaStreamAudioSource::From(audio_source) |
| 226 ->ConnectToTrack(blink_track_)); | 225 ->ConnectToTrack(blink_track_)); |
| 227 } | 226 } |
| 228 | 227 |
| 229 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); | 228 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); |
| 230 }; | 229 }; |
| 231 | 230 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 296 |
| 298 if (GetParam().sample_rate % 100) | 297 if (GetParam().sample_rate % 100) |
| 299 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); | 298 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); |
| 300 | 299 |
| 301 run_loop.Run(); | 300 run_loop.Run(); |
| 302 Mock::VerifyAndClearExpectations(this); | 301 Mock::VerifyAndClearExpectations(this); |
| 303 } | 302 } |
| 304 | 303 |
| 305 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); | 304 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); |
| 306 } // namespace content | 305 } // namespace content |
| OLD | NEW |