There is a new video capture API that can do everything needed,
so this patch is no longer required.
This commit is contained in:
Shelley Vohr 2018-03-26 20:24:51 +03:00 коммит произвёл Aleksei Kuzmin
Родитель 3489c6998d
Коммит e2f404a40b
2 изменённых файлов: 0 добавлений и 88 удалений

Просмотреть файл

@ -123,10 +123,6 @@ patches:
owners: zcbenz, deepak1556
file: frame_host_manager.patch
description: null
-
owners: null
file: guest_view.patch
description: null
-
owners: tonyganch
file: latency_info.patch

Просмотреть файл

@ -1,84 +0,0 @@
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index 47f0f1a361ce..ca5c3a9285f9 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -32,12 +32,14 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
+#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h"
#include "content/browser/renderer_host/text_input_manager.h"
#include "content/common/text_input_state.h"
#include "content/common/view_messages.h"
#include "content/public/browser/guest_mode.h"
#include "content/public/browser/render_process_host.h"
#include "gpu/ipc/common/gpu_messages.h"
+#include "media/base/video_frame.h"
#include "services/service_manager/runner/common/client_util.h"
#include "third_party/WebKit/public/platform/WebTouchEvent.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -857,6 +859,30 @@ void RenderWidgetHostViewChildFrame::OnBeginFramePausedChanged(bool paused) {
renderer_compositor_frame_sink_->OnBeginFramePausedChanged(paused);
}
+void RenderWidgetHostViewChildFrame::WillDrawSurface(
+ const viz::LocalSurfaceId& local_surface_id,
+ const gfx::Rect& damage_rect) {
+ if (local_surface_id != last_received_local_surface_id_ ||
+ damage_rect.IsEmpty() ||
+ !frame_subscriber_.get())
+ return;
+
+ base::TimeTicks present_time;
+ scoped_refptr<media::VideoFrame> frame;
+ RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback;
+ frame_subscriber_->ShouldCaptureFrame(damage_rect, present_time, &frame,
+ &callback);
+}
+
+void RenderWidgetHostViewChildFrame::BeginFrameSubscription(
+ std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) {
+ frame_subscriber_ = std::move(subscriber);
+}
+
+void RenderWidgetHostViewChildFrame::EndFrameSubscription() {
+ frame_subscriber_.reset();
+}
+
void RenderWidgetHostViewChildFrame::OnFirstSurfaceActivation(
const viz::SurfaceInfo& surface_info) {
viz::SurfaceSequence sequence(frame_sink_id_, next_surface_sequence_++);
@@ -952,6 +978,8 @@ void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() {
constexpr bool needs_sync_points = true;
support_ = GetHostFrameSinkManager()->CreateCompositorFrameSinkSupport(
this, frame_sink_id_, is_root, needs_sync_points);
+ support_->SetWillDrawSurfaceCallback(base::BindRepeating(
+ &RenderWidgetHostViewChildFrame::WillDrawSurface, AsWeakPtr()));
if (parent_frame_sink_id_.is_valid()) {
GetHostFrameSinkManager()->RegisterFrameSinkHierarchy(parent_frame_sink_id_,
frame_sink_id_);
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h
index b0617bb1fdb1..9774b4cd4291 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.h
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -181,6 +181,11 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
void ReclaimResources(
const std::vector<viz::ReturnedResource>& resources) override;
void OnBeginFramePausedChanged(bool paused) override;
+ void WillDrawSurface(const viz::LocalSurfaceId& local_surface_id,
+ const gfx::Rect& damage_rect);
+ void BeginFrameSubscription(
+ std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
+ void EndFrameSubscription() override;
// viz::HostFrameSinkClient implementation.
void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override;
@@ -301,6 +306,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
// The surface client ID of the parent RenderWidgetHostView. 0 if none.
viz::FrameSinkId parent_frame_sink_id_;
+ std::unique_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
+
bool has_frame_ = false;
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ =
nullptr;