OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/media/audio_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 void CreateUnifiedStream(const url::Origin& security_origin) { | 408 void CreateUnifiedStream(const url::Origin& security_origin) { |
409 std::string output_id = GetNondefaultIdExpectedToPassPermissionsCheck(); | 409 std::string output_id = GetNondefaultIdExpectedToPassPermissionsCheck(); |
410 std::string input_id = GetNondefaultInputId(); | 410 std::string input_id = GetNondefaultInputId(); |
411 std::string hashed_output_id = MediaStreamManager::GetHMACForMediaDeviceID( | 411 std::string hashed_output_id = MediaStreamManager::GetHMACForMediaDeviceID( |
412 kSalt, url::Origin(GURL(kSecurityOrigin)), output_id); | 412 kSalt, url::Origin(GURL(kSecurityOrigin)), output_id); |
413 // Set up association between input and output so that the output | 413 // Set up association between input and output so that the output |
414 // device gets selected when using session id: | 414 // device gets selected when using session id: |
415 audio_manager_->CreateDeviceAssociation(input_id, output_id); | 415 audio_manager_->CreateDeviceAssociation(input_id, output_id); |
416 int session_id = media_stream_manager_->audio_input_device_manager()->Open( | 416 int session_id = media_stream_manager_->audio_input_device_manager()->Open( |
417 StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "Fake input device", | 417 MediaStreamDevice(MEDIA_DEVICE_AUDIO_CAPTURE, input_id, |
418 input_id)); | 418 "Fake input device")); |
419 base::RunLoop().RunUntilIdle(); | 419 base::RunLoop().RunUntilIdle(); |
420 | 420 |
421 // Send a create stream message to the audio output stream and wait until | 421 // Send a create stream message to the audio output stream and wait until |
422 // we receive the created message. | 422 // we receive the created message. |
423 media::AudioParameters params( | 423 media::AudioParameters params( |
424 media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, | 424 media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, |
425 media::AudioParameters::kAudioCDSampleRate, 16, | 425 media::AudioParameters::kAudioCDSampleRate, 16, |
426 media::AudioParameters::kAudioCDSampleRate / 10); | 426 media::AudioParameters::kAudioCDSampleRate / 10); |
427 | 427 |
428 EXPECT_CALL(*host_.get(), | 428 EXPECT_CALL(*host_.get(), |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 616 } |
617 | 617 |
618 TEST_F(AudioRendererHostTest, CreateFailsForInvalidRenderFrame) { | 618 TEST_F(AudioRendererHostTest, CreateFailsForInvalidRenderFrame) { |
619 CreateWithInvalidRenderFrameId(); | 619 CreateWithInvalidRenderFrameId(); |
620 Close(); | 620 Close(); |
621 } | 621 } |
622 | 622 |
623 // TODO(hclam): Add tests for data conversation in low latency mode. | 623 // TODO(hclam): Add tests for data conversation in low latency mode. |
624 | 624 |
625 } // namespace content | 625 } // namespace content |
OLD | NEW |