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

Unified Diff: media/base/video_frame.cc

Issue 1869303004: media: Implement zero-copy video playback for VP8. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: optimize only VP8 Created 4 years, 8 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 | « media/base/video_frame.h ('k') | media/filters/vpx_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index b4a8392ff8c848dc9edf9ba0ddd7ce181ad0c7b5..cd05dc44cf5c6a62340c3a1c34979f214ddee04f 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -212,6 +212,35 @@ scoped_refptr<VideoFrame> VideoFrame::WrapYUV420NativeTextures(
}
// static
+scoped_refptr<VideoFrame> VideoFrame::WrapYV12ANativeTextures(
+ const gpu::MailboxHolder& y_mailbox_holder,
+ const gpu::MailboxHolder& u_mailbox_holder,
+ const gpu::MailboxHolder& v_mailbox_holder,
+ const gpu::MailboxHolder& a_mailbox_holder,
+ const ReleaseMailboxCB& mailbox_holder_release_cb,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ base::TimeDelta timestamp) {
+ const StorageType storage = STORAGE_OPAQUE;
+ VideoPixelFormat format = PIXEL_FORMAT_YV12A;
+ if (!IsValidConfig(format, storage, coded_size, visible_rect, natural_size)) {
+ LOG(DFATAL) << __FUNCTION__ << " Invalid config."
+ << ConfigToString(format, storage, coded_size, visible_rect,
+ natural_size);
+ return nullptr;
+ }
+
+ gpu::MailboxHolder mailbox_holders[kMaxPlanes];
+ mailbox_holders[kYPlane] = y_mailbox_holder;
+ mailbox_holders[kUPlane] = u_mailbox_holder;
+ mailbox_holders[kVPlane] = v_mailbox_holder;
+ mailbox_holders[kAPlane] = a_mailbox_holder;
+ return new VideoFrame(format, storage, coded_size, visible_rect, natural_size,
+ mailbox_holders, mailbox_holder_release_cb, timestamp);
+}
+
+// static
scoped_refptr<VideoFrame> VideoFrame::WrapExternalData(
VideoPixelFormat format,
const gfx::Size& coded_size,
« no previous file with comments | « media/base/video_frame.h ('k') | media/filters/vpx_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698