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

Unified Diff: media/base/video_frame_impl_unittest.cc

Issue 165472: Merge 23255 - Implemented endofstream callback for media::PipelineImpl.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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_impl.cc ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame_impl_unittest.cc
===================================================================
--- media/base/video_frame_impl_unittest.cc (revision 23335)
+++ media/base/video_frame_impl_unittest.cc (working copy)
@@ -130,4 +130,46 @@
EXPECT_TRUE(frame->IsEndOfStream());
}
+TEST(VideoFrameImpl, CreateBlackFrame) {
+ const size_t kWidth = 2;
+ const size_t kHeight = 2;
+ const uint8 kExpectedYRow[] = { 0, 0 };
+ const uint8 kExpectedUVRow[] = { 128 };
+
+ scoped_refptr<media::VideoFrame> frame;
+ VideoFrameImpl::CreateBlackFrame(kWidth, kHeight, &frame);
+ ASSERT_TRUE(frame);
+
+ // Test basic properties.
+ EXPECT_EQ(0, frame->GetTimestamp().InMicroseconds());
+ EXPECT_EQ(0, frame->GetDuration().InMicroseconds());
+ EXPECT_FALSE(frame->IsEndOfStream());
+
+ // Test surface properties.
+ VideoSurface surface;
+ EXPECT_TRUE(frame->Lock(&surface));
+ EXPECT_EQ(VideoSurface::YV12, surface.format);
+ EXPECT_EQ(kWidth, surface.width);
+ EXPECT_EQ(kHeight, surface.height);
+ EXPECT_EQ(3u, surface.planes);
+
+ // Test surfaces themselves.
+ for (size_t y = 0; y < surface.height; ++y) {
+ EXPECT_EQ(0, memcmp(kExpectedYRow, surface.data[VideoSurface::kYPlane],
+ arraysize(kExpectedYRow)));
+ surface.data[VideoSurface::kYPlane] +=
+ surface.strides[VideoSurface::kYPlane];
+ }
+ for (size_t y = 0; y < surface.height / 2; ++y) {
+ EXPECT_EQ(0, memcmp(kExpectedUVRow, surface.data[VideoSurface::kUPlane],
+ arraysize(kExpectedUVRow)));
+ EXPECT_EQ(0, memcmp(kExpectedUVRow, surface.data[VideoSurface::kVPlane],
+ arraysize(kExpectedUVRow)));
+ surface.data[VideoSurface::kUPlane] +=
+ surface.strides[VideoSurface::kUPlane];
+ surface.data[VideoSurface::kVPlane] +=
+ surface.strides[VideoSurface::kVPlane];
+ }
+}
+
} // namespace media
Property changes on: media\base\video_frame_impl_unittest.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/media/base/video_frame_impl_unittest.cc:r69-2775
Merged /trunk/src/media/base/video_frame_impl_unittest.cc:r23255
« no previous file with comments | « media/base/video_frame_impl.cc ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698