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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 2885653002: [Mojo Video Capture] Do not instantiate in-process VideoCaptureSystem when using service (Closed)
Patch Set: Use SEQUENCE_CHECKER macros and Rebase to May 19th Created 3 years, 7 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
« no previous file with comments | « content/browser/renderer_host/media/in_process_video_capture_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 if (!video_capture_provider) { 415 if (!video_capture_provider) {
416 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner = 416 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner =
417 audio_system_->GetTaskRunner(); 417 audio_system_->GetTaskRunner();
418 #if defined(OS_WIN) 418 #if defined(OS_WIN)
419 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of 419 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of
420 // buggy third party Direct Show modules, http://crbug.com/428958. 420 // buggy third party Direct Show modules, http://crbug.com/428958.
421 video_capture_thread_.init_com_with_mta(false); 421 video_capture_thread_.init_com_with_mta(false);
422 CHECK(video_capture_thread_.Start()); 422 CHECK(video_capture_thread_.Start());
423 device_task_runner = video_capture_thread_.task_runner(); 423 device_task_runner = video_capture_thread_.task_runner();
424 #endif 424 #endif
425 video_capture_provider = base::MakeUnique<InProcessVideoCaptureProvider>(
426 base::MakeUnique<media::VideoCaptureSystemImpl>(
427 media::VideoCaptureDeviceFactory::CreateFactory(
428 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))),
429 std::move(device_task_runner));
430 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) { 425 if (base::FeatureList::IsEnabled(video_capture::kMojoVideoCapture)) {
431 video_capture_provider = base::MakeUnique<VideoCaptureProviderSwitcher>( 426 video_capture_provider = base::MakeUnique<VideoCaptureProviderSwitcher>(
432 base::MakeUnique<ServiceVideoCaptureProvider>(), 427 base::MakeUnique<ServiceVideoCaptureProvider>(),
433 std::move(video_capture_provider)); 428 InProcessVideoCaptureProvider::CreateInstanceForNonDeviceCapture(
429 std::move(device_task_runner)));
430 } else {
431 video_capture_provider = InProcessVideoCaptureProvider::CreateInstance(
432 base::MakeUnique<media::VideoCaptureSystemImpl>(
433 media::VideoCaptureDeviceFactory::CreateFactory(
434 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))),
435 std::move(device_task_runner));
434 } 436 }
435 } 437 }
436 InitializeMaybeAsync(std::move(video_capture_provider)); 438 InitializeMaybeAsync(std::move(video_capture_provider));
437 439
438 base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); 440 base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
439 // BrowserMainLoop always creates the PowerMonitor instance before creating 441 // BrowserMainLoop always creates the PowerMonitor instance before creating
440 // MediaStreamManager, but power_monitor may be NULL in unit tests. 442 // MediaStreamManager, but power_monitor may be NULL in unit tests.
441 if (power_monitor) 443 if (power_monitor)
442 power_monitor->AddObserver(this); 444 power_monitor->AddObserver(this);
443 } 445 }
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 request->ui_proxy->OnStarted( 1788 request->ui_proxy->OnStarted(
1787 base::BindOnce(&MediaStreamManager::StopMediaStreamFromBrowser, 1789 base::BindOnce(&MediaStreamManager::StopMediaStreamFromBrowser,
1788 base::Unretained(this), label), 1790 base::Unretained(this), label),
1789 base::BindOnce(&MediaStreamManager::OnMediaStreamUIWindowId, 1791 base::BindOnce(&MediaStreamManager::OnMediaStreamUIWindowId,
1790 base::Unretained(this), request->video_type(), 1792 base::Unretained(this), request->video_type(),
1791 request->devices)); 1793 request->devices));
1792 } 1794 }
1793 } 1795 }
1794 1796
1795 } // namespace content 1797 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/in_process_video_capture_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698