Partially revert of ColorSpace information copying around decoders
This partially reverts these 2 CLs: 1) Reland "Copy video frames metadata between encoded and plain frames in one place" https://webrtc.googlesource.com/src/+/2ebf5239782bf6b46d4aa812f34fa9f9e5a02be9 2) Don't copy video frame metadata in each encoder/decoder https://webrtc.googlesource.com/src/+/ab62b2ee51e622be6d0aade15e87e927fa60e6f2 The problem with them were that ColorSpace was made to always be copied from the EncodedImage in the GenericDecoder, which overwrote ColorSpace information from the decoder. If decoder applied color space transition or bitstream color space information was different from the WebRTC signaled one, the incorrect color space data were passed to the renderer. This CL removes introduced change regarding color space data: GenericDecoder doesn't copy or store it and software decoders are restored to copy it. Relevant tests are also removed. Bug: chromium:982486 Change-Id: I989e01476ff7f7df376c05578ab8f540b95a1dd2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145323 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28556}
This commit is contained in:

committed by
Commit Bot

parent
8b3e4e2d11
commit
a0e2609a08
@ -89,40 +89,6 @@ class GenericDecoderTest : public ::testing::Test {
|
||||
ReceiveCallback user_callback_;
|
||||
};
|
||||
|
||||
TEST_F(GenericDecoderTest, PassesColorSpace) {
|
||||
webrtc::ColorSpace color_space =
|
||||
CreateTestColorSpace(/*with_hdr_metadata=*/true);
|
||||
VCMEncodedFrame encoded_frame;
|
||||
encoded_frame.SetColorSpace(color_space);
|
||||
generic_decoder_.Decode(encoded_frame, clock_.TimeInMilliseconds());
|
||||
absl::optional<VideoFrame> decoded_frame = user_callback_.WaitForFrame(10);
|
||||
ASSERT_TRUE(decoded_frame.has_value());
|
||||
absl::optional<webrtc::ColorSpace> decoded_color_space =
|
||||
decoded_frame->color_space();
|
||||
ASSERT_TRUE(decoded_color_space.has_value());
|
||||
EXPECT_EQ(*decoded_color_space, color_space);
|
||||
}
|
||||
|
||||
TEST_F(GenericDecoderTest, PassesColorSpaceForDelayedDecoders) {
|
||||
webrtc::ColorSpace color_space =
|
||||
CreateTestColorSpace(/*with_hdr_metadata=*/true);
|
||||
decoder_.SetDelayedDecoding(100);
|
||||
|
||||
{
|
||||
// Ensure the original frame is destroyed before the decoding is completed.
|
||||
VCMEncodedFrame encoded_frame;
|
||||
encoded_frame.SetColorSpace(color_space);
|
||||
generic_decoder_.Decode(encoded_frame, clock_.TimeInMilliseconds());
|
||||
}
|
||||
|
||||
absl::optional<VideoFrame> decoded_frame = user_callback_.WaitForFrame(200);
|
||||
ASSERT_TRUE(decoded_frame.has_value());
|
||||
absl::optional<webrtc::ColorSpace> decoded_color_space =
|
||||
decoded_frame->color_space();
|
||||
ASSERT_TRUE(decoded_color_space.has_value());
|
||||
EXPECT_EQ(*decoded_color_space, color_space);
|
||||
}
|
||||
|
||||
TEST_F(GenericDecoderTest, PassesPacketInfos) {
|
||||
RtpPacketInfos packet_infos = CreatePacketInfos(3);
|
||||
VCMEncodedFrame encoded_frame;
|
||||
|
Reference in New Issue
Block a user