Fix color space bug in wrapper of H264 decoder

Bug: none
Change-Id: I8309e5e3c177ae75712fa257e083ea2018a1f8e2
Reviewed-on: https://webrtc-review.googlesource.com/c/121760
Commit-Queue: Johannes Kron <kron@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26597}
This commit is contained in:
Johannes Kron
2019-02-07 16:42:45 +01:00
committed by Commit Bot
parent a8cb366f98
commit 108f20fd45
3 changed files with 7 additions and 3 deletions

View File

@ -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())

View File

@ -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,