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

Unified Diff: media/base/video_frame.cc

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test breakage from bad merge Created 5 years, 7 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/base/video_frame_unittest.cc » ('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 b2433f142bd34c924c30d6a02a4fb28e38831939..848ebeba9fcb10188d1364f3ba11bda57b5ad37b 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -245,12 +245,14 @@ scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
base::TimeDelta timestamp,
- bool allow_overlay) {
+ bool allow_overlay,
+ bool has_alpha) {
gpu::MailboxHolder mailbox_holders[kMaxPlanes];
mailbox_holders[kARGBPlane] = mailbox_holder;
+ TextureFormat texture_format = has_alpha ? TEXTURE_RGBA : TEXTURE_RGB;
scoped_refptr<VideoFrame> frame(
new VideoFrame(NATIVE_TEXTURE, coded_size, visible_rect, natural_size,
- mailbox_holders, TEXTURE_RGBA, timestamp, false));
+ mailbox_holders, texture_format, timestamp, false));
frame->mailbox_holders_release_cb_ = mailbox_holder_release_cb;
frame->allow_overlay_ = allow_overlay;
return frame;
@@ -556,6 +558,7 @@ size_t VideoFrame::NumPlanes(Format format) {
size_t VideoFrame::NumTextures(TextureFormat texture_format) {
switch (texture_format) {
case TEXTURE_RGBA:
+ case TEXTURE_RGB:
return 1;
case TEXTURE_YUV_420:
return 3;
« no previous file with comments | « media/base/video_frame.h ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698