diff options
author | emircan <emircan@chromium.org> | 2016-01-15 00:59:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-15 09:00:38 +0000 |
commit | 8428d41278c107c107736454dc4fdddbd14969bd (patch) | |
tree | ed8c911e772aecc90b7f610f65abf8f33e357d12 /cc/resources | |
parent | 4977dd61169929d41ac1ff5d50c3b194bce71e60 (diff) | |
download | chromium_src-8428d41278c107c107736454dc4fdddbd14969bd.zip chromium_src-8428d41278c107c107736454dc4fdddbd14969bd.tar.gz chromium_src-8428d41278c107c107736454dc4fdddbd14969bd.tar.bz2 |
Verify returned frames from media::VideoFrame::Wrap*() methods
BUG=552112
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1476523005
Cr-Commit-Position: refs/heads/master@{#369705}
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/video_resource_updater_unittest.cc | 73 |
1 files changed, 41 insertions, 32 deletions
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc index 064829e..5186aab 100644 --- a/cc/resources/video_resource_updater_unittest.cc +++ b/cc/resources/video_resource_updater_unittest.cc @@ -87,18 +87,21 @@ class VideoResourceUpdaterTest : public testing::Test { static uint8_t u_data[kDimension * kDimension / 2] = {0}; static uint8_t v_data[kDimension * kDimension / 2] = {0}; - return media::VideoFrame::WrapExternalYuvData( - media::PIXEL_FORMAT_YV16, // format - size, // coded_size - gfx::Rect(size), // visible_rect - size, // natural_size - size.width(), // y_stride - size.width() / 2, // u_stride - size.width() / 2, // v_stride - y_data, // y_data - u_data, // u_data - v_data, // v_data - base::TimeDelta()); // timestamp + scoped_refptr<media::VideoFrame> video_frame = + media::VideoFrame::WrapExternalYuvData( + media::PIXEL_FORMAT_YV16, // format + size, // coded_size + gfx::Rect(size), // visible_rect + size, // natural_size + size.width(), // y_stride + size.width() / 2, // u_stride + size.width() / 2, // v_stride + y_data, // y_data + u_data, // u_data + v_data, // v_data + base::TimeDelta()); // timestamp + EXPECT_TRUE(video_frame); + return video_frame; } static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {} @@ -112,14 +115,17 @@ class VideoResourceUpdaterTest : public testing::Test { const gpu::SyncToken sync_token(7); const unsigned target = GL_TEXTURE_2D; - return 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 + 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 + EXPECT_TRUE(video_frame); + return video_frame; } scoped_refptr<media::VideoFrame> CreateTestYUVHardareVideoFrame() { @@ -133,18 +139,21 @@ class VideoResourceUpdaterTest : public testing::Test { } const gpu::SyncToken sync_token(7); const unsigned target = GL_TEXTURE_RECTANGLE_ARB; - return 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 + 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 + EXPECT_TRUE(video_frame); + return video_frame; } WebGraphicsContext3DUploadCounter* context3d_; |