OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_devices_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <queue> | 10 #include <queue> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 origin_(GURL("https://test.com")) { | 77 origin_(GURL("https://test.com")) { |
78 // Make sure we use fake devices to avoid long delays. | 78 // Make sure we use fake devices to avoid long delays. |
79 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 79 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
80 switches::kUseFakeDeviceForMediaStream, | 80 switches::kUseFakeDeviceForMediaStream, |
81 base::StringPrintf("device-count=%zu, video-input-default-id=%s", | 81 base::StringPrintf("device-count=%zu, video-input-default-id=%s", |
82 kNumFakeVideoDevices, kDefaultVideoDeviceID)); | 82 kNumFakeVideoDevices, kDefaultVideoDeviceID)); |
83 audio_manager_.reset( | 83 audio_manager_.reset( |
84 new media::MockAudioManager(base::ThreadTaskRunnerHandle::Get())); | 84 new media::MockAudioManager(base::ThreadTaskRunnerHandle::Get())); |
85 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 85 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
86 media_stream_manager_ = | 86 media_stream_manager_ = |
87 base::MakeUnique<MediaStreamManager>(audio_system_.get()); | 87 MediaStreamManager::CreateWithDefaults(audio_system_.get()); |
88 | 88 |
89 MockResourceContext* mock_resource_context = | 89 MockResourceContext* mock_resource_context = |
90 static_cast<MockResourceContext*>( | 90 static_cast<MockResourceContext*>( |
91 browser_context_.GetResourceContext()); | 91 browser_context_.GetResourceContext()); |
92 | 92 |
93 host_ = base::MakeUnique<MediaDevicesDispatcherHost>( | 93 host_ = base::MakeUnique<MediaDevicesDispatcherHost>( |
94 kProcessId, kRenderId, mock_resource_context->GetMediaDeviceIDSalt(), | 94 kProcessId, kRenderId, mock_resource_context->GetMediaDeviceIDSalt(), |
95 media_stream_manager_.get()); | 95 media_stream_manager_.get()); |
96 } | 96 } |
97 | 97 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // On Windows, the underlying MediaStreamManager uses a separate thread for | 382 // On Windows, the underlying MediaStreamManager uses a separate thread for |
383 // video capture which must be flushed to guarantee that the callback bound to | 383 // video capture which must be flushed to guarantee that the callback bound to |
384 // GetVIdeoInputCapabilities above is invoked before the end of this test's | 384 // GetVIdeoInputCapabilities above is invoked before the end of this test's |
385 // body. | 385 // body. |
386 media_stream_manager_->FlushVideoCaptureThreadForTesting(); | 386 media_stream_manager_->FlushVideoCaptureThreadForTesting(); |
387 base::RunLoop().RunUntilIdle(); | 387 base::RunLoop().RunUntilIdle(); |
388 #endif | 388 #endif |
389 } | 389 } |
390 | 390 |
391 }; // namespace content | 391 }; // namespace content |
OLD | NEW |