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

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

Issue 2625553003: DesktopCaptureDevice is available when webrtc is enabled. (Closed)
Patch Set: Use BUILDFLAG(ENABLE_WEBRTC) to use DesktopCaptureDevice Created 3 years, 11 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 | « no previous file | 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/video_capture_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index 6af09c0411e1b71cfec71c2d414e2eb4196b9ec2..5def870612775531441268d6cd87f0ae180f7f45 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -40,11 +40,12 @@
#include "media/capture/video/video_capture_device_client.h"
#include "media/capture/video/video_capture_device_factory.h"
-#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
+#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID)
miu 2017/01/10 23:27:49 Both (per prior e-mail on this CR): #if defined
byungchul 2017/01/10 23:48:33 Done.
#include "content/browser/media/capture/desktop_capture_device.h"
-#if defined(USE_AURA)
-#include "content/browser/media/capture/desktop_capture_device_aura.h"
#endif
+
+#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID) && defined(USE_AURA)
miu 2017/01/10 23:27:50 !defined(OS_ANDROID) is not needed (since AURA is
+#include "content/browser/media/capture/desktop_capture_device_aura.h"
#endif
#if defined(ENABLE_SCREEN_CAPTURE) && defined(OS_ANDROID)
@@ -683,13 +684,13 @@ VideoCaptureManager::DoStartDesktopCaptureOnDeviceThread(
DCHECK(IsOnDeviceThread());
std::unique_ptr<VideoCaptureDevice> video_capture_device;
-#if defined(ENABLE_SCREEN_CAPTURE)
DesktopMediaID desktop_id = DesktopMediaID::Parse(id);
if (desktop_id.is_null()) {
device_client->OnError(FROM_HERE, "Desktop media ID is null");
return nullptr;
}
+#if defined(ENABLE_SCREEN_CAPTURE)
miu 2017/01/10 23:27:49 Let's move this back up to where it was, given pre
byungchul 2017/01/10 23:48:33 Done.
if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) {
#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
video_capture_device = WebContentsVideoCaptureDevice::Create(id);
@@ -707,12 +708,15 @@ VideoCaptureManager::DoStartDesktopCaptureOnDeviceThread(
#if defined(USE_AURA)
video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id);
#endif // defined(USE_AURA)
- if (!video_capture_device)
- video_capture_device = DesktopCaptureDevice::Create(desktop_id);
#endif // defined (OS_ANDROID)
}
#endif // defined(ENABLE_SCREEN_CAPTURE)
+#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID)
miu 2017/01/10 23:27:49 ...and move this up so that it is within the ENABL
byungchul 2017/01/10 23:48:33 Done.
+ if (!video_capture_device)
+ video_capture_device = DesktopCaptureDevice::Create(desktop_id);
+#endif // BUILDFLAG(ENABLE_WEBRTC)
+
if (!video_capture_device) {
device_client->OnError(FROM_HERE, "Could not create capture device");
return nullptr;
@@ -1227,7 +1231,7 @@ void VideoCaptureManager::SetDesktopCaptureWindowIdOnDeviceThread(
media::VideoCaptureDevice* device,
gfx::NativeViewId window_id) {
DCHECK(IsOnDeviceThread());
-#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
+#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID)
DesktopCaptureDevice* desktop_device =
static_cast<DesktopCaptureDevice*>(device);
desktop_device->SetNotificationWindowId(window_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698