Changeset 284433 in webkit


Ignore:
Timestamp:
Oct 18, 2021 8:43:17 PM (9 months ago)
Author:
Cameron McCormack
Message:

Always set color space for incoming H.264/265 streams
https://bugs.webkit.org/show_bug.cgi?id=231881
<rdar://problem/84350707>

Reviewed by Youenn Fablet.

Followup from https://bugs.webkit.org/show_bug.cgi?id=231353. In some
configurations, the "ColorInfoGuessedBy" attachment is not set on the
CVPixelBuffers coming out of the VTDecompressionSession, but the
guessed, incorrect color space attachments are still there. Since we
currently always have an sRGB stream, don't bother looking for
"ColorInfoGuessedBy".

  • Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm:

(overrideColorSpaceAttachments):
(decompressionOutputCallback):
(overrideColorSpaceAttachmentsIfNeeded): Deleted.

  • Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm:

(overrideColorSpaceAttachments):
(h265DecompressionOutputCallback):
(overrideColorSpaceAttachmentsIfNeeded): Deleted.

Location:
trunk/Source/ThirdParty/libwebrtc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r284192 r284433  
     12021-10-18  Cameron McCormack  <heycam@apple.com>
     2
     3        Always set color space for incoming H.264/265 streams
     4        https://bugs.webkit.org/show_bug.cgi?id=231881
     5        <rdar://problem/84350707>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Followup from https://bugs.webkit.org/show_bug.cgi?id=231353. In some
     10        configurations, the "ColorInfoGuessedBy" attachment is not set on the
     11        CVPixelBuffers coming out of the VTDecompressionSession, but the
     12        guessed, incorrect color space attachments are still there. Since we
     13        currently always have an sRGB stream, don't bother looking for
     14        "ColorInfoGuessedBy".
     15
     16        * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm:
     17        (overrideColorSpaceAttachments):
     18        (decompressionOutputCallback):
     19        (overrideColorSpaceAttachmentsIfNeeded): Deleted.
     20        * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm:
     21        (overrideColorSpaceAttachments):
     22        (h265DecompressionOutputCallback):
     23        (overrideColorSpaceAttachmentsIfNeeded): Deleted.
     24
    1252021-10-14  Chris Dumez  <cdumez@apple.com>
    226
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm

    r284082 r284433  
    4242@end
    4343
    44 static void overrideColorSpaceAttachmentsIfNeeded(CVImageBufferRef imageBuffer) {
    45   auto guess = CVBufferGetAttachment(imageBuffer, (CFStringRef)@"ColorInfoGuessedBy", nullptr);
    46   if (!guess || !CFEqual(guess, (CFStringRef)@"VideoToolbox"))
    47     return;
    48 
     44static void overrideColorSpaceAttachments(CVImageBufferRef imageBuffer) {
    4945  CVBufferRemoveAttachment(imageBuffer, kCVImageBufferCGColorSpaceKey);
    5046  CVBufferSetAttachment(imageBuffer, kCVImageBufferColorPrimariesKey, kCVImageBufferColorPrimaries_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate);
     
    7066  }
    7167
    72   overrideColorSpaceAttachmentsIfNeeded(imageBuffer);
     68  overrideColorSpaceAttachments(imageBuffer);
    7369
    7470  std::unique_ptr<RTCFrameDecodeParams> decodeParams(reinterpret_cast<RTCFrameDecodeParams *>(params));
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm

    r284082 r284433  
    3939@end
    4040
    41 static void overrideColorSpaceAttachmentsIfNeeded(CVImageBufferRef imageBuffer) {
    42   auto guess = CVBufferGetAttachment(imageBuffer, (CFStringRef)@"ColorInfoGuessedBy", nullptr);
    43   if (!guess || !CFEqual(guess, (CFStringRef)@"VideoToolbox"))
    44     return;
    45 
     41static void overrideColorSpaceAttachments(CVImageBufferRef imageBuffer) {
    4642  CVBufferRemoveAttachment(imageBuffer, kCVImageBufferCGColorSpaceKey);
    4743  CVBufferSetAttachment(imageBuffer, kCVImageBufferColorPrimariesKey, kCVImageBufferColorPrimaries_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate);
     
    6763  }
    6864
    69   overrideColorSpaceAttachmentsIfNeeded(imageBuffer);
     65  overrideColorSpaceAttachments(imageBuffer);
    7066
    7167  std::unique_ptr<RTCH265FrameDecodeParams> decodeParams(reinterpret_cast<RTCH265FrameDecodeParams*>(params));
Note: See TracChangeset for help on using the changeset viewer.