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

Unified Diff: media/base/video_frame.cc

Issue 1942123002: Plumb decoded video pixel format from GPU process to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: media/base/video_frame.cc
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index 578f2e1a80ee3200d2bab57a9f202adc565055c7..b611dba799253370ba5be4669f158407e33e3df9 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -185,6 +185,33 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
}
// static
+scoped_refptr<VideoFrame> VideoFrame::WrapNativeTextures(
+ VideoPixelFormat format,
+ const gpu::MailboxHolder (&mailbox_holders)[kMaxPlanes],
+ const ReleaseMailboxCB& mailbox_holder_release_cb,
+ const gfx::Size& coded_size,
+ const gfx::Rect& visible_rect,
+ const gfx::Size& natural_size,
+ base::TimeDelta timestamp) {
+ if (format != PIXEL_FORMAT_ARGB && format != PIXEL_FORMAT_XRGB &&
+ format != PIXEL_FORMAT_UYVY && format != PIXEL_FORMAT_NV12) {
+ LOG(DFATAL) << "Unsupported pixel format supported, got "
+ << VideoPixelFormatToString(format);
+ return nullptr;
+ }
+ const StorageType storage = STORAGE_OPAQUE;
+ 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;
+ }
+
+ return new VideoFrame(format, storage, coded_size, visible_rect, natural_size,
+ mailbox_holders, mailbox_holder_release_cb, timestamp);
+}
+
+// static
scoped_refptr<VideoFrame> VideoFrame::WrapYUV420NativeTextures(
const gpu::MailboxHolder& y_mailbox_holder,
const gpu::MailboxHolder& u_mailbox_holder,

Powered by Google App Engine
This is Rietveld 408576698