diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 75ee497cff..aded52965e 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -760,6 +760,10 @@ if (rtc_include_tests) { rtc_source_set("video_coding_modules_tests") { testonly = true + defines = [] + if (rtc_use_h264) { + defines += [ "WEBRTC_USE_H264" ] + } sources = [ "codecs/h264/test/h264_impl_unittest.cc", diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc index 73190d1a65..e5d31ed34d 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -304,8 +304,8 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, // Pass on color space from input frame if explicitly specified. const ColorSpace& color_space = - input_frame->color_space() ? *input_frame->color_space() - : ExtractH264ColorSpace(av_context_.get()); + input_image.ColorSpace() ? *input_image.ColorSpace() + : ExtractH264ColorSpace(av_context_.get()); VideoFrame decoded_frame = VideoFrame::Builder() .set_video_frame_buffer(input_frame->video_frame_buffer()) diff --git a/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc b/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc index f93c463033..e1788644bb 100644 --- a/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc +++ b/modules/video_coding/codecs/h264/test/h264_impl_unittest.cc @@ -84,7 +84,7 @@ TEST_F(TestH264Impl, MAYBE_EncodeDecode) { EXPECT_EQ(ColorSpace::PrimaryID::kUnspecified, color_space.primaries()); EXPECT_EQ(ColorSpace::TransferID::kUnspecified, color_space.transfer()); EXPECT_EQ(ColorSpace::MatrixID::kUnspecified, color_space.matrix()); - EXPECT_EQ(ColorSpace::RangeID::kLimited, color_space.range()); + EXPECT_EQ(ColorSpace::RangeID::kInvalid, color_space.range()); EXPECT_EQ(ColorSpace::ChromaSiting::kUnspecified, color_space.chroma_siting_horizontal()); EXPECT_EQ(ColorSpace::ChromaSiting::kUnspecified,