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

Unified Diff: ppapi/tests/test_media_stream_video_track.cc

Issue 222563002: Remove redundant I420-to-YV12 conversion in MediaStreamVideoTrack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow I420 as acceptable default YUV format in ppapi tests. Created 6 years, 9 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/tools/player_x11/x11_video_renderer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_media_stream_video_track.cc
diff --git a/ppapi/tests/test_media_stream_video_track.cc b/ppapi/tests/test_media_stream_video_track.cc
index 10f7f9793b8edb1729aca9cb71175cdc1c255bc3..b4f01863ce69b4b298f01935bced81084432fc4a 100644
--- a/ppapi/tests/test_media_stream_video_track.cc
+++ b/ppapi/tests/test_media_stream_video_track.cc
@@ -98,7 +98,8 @@ std::string TestMediaStreamVideoTrack::TestGetFrame() {
ASSERT_EQ(PP_OK, cc.result());
pp::VideoFrame frame = cc.output();
ASSERT_FALSE(frame.is_null());
- ASSERT_EQ(frame.GetFormat(), PP_VIDEOFRAME_FORMAT_YV12);
+ ASSERT_TRUE(frame.GetFormat() == PP_VIDEOFRAME_FORMAT_YV12 ||
+ frame.GetFormat() == PP_VIDEOFRAME_FORMAT_I420);
pp::Size size;
ASSERT_TRUE(frame.GetSize(&size));
@@ -164,7 +165,13 @@ std::string TestMediaStreamVideoTrack::TestConfigure() {
ASSERT_EQ(PP_OK, cc2.result());
pp::VideoFrame frame = cc2.output();
ASSERT_FALSE(frame.is_null());
- ASSERT_EQ(frame.GetFormat(), formats[i].expected_format);
+ if (formats[i].format != PP_VIDEOFRAME_FORMAT_UNKNOWN) {
+ ASSERT_EQ(frame.GetFormat(), formats[i].expected_format);
+ } else {
+ // Both YV12 and I420 are acceptable as default YUV formats.
+ ASSERT_TRUE(frame.GetFormat() == PP_VIDEOFRAME_FORMAT_YV12 ||
+ frame.GetFormat() == PP_VIDEOFRAME_FORMAT_I420);
+ }
pp::Size size;
ASSERT_TRUE(frame.GetSize(&size));
@@ -206,7 +213,8 @@ std::string TestMediaStreamVideoTrack::TestConfigure() {
ASSERT_EQ(PP_OK, cc2.result());
pp::VideoFrame frame = cc2.output();
ASSERT_FALSE(frame.is_null());
- ASSERT_EQ(frame.GetFormat(), PP_VIDEOFRAME_FORMAT_YV12);
+ ASSERT_TRUE(frame.GetFormat() == PP_VIDEOFRAME_FORMAT_YV12 ||
+ frame.GetFormat() == PP_VIDEOFRAME_FORMAT_I420);
pp::Size size;
ASSERT_TRUE(frame.GetSize(&size));
« no previous file with comments | « media/tools/player_x11/x11_video_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698