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

Unified Diff: cc/resources/video_resource_updater_unittest.cc

Issue 1960563002: Add media::VideoFrame::WrapNativeTextures() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « cc/layers/video_layer_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater_unittest.cc
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index db1c4de57e52e00d828bbf6ef9fff9bb5e142b4a..bf8302af0cba32f24aa33f76255195468d0fb0fc 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -186,15 +186,16 @@ class VideoResourceUpdaterTest : public testing::Test {
const gpu::SyncToken sync_token(
gpu::CommandBufferNamespace::GPU_IO, 0,
gpu::CommandBufferId::FromUnsafeValue(0x123), 7);
+ gpu::MailboxHolder mailbox_holders[media::VideoFrame::kMaxPlanes] = {
+ gpu::MailboxHolder(mailbox, sync_token, target)};
scoped_refptr<media::VideoFrame> video_frame =
- media::VideoFrame::WrapNativeTexture(
- media::PIXEL_FORMAT_ARGB,
- gpu::MailboxHolder(mailbox, sync_token, target),
- base::Bind(&ReleaseMailboxCB),
- size, // coded_size
- gfx::Rect(size), // visible_rect
- size, // natural_size
- base::TimeDelta()); // timestamp
+ media::VideoFrame::WrapNativeTextures(media::PIXEL_FORMAT_ARGB,
+ mailbox_holders,
+ base::Bind(&ReleaseMailboxCB),
+ size, // coded_size
+ gfx::Rect(size), // visible_rect
+ size, // natural_size
+ base::TimeDelta()); // timestamp
EXPECT_TRUE(video_frame);
return video_frame;
}
@@ -216,28 +217,25 @@ class VideoResourceUpdaterTest : public testing::Test {
const int kDimension = 10;
gfx::Size size(kDimension, kDimension);
- const int kPlanesNum = 3;
- gpu::Mailbox mailbox[kPlanesNum];
- for (int i = 0; i < kPlanesNum; ++i) {
- mailbox[i].name[0] = 50 + 1;
- }
const gpu::SyncToken sync_token(
gpu::CommandBufferNamespace::GPU_IO, 0,
gpu::CommandBufferId::FromUnsafeValue(0x123), 7);
const unsigned target = GL_TEXTURE_RECTANGLE_ARB;
+ const int kPlanesNum = 3;
+ gpu::MailboxHolder mailbox_holders[media::VideoFrame::kMaxPlanes];
+ for (int i = 0; i < kPlanesNum; ++i) {
+ gpu::Mailbox mailbox;
+ mailbox.name[0] = 50 + 1;
+ mailbox_holders[i] = gpu::MailboxHolder(mailbox, sync_token, target);
+ }
scoped_refptr<media::VideoFrame> video_frame =
- media::VideoFrame::WrapYUV420NativeTextures(
- gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token,
- target),
- gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token,
- target),
- gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token,
- target),
- base::Bind(&ReleaseMailboxCB),
- size, // coded_size
- gfx::Rect(size), // visible_rect
- size, // natural_size
- base::TimeDelta()); // timestamp
+ media::VideoFrame::WrapNativeTextures(media::PIXEL_FORMAT_I420,
+ mailbox_holders,
+ base::Bind(&ReleaseMailboxCB),
+ size, // coded_size
+ gfx::Rect(size), // visible_rect
+ size, // natural_size
+ base::TimeDelta()); // timestamp
EXPECT_TRUE(video_frame);
return video_frame;
}
« no previous file with comments | « cc/layers/video_layer_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698