commit c2795cd0a2d182ce61c87a2673651cd714e050c9 parent 5d5756ca75f09df9a2470e5e617cfbc7952bc97a Author: Michael Froman <mfroman@mozilla.com> Date: Wed, 8 Oct 2025 22:07:10 -0500 Bug 1993083 - Vendor libwebrtc from 6d7602d212 Upstream commit: https://webrtc.googlesource.com/src/+/6d7602d212d113149dac55c050647d4e9f114b4f Always copy color space on decoder output Some external decoders might not populate the color space information on the output. Bug: chromium:40269844 Change-Id: I124fe30bf46ce84a988ec1cd5d73e7ae1ae480f3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399220 Reviewed-by: Palak Agarwal <agpalak@google.com> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45097} Diffstat:
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T03:05:42.576299+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T03:07:00.829353+00:00. # base of lastest vendoring -10fab302f2 +6d7602d212 diff --git a/third_party/libwebrtc/modules/video_coding/generic_decoder.cc b/third_party/libwebrtc/modules/video_coding/generic_decoder.cc @@ -24,6 +24,7 @@ #include "api/field_trials_view.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" +#include "api/video/color_space.h" #include "api/video/encoded_frame.h" #include "api/video/encoded_image.h" #include "api/video/video_content_type.h" @@ -160,6 +161,7 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, decodedImage.set_ntp_time_ms(frame_info->ntp_time_ms); decodedImage.set_packet_infos(frame_info->packet_infos); decodedImage.set_rotation(frame_info->rotation); + decodedImage.set_color_space(frame_info->color_space); VideoFrame::RenderParameters render_parameters = _timing->RenderParameters(); if (render_parameters.max_composition_delay_in_frames) { // Subtract frames that are in flight. @@ -345,6 +347,9 @@ int32_t VCMGenericDecoder::Decode( frame_info.ntp_time_ms = frame.ntp_time_ms_; frame_info.packet_infos = frame.PacketInfos(); frame_info.frame_instrumentation_data = frame_instrumentation_data; + const webrtc::ColorSpace* color_space = frame.ColorSpace(); + if (color_space) + frame_info.color_space = *color_space; // Set correctly only for key frames. Thus, use latest key frame // content type. If the corresponding key frame was lost, decode will fail diff --git a/third_party/libwebrtc/modules/video_coding/generic_decoder.h b/third_party/libwebrtc/modules/video_coding/generic_decoder.h @@ -22,6 +22,7 @@ #include "api/rtp_packet_infos.h" #include "api/sequence_checker.h" #include "api/units/timestamp.h" +#include "api/video/color_space.h" #include "api/video/encoded_frame.h" #include "api/video/encoded_image.h" #include "api/video/video_content_type.h" @@ -64,6 +65,7 @@ struct FrameInfo { std::optional< std::variant<FrameInstrumentationSyncData, FrameInstrumentationData>> frame_instrumentation_data; + std::optional<ColorSpace> color_space; }; class VCMDecodedFrameCallback : public DecodedImageCallback { diff --git a/third_party/libwebrtc/moz-patch-stack/s0093.patch b/third_party/libwebrtc/moz-patch-stack/s0093.patch @@ -30,10 +30,10 @@ index 9a4f0f1b97..74f7c78e12 100644 if (rtc_use_perfetto) { rtc_library("webrtc_libperfetto") { diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc -index ab23106f94..dd4a5611b4 100644 +index c605cf74e3..085e739ffc 100644 --- a/modules/video_coding/generic_decoder.cc +++ b/modules/video_coding/generic_decoder.cc -@@ -121,9 +121,9 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, +@@ -122,9 +122,9 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, std::optional<int32_t> decode_time_ms, std::optional<uint8_t> qp) { RTC_DCHECK(_receiveCallback) << "Callback must not be null at this point"; @@ -46,7 +46,7 @@ index ab23106f94..dd4a5611b4 100644 // TODO(holmer): We should improve this so that we can handle multiple // callbacks from one call to Decode(). std::optional<FrameInfo> frame_info; -@@ -331,8 +331,8 @@ int32_t VCMGenericDecoder::Decode( +@@ -333,8 +333,8 @@ int32_t VCMGenericDecoder::Decode( const std::optional< std::variant<FrameInstrumentationSyncData, FrameInstrumentationData>>& frame_instrumentation_data) {