| 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_recorder/audio_track_recorder.h" | 5 #include "content/renderer/media_recorder/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 */); |
| 221 audio_source.setExtraData(new MediaStreamAudioSource(true)); | 222 audio_source.setExtraData(new MediaStreamAudioSource(true)); |
| 222 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), | 223 blink_track_.initialize(blink::WebString::fromUTF8("audio_track"), |
| 223 audio_source); | 224 audio_source); |
| 224 CHECK(MediaStreamAudioSource::From(audio_source) | 225 CHECK(MediaStreamAudioSource::From(audio_source) |
| 225 ->ConnectToTrack(blink_track_)); | 226 ->ConnectToTrack(blink_track_)); |
| 226 } | 227 } |
| 227 | 228 |
| 228 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); | 229 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorderTest); |
| 229 }; | 230 }; |
| 230 | 231 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 297 |
| 297 if (GetParam().sample_rate % 100) | 298 if (GetParam().sample_rate % 100) |
| 298 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); | 299 audio_track_recorder_->OnData(*GetFirstSourceAudioBus(), TimeTicks::Now()); |
| 299 | 300 |
| 300 run_loop.Run(); | 301 run_loop.Run(); |
| 301 Mock::VerifyAndClearExpectations(this); | 302 Mock::VerifyAndClearExpectations(this); |
| 302 } | 303 } |
| 303 | 304 |
| 304 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); | 305 INSTANTIATE_TEST_CASE_P(, AudioTrackRecorderTest, ValuesIn(kATRTestParams)); |
| 305 } // namespace content | 306 } // namespace content |
| OLD | NEW |