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

Unified Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 189443010: Mac AVFoundation/QTKit: delay DeviceMonitorMac startup to first GetUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change included file device_monitor_mac.h with the forward declaration of the class & necessary met… Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index 14c0d4dc4675bb96ae83d0b79c0eb23a82f6ca30..b297e46bea4d21e4d92b7b6ef454e882480a3110 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -42,6 +42,12 @@
namespace content {
+// Forward declaration of DeviceMonitorMac and its only useable method.
+class DeviceMonitorMac {
+ public:
+ void StartMonitoring();
+};
+
namespace {
// Creates a random label used to identify requests.
std::string RandomLabel() {
@@ -784,8 +790,24 @@ void MediaStreamManager::StartMonitoring() {
audio_input_device_manager_->EnumerateDevices(MEDIA_DEVICE_AUDIO_CAPTURE);
++active_enumeration_ref_count_[MEDIA_DEVICE_VIDEO_CAPTURE];
video_capture_manager_->EnumerateDevices(MEDIA_DEVICE_VIDEO_CAPTURE);
+
+#if defined(OS_MACOSX)
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&MediaStreamManager::StartMonitoringOnUIThread,
+ base::Unretained(this)));
+#endif
}
+#if defined(OS_MACOSX)
+void MediaStreamManager::StartMonitoringOnUIThread() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ BrowserMainLoop* browser_main_loop = content::BrowserMainLoop::GetInstance();
+ if (browser_main_loop)
+ browser_main_loop->device_monitor_mac()->StartMonitoring();
+}
+#endif
+
void MediaStreamManager::StopMonitoring() {
DCHECK_EQ(base::MessageLoop::current(), io_loop_);
if (monitoring_started_) {
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698