| Index: content/browser/media/capture/web_contents_video_capture_device.cc
|
| diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
|
| index 0733a1fd9a9b01844af1eaf338cb437c4a931c65..15da56e9de90405e9db9de6279b492d764cf5438 100644
|
| --- a/content/browser/media/capture/web_contents_video_capture_device.cc
|
| +++ b/content/browser/media/capture/web_contents_video_capture_device.cc
|
| @@ -80,13 +80,13 @@
|
| #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_contents_media_capture_id.h"
|
| +#include "device/capture/content/screen_capture_device_core.h"
|
| +#include "device/capture/content/thread_safe_capture_oracle.h"
|
| +#include "device/capture/content/video_capture_oracle.h"
|
| #include "media/base/bind_to_current_loop.h"
|
| #include "media/base/video_capture_types.h"
|
| #include "media/base/video_frame_metadata.h"
|
| #include "media/base/video_util.h"
|
| -#include "media/capture/content/screen_capture_device_core.h"
|
| -#include "media/capture/content/thread_safe_capture_oracle.h"
|
| -#include "media/capture/content/video_capture_oracle.h"
|
| #include "skia/ext/image_operations.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| @@ -135,8 +135,8 @@ class VideoFrameDeliveryLog {
|
| // with RenderWidgetHostViewFrameSubscriber. We create one per event type.
|
| class FrameSubscriber : public RenderWidgetHostViewFrameSubscriber {
|
| public:
|
| - FrameSubscriber(media::VideoCaptureOracle::Event event_type,
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle,
|
| + FrameSubscriber(device::VideoCaptureOracle::Event event_type,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle,
|
| VideoFrameDeliveryLog* delivery_log,
|
| base::WeakPtr<content::CursorRenderer> cursor_renderer,
|
| base::WeakPtr<content::WindowActivityTracker> tracker)
|
| @@ -156,7 +156,7 @@ class FrameSubscriber : public RenderWidgetHostViewFrameSubscriber {
|
|
|
| static void DidCaptureFrame(
|
| base::WeakPtr<FrameSubscriber> frame_subscriber_,
|
| - const media::ThreadSafeCaptureOracle::CaptureFrameCallback&
|
| + const device::ThreadSafeCaptureOracle::CaptureFrameCallback&
|
| capture_frame_cb,
|
| const scoped_refptr<media::VideoFrame>& frame,
|
| base::TimeTicks timestamp,
|
| @@ -166,8 +166,8 @@ class FrameSubscriber : public RenderWidgetHostViewFrameSubscriber {
|
| bool IsUserInteractingWithContent();
|
|
|
| private:
|
| - const media::VideoCaptureOracle::Event event_type_;
|
| - scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_;
|
| + const device::VideoCaptureOracle::Event event_type_;
|
| + scoped_refptr<device::ThreadSafeCaptureOracle> oracle_proxy_;
|
| VideoFrameDeliveryLog* const delivery_log_;
|
| // We need a weak pointer since FrameSubscriber is owned externally and
|
| // may outlive the cursor renderer.
|
| @@ -204,7 +204,7 @@ class ContentCaptureSubscription {
|
| // work.
|
| ContentCaptureSubscription(
|
| const RenderWidgetHost& source,
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const CaptureCallback& capture_callback);
|
| ~ContentCaptureSubscription();
|
|
|
| @@ -253,7 +253,7 @@ void RenderVideoFrame(
|
|
|
| // Renews capture subscriptions based on feedback from WebContentsTracker, and
|
| // also executes copying of the backing store on the UI BrowserThread.
|
| -class WebContentsCaptureMachine : public media::VideoCaptureMachine {
|
| +class WebContentsCaptureMachine : public device::VideoCaptureMachine {
|
| public:
|
| WebContentsCaptureMachine(int render_process_id,
|
| int main_render_frame_id,
|
| @@ -261,7 +261,7 @@ class WebContentsCaptureMachine : public media::VideoCaptureMachine {
|
| ~WebContentsCaptureMachine() override;
|
|
|
| // VideoCaptureMachine overrides.
|
| - void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + void Start(const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const media::VideoCaptureParams& params,
|
| const base::Callback<void(bool)> callback) override;
|
| void Stop(const base::Closure& callback) override;
|
| @@ -282,7 +282,7 @@ class WebContentsCaptureMachine : public media::VideoCaptureMachine {
|
|
|
| private:
|
| bool InternalStart(
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const media::VideoCaptureParams& params);
|
| void InternalStop(const base::Closure& callback);
|
| void InternalMaybeCaptureForRefresh();
|
| @@ -333,7 +333,7 @@ class WebContentsCaptureMachine : public media::VideoCaptureMachine {
|
| std::unique_ptr<base::Thread> render_thread_;
|
|
|
| // Makes all the decisions about which frames to copy, and how.
|
| - scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_;
|
| + scoped_refptr<device::ThreadSafeCaptureOracle> oracle_proxy_;
|
|
|
| // Video capture parameters that this machine is started with.
|
| media::VideoCaptureParams capture_params_;
|
| @@ -360,7 +360,7 @@ bool FrameSubscriber::ShouldCaptureFrame(
|
| TRACE_EVENT1("gpu.capture", "FrameSubscriber::ShouldCaptureFrame", "instance",
|
| this);
|
|
|
| - media::ThreadSafeCaptureOracle::CaptureFrameCallback capture_frame_cb;
|
| + device::ThreadSafeCaptureOracle::CaptureFrameCallback capture_frame_cb;
|
|
|
| bool oracle_decision = oracle_proxy_->ObserveEventAndDecideCapture(
|
| event_type_, damage_rect, present_time, storage, &capture_frame_cb);
|
| @@ -376,7 +376,7 @@ bool FrameSubscriber::ShouldCaptureFrame(
|
|
|
| void FrameSubscriber::DidCaptureFrame(
|
| base::WeakPtr<FrameSubscriber> frame_subscriber_,
|
| - const media::ThreadSafeCaptureOracle::CaptureFrameCallback&
|
| + const device::ThreadSafeCaptureOracle::CaptureFrameCallback&
|
| capture_frame_cb,
|
| const scoped_refptr<media::VideoFrame>& frame,
|
| base::TimeTicks timestamp,
|
| @@ -425,7 +425,7 @@ bool FrameSubscriber::IsUserInteractingWithContent() {
|
|
|
| ContentCaptureSubscription::ContentCaptureSubscription(
|
| const RenderWidgetHost& source,
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const CaptureCallback& capture_callback)
|
| : render_process_id_(source.GetProcess()->GetID()),
|
| render_widget_id_(source.GetRoutingID()),
|
| @@ -442,14 +442,14 @@ ContentCaptureSubscription::ContentCaptureSubscription(
|
| }
|
| #endif
|
| refresh_subscriber_.reset(new FrameSubscriber(
|
| - media::VideoCaptureOracle::kActiveRefreshRequest, oracle_proxy,
|
| + device::VideoCaptureOracle::kActiveRefreshRequest, oracle_proxy,
|
| &delivery_log_,
|
| cursor_renderer_ ? cursor_renderer_->GetWeakPtr()
|
| : base::WeakPtr<CursorRenderer>(),
|
| window_activity_tracker_ ? window_activity_tracker_->GetWeakPtr()
|
| : base::WeakPtr<WindowActivityTracker>()));
|
| mouse_activity_subscriber_.reset(new FrameSubscriber(
|
| - media::VideoCaptureOracle::kMouseCursorUpdate, oracle_proxy,
|
| + device::VideoCaptureOracle::kMouseCursorUpdate, oracle_proxy,
|
| &delivery_log_, cursor_renderer_ ? cursor_renderer_->GetWeakPtr()
|
| : base::WeakPtr<CursorRenderer>(),
|
| window_activity_tracker_ ? window_activity_tracker_->GetWeakPtr()
|
| @@ -460,7 +460,7 @@ ContentCaptureSubscription::ContentCaptureSubscription(
|
| if (view) {
|
| std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber(
|
| new FrameSubscriber(
|
| - media::VideoCaptureOracle::kCompositorUpdate, oracle_proxy,
|
| + device::VideoCaptureOracle::kCompositorUpdate, oracle_proxy,
|
| &delivery_log_, cursor_renderer_ ? cursor_renderer_->GetWeakPtr()
|
| : base::WeakPtr<CursorRenderer>(),
|
| window_activity_tracker_ ? window_activity_tracker_->GetWeakPtr()
|
| @@ -632,7 +632,7 @@ bool WebContentsCaptureMachine::IsStarted() const {
|
| }
|
|
|
| void WebContentsCaptureMachine::Start(
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const media::VideoCaptureParams& params,
|
| const base::Callback<void(bool)> callback) {
|
| // Starts the capture machine asynchronously.
|
| @@ -644,7 +644,7 @@ void WebContentsCaptureMachine::Start(
|
| }
|
|
|
| bool WebContentsCaptureMachine::InternalStart(
|
| - const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
|
| + const scoped_refptr<device::ThreadSafeCaptureOracle>& oracle_proxy,
|
| const media::VideoCaptureParams& params) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| DCHECK(!IsStarted());
|
| @@ -939,8 +939,8 @@ WebContentsVideoCaptureDevice::WebContentsVideoCaptureDevice(
|
| int render_process_id,
|
| int main_render_frame_id,
|
| bool enable_auto_throttling)
|
| - : core_(new media::ScreenCaptureDeviceCore(
|
| - std::unique_ptr<media::VideoCaptureMachine>(
|
| + : core_(new device::ScreenCaptureDeviceCore(
|
| + std::unique_ptr<device::VideoCaptureMachine>(
|
| new WebContentsCaptureMachine(render_process_id,
|
| main_render_frame_id,
|
| enable_auto_throttling)))) {}
|
| @@ -950,7 +950,7 @@ WebContentsVideoCaptureDevice::~WebContentsVideoCaptureDevice() {
|
| }
|
|
|
| // static
|
| -media::VideoCaptureDevice* WebContentsVideoCaptureDevice::Create(
|
| +device::VideoCaptureDevice* WebContentsVideoCaptureDevice::Create(
|
| const std::string& device_id) {
|
| // Parse device_id into render_process_id and main_render_frame_id.
|
| int render_process_id = -1;
|
|
|