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

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

Issue 2214533002: move //media/capture to //device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 #include <string.h> 9 #include <string.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/public/browser/content_browser_client.h" 42 #include "content/public/browser/content_browser_client.h"
43 #include "content/public/browser/desktop_media_id.h" 43 #include "content/public/browser/desktop_media_id.h"
44 #include "content/public/browser/media_observer.h" 44 #include "content/public/browser/media_observer.h"
45 #include "content/public/browser/media_request_state.h" 45 #include "content/public/browser/media_request_state.h"
46 #include "content/public/browser/render_process_host.h" 46 #include "content/public/browser/render_process_host.h"
47 #include "content/public/browser/web_contents_media_capture_id.h" 47 #include "content/public/browser/web_contents_media_capture_id.h"
48 #include "content/public/common/content_client.h" 48 #include "content/public/common/content_client.h"
49 #include "content/public/common/content_switches.h" 49 #include "content/public/common/content_switches.h"
50 #include "content/public/common/media_stream_request.h" 50 #include "content/public/common/media_stream_request.h"
51 #include "crypto/hmac.h" 51 #include "crypto/hmac.h"
52 #include "device/capture/video/video_capture_device_factory.h"
52 #include "media/audio/audio_device_description.h" 53 #include "media/audio/audio_device_description.h"
53 #include "media/audio/audio_manager.h" 54 #include "media/audio/audio_manager.h"
54 #include "media/base/audio_parameters.h" 55 #include "media/base/audio_parameters.h"
55 #include "media/base/channel_layout.h" 56 #include "media/base/channel_layout.h"
56 #include "media/base/media_switches.h" 57 #include "media/base/media_switches.h"
57 #include "media/capture/video/video_capture_device_factory.h"
58 #include "url/gurl.h" 58 #include "url/gurl.h"
59 #include "url/origin.h" 59 #include "url/origin.h"
60 60
61 #if defined(OS_WIN) 61 #if defined(OS_WIN)
62 #include "base/win/scoped_com_initializer.h" 62 #include "base/win/scoped_com_initializer.h"
63 #endif 63 #endif
64 64
65 #if defined(OS_CHROMEOS) 65 #if defined(OS_CHROMEOS)
66 #include "chromeos/audio/cras_audio_handler.h" 66 #include "chromeos/audio/cras_audio_handler.h"
67 #endif 67 #endif
68 68
69 #if defined(OS_MACOSX) 69 #if defined(OS_MACOSX)
70 #include "media/capture/device_monitor_mac.h" 70 #include "device/capture/device_monitor_mac.h"
71 #endif 71 #endif
72 72
73 namespace content { 73 namespace content {
74 74
75 base::LazyInstance<base::ThreadLocalPointer<MediaStreamManager>>::Leaky 75 base::LazyInstance<base::ThreadLocalPointer<MediaStreamManager>>::Leaky
76 g_media_stream_manager_tls_ptr = LAZY_INSTANCE_INITIALIZER; 76 g_media_stream_manager_tls_ptr = LAZY_INSTANCE_INITIALIZER;
77 77
78 namespace { 78 namespace {
79 // Creates a random label used to identify requests. 79 // Creates a random label used to identify requests.
80 std::string RandomLabel() { 80 std::string RandomLabel() {
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 switches::kUseFakeDeviceForMediaStream)) { 1591 switches::kUseFakeDeviceForMediaStream)) {
1592 audio_input_device_manager()->UseFakeDevice(); 1592 audio_input_device_manager()->UseFakeDevice();
1593 } 1593 }
1594 1594
1595 // TODO(dalecurtis): Remove ScopedTracker below once crbug.com/457525 is 1595 // TODO(dalecurtis): Remove ScopedTracker below once crbug.com/457525 is
1596 // fixed. 1596 // fixed.
1597 tracked_objects::ScopedTracker tracking_profile4( 1597 tracked_objects::ScopedTracker tracking_profile4(
1598 FROM_HERE_WITH_EXPLICIT_FUNCTION( 1598 FROM_HERE_WITH_EXPLICIT_FUNCTION(
1599 "457525 MediaStreamManager::InitializeDeviceManagersOnIOThread 4")); 1599 "457525 MediaStreamManager::InitializeDeviceManagersOnIOThread 4"));
1600 video_capture_manager_ = 1600 video_capture_manager_ =
1601 new VideoCaptureManager(media::VideoCaptureDeviceFactory::CreateFactory( 1601 new VideoCaptureManager(device::VideoCaptureDeviceFactory::CreateFactory(
1602 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); 1602 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)));
1603 #if defined(OS_WIN) 1603 #if defined(OS_WIN)
1604 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of 1604 // Use an STA Video Capture Thread to try to avoid crashes on enumeration of
1605 // buggy third party Direct Show modules, http://crbug.com/428958. 1605 // buggy third party Direct Show modules, http://crbug.com/428958.
1606 video_capture_thread_.init_com_with_mta(false); 1606 video_capture_thread_.init_com_with_mta(false);
1607 CHECK(video_capture_thread_.Start()); 1607 CHECK(video_capture_thread_.Start());
1608 video_capture_manager_->Register(this, video_capture_thread_.task_runner()); 1608 video_capture_manager_->Register(this, video_capture_thread_.task_runner());
1609 #else 1609 #else
1610 video_capture_manager_->Register(this, device_task_runner_); 1610 video_capture_manager_->Register(this, device_task_runner_);
1611 #endif 1611 #endif
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 if (device_info.session_id == session_id && 2181 if (device_info.session_id == session_id &&
2182 device_info.device.type == type) { 2182 device_info.device.type == type) {
2183 request->SetCapturingLinkSecured(is_secure); 2183 request->SetCapturingLinkSecured(is_secure);
2184 return; 2184 return;
2185 } 2185 }
2186 } 2186 }
2187 } 2187 }
2188 } 2188 }
2189 2189
2190 } // namespace content 2190 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698