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

Unified Diff: content/port/browser/render_widget_host_view_port.h

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix per wjia Created 7 years, 10 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/test_render_view_host.cc ('k') | media/base/video_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/port/browser/render_widget_host_view_port.h
diff --git a/content/port/browser/render_widget_host_view_port.h b/content/port/browser/render_widget_host_view_port.h
index 9fbdeccdf86542cb7e8bca9520fa14774b8e0bde..f80ea2408fb818973ab2b97fe7ba93d554f18eb8 100644
--- a/content/port/browser/render_widget_host_view_port.h
+++ b/content/port/browser/render_widget_host_view_port.h
@@ -26,6 +26,10 @@ struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params;
struct ViewHostMsg_TextInputState_Params;
struct ViewHostMsg_SelectionBounds_Params;
+namespace media {
+class VideoFrame;
+}
+
namespace webkit {
namespace npapi {
struct WebPluginGeometry;
@@ -158,13 +162,32 @@ class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView {
// contents, scaled to |dst_size|, and written to |output|.
// |callback| is invoked with true on success, false otherwise. |output| can
// be initialized even on failure.
- // NOTE: |callback| is called asynchronously on Aura and synchronously on the
- // other platforms.
+ // NOTE: |callback| is called asynchronously.
virtual void CopyFromCompositingSurface(
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const base::Callback<void(bool, const SkBitmap&)>& callback) = 0;
+ // Copies a given subset of the compositing surface's content into a YV12
+ // VideoFrame, and invokes a callback with a success/fail parameter. |target|
+ // must contain an allocated, YV12 video frame of the intended size. If the
+ // copy rectangle does not match |target|'s size, the copied content will be
+ // scaled and letterboxed with black borders. The copy will happen
+ // asynchronously. This operation will fail if there is no available
+ // compositing surface.
+ virtual void CopyFromCompositingSurfaceToVideoFrame(
+ const gfx::Rect& src_subrect,
+ const scoped_refptr<media::VideoFrame>& target,
+ const base::Callback<void(bool)>& callback) = 0;
+
+ // Returns true if CopyFromCompositingSurfaceToVideoFrame() is likely to
+ // succeed.
+ //
+ // TODO(nick): When VideoFrame copies are broadly implemented, this method
+ // should be renamed to HasCompositingSurface(), or unified with
+ // IsSurfaceAvailableForCopy() and HasAcceleratedSurface().
+ virtual bool CanCopyToVideoFrame() const = 0;
+
// Called when accelerated compositing state changes.
virtual void OnAcceleratedCompositingStateChange() = 0;
// |params.window| and |params.surface_id| indicate which accelerated
« no previous file with comments | « content/browser/renderer_host/test_render_view_host.cc ('k') | media/base/video_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698