Commit c164a254 authored by byungchul's avatar byungchul Committed by Commit bot

DesktopCaptureDevice is available when webrtc is enabled.

ENABLED_SCREEN_CAPTURE is not flag to enable DesktopCaptureDevice.
It enables DesktopCaptureDeviceAura (if use_aura=1).

Use BUILDFLAG(ENABLE_WEBRTC) instead of ENABLED_SCREEN_CAPTURE to
use DesktopCaptureDevice in VidepCaptureManager.

BUG=internal b/34176576

Review-Url: https://codereview.chromium.org/2625553003
Cr-Commit-Position: refs/heads/master@{#442957}
parent 3ae6c6b5
......@@ -1499,17 +1499,10 @@ source_set("browser") {
"//third_party/webrtc/media:rtc_media_base",
"//third_party/webrtc/modules/desktop_capture:primitives",
]
if (is_linux || is_mac || is_win) {
sources += [
"media/capture/desktop_capture_device.cc",
"media/capture/desktop_capture_device.h",
]
deps += [ "//third_party/webrtc/modules/desktop_capture" ]
}
}
# Desktop screen capture implementations that are not dependent on WebRTC.
# Desktop screen capture implementations, conditionally built depending on
# the available implementations for each platform.
if (is_linux || is_mac || is_win) {
defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
sources += [
......@@ -1540,6 +1533,13 @@ source_set("browser") {
"media/capture/window_activity_tracker_mac.mm",
]
}
if (enable_webrtc) {
sources += [
"media/capture/desktop_capture_device.cc",
"media/capture/desktop_capture_device.h",
]
deps += [ "//third_party/webrtc/modules/desktop_capture" ]
}
}
if (is_win) {
......
......@@ -40,17 +40,22 @@
#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 defined(ENABLE_SCREEN_CAPTURE)
#if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID)
#include "content/browser/media/capture/desktop_capture_device.h"
#endif
#if defined(USE_AURA)
#include "content/browser/media/capture/desktop_capture_device_aura.h"
#endif
#endif
#if defined(ENABLE_SCREEN_CAPTURE) && defined(OS_ANDROID)
#if defined(OS_ANDROID)
#include "content/browser/media/capture/screen_capture_device_android.h"
#endif
#endif // defined(ENABLE_SCREEN_CAPTURE)
namespace {
class VideoFrameConsumerFeedbackObserverOnTaskRunner
......@@ -707,8 +712,10 @@ 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);
#if BUILDFLAG(ENABLE_WEBRTC)
if (!video_capture_device)
video_capture_device = DesktopCaptureDevice::Create(desktop_id);
#endif // BUILDFLAG(ENABLE_WEBRTC)
#endif // defined (OS_ANDROID)
}
#endif // defined(ENABLE_SCREEN_CAPTURE)
......@@ -1227,7 +1234,7 @@ void VideoCaptureManager::SetDesktopCaptureWindowIdOnDeviceThread(
media::VideoCaptureDevice* device,
gfx::NativeViewId window_id) {
DCHECK(IsOnDeviceThread());
#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
#if defined(ENABLE_SCREEN_CAPTURE) && BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID)
DesktopCaptureDevice* desktop_device =
static_cast<DesktopCaptureDevice*>(device);
desktop_device->SetNotificationWindowId(window_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment