Commit 161ca16a authored by Fredrik Hubinette's avatar Fredrik Hubinette Committed by Commit Bot

add test for full-range video color space

Bug: 647725
Change-Id: I8c5ca15c75e2a0114a39f6eed64fec5fbd863b7c
Reviewed-on: https://chromium-review.googlesource.com/1161321Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Fredrik Hubinette <hubbe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580606}
parent b106fdfd
...@@ -2830,9 +2830,21 @@ TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) { ...@@ -2830,9 +2830,21 @@ TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) {
Play(); Play();
ASSERT_TRUE(WaitUntilOnEnded()); ASSERT_TRUE(WaitUntilOnEnded());
EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_I420); EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_I420);
EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_, COLOR_SPACE_HD_REC709); EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_,
gfx::ColorSpace::CreateREC709());
} }
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
// Verify that full-range H264 video has the right color space.
TEST_F(PipelineIntegrationTest, Fullrange_H264) {
ASSERT_EQ(PIPELINE_OK, Start("blackwhite_yuvj420p.mp4"));
Play();
ASSERT_TRUE(WaitUntilOnEnded());
EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_,
gfx::ColorSpace::CreateJpeg());
}
#endif
TEST_F(PipelineIntegrationTest, HD_VP9_WebM) { TEST_F(PipelineIntegrationTest, HD_VP9_WebM) {
ASSERT_EQ(PIPELINE_OK, Start("bear-1280x720.webm")); ASSERT_EQ(PIPELINE_OK, Start("bear-1280x720.webm"));
Play(); Play();
......
...@@ -131,7 +131,6 @@ PipelineIntegrationTestBase::PipelineIntegrationTestBase() ...@@ -131,7 +131,6 @@ PipelineIntegrationTestBase::PipelineIntegrationTestBase()
ended_(false), ended_(false),
pipeline_status_(PIPELINE_OK), pipeline_status_(PIPELINE_OK),
last_video_frame_format_(PIXEL_FORMAT_UNKNOWN), last_video_frame_format_(PIXEL_FORMAT_UNKNOWN),
last_video_frame_color_space_(COLOR_SPACE_UNSPECIFIED),
current_duration_(kInfiniteDuration), current_duration_(kInfiniteDuration),
renderer_factory_(new RendererFactoryImpl(this)) { renderer_factory_(new RendererFactoryImpl(this)) {
ResetVideoHash(); ResetVideoHash();
...@@ -525,9 +524,7 @@ std::unique_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer( ...@@ -525,9 +524,7 @@ std::unique_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer(
void PipelineIntegrationTestBase::OnVideoFramePaint( void PipelineIntegrationTestBase::OnVideoFramePaint(
const scoped_refptr<VideoFrame>& frame) { const scoped_refptr<VideoFrame>& frame) {
last_video_frame_format_ = frame->format(); last_video_frame_format_ = frame->format();
int result; last_video_frame_color_space_ = frame->ColorSpace();
if (frame->metadata()->GetInteger(VideoFrameMetadata::COLOR_SPACE, &result))
last_video_frame_color_space_ = static_cast<ColorSpace>(result);
if (!hashing_enabled_ || last_frame_ == frame) if (!hashing_enabled_ || last_frame_ == frame)
return; return;
last_frame_ = frame; last_frame_ = frame;
......
...@@ -178,7 +178,7 @@ class PipelineIntegrationTestBase : public Pipeline::Client { ...@@ -178,7 +178,7 @@ class PipelineIntegrationTestBase : public Pipeline::Client {
PipelineStatus pipeline_status_; PipelineStatus pipeline_status_;
Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_;
VideoPixelFormat last_video_frame_format_; VideoPixelFormat last_video_frame_format_;
ColorSpace last_video_frame_color_space_; gfx::ColorSpace last_video_frame_color_space_;
DummyTickClock dummy_clock_; DummyTickClock dummy_clock_;
PipelineMetadata metadata_; PipelineMetadata metadata_;
scoped_refptr<VideoFrame> last_frame_; scoped_refptr<VideoFrame> last_frame_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment