WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP patch
bug-231353-20211007180934.patch (text/plain), 3.27 KB, created by
Cameron McCormack (:heycam)
on 2021-10-07 00:09:35 PDT
(
hide
)
Description:
WIP patch
Filename:
MIME Type:
Creator:
Cameron McCormack (:heycam)
Created:
2021-10-07 00:09:35 PDT
Size:
3.27 KB
patch
obsolete
>Subversion Revision: 283540 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 6f4fd3867a003ad3053ca7e00e5fb42ce996983b..af766e9d18fd258dc8aad6696348a450796f123b 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,17 @@ >+2021-10-06 Cameron McCormack <heycam@apple.com> >+ >+ Incoming WebRTC H.264 video is not correctly color managed >+ Need the bug URL (OOPS!). >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Override inferred default Rec.601 color space with sRGB for incoming >+ WebRTC video. >+ >+ * Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm: >+ (overrideColorSpaceAttachmentsIfNeeded): >+ (decompressionOutputCallback): >+ > 2021-10-01 Chris Dumez <cdumez@apple.com> > > Drop support for macOS < 10.15 >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm >index c3f1b702f9d479d5acd894456512d836b2f6a48a..a4f8daef19b5d36cb98ec0d1b16de15a89a8299e 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm >@@ -41,6 +41,24 @@ @interface RTCVideoDecoderH264 () > - (void)setError:(OSStatus)error; > @end > >+// VideoToolbox will assume video data with no color space information is Rec.601 >+// and put the guessed color space attachments on the CVImageBuffer. To avoid >+// confusing users of the color space attachments, detect when that guess has been >+// made and override it to the WebRTC default, sRGB. >+static void overrideColorSpaceAttachmentsIfNeeded(CVImageBufferRef imageBuffer) { >+ if (!CFEqual(CVBufferGetAttachment(imageBuffer, (CFStringRef)@"ColorInfoGuessedBy", nullptr), (CFStringRef)@"VideoToolbox")) >+ return; >+ >+ if (!CFEqual(CVBufferGetAttachment(imageBuffer, kCVImageBufferColorPrimariesKey, nullptr), kCVImageBufferColorPrimaries_SMPTE_C)) >+ return; >+ >+ CVBufferRemoveAttachment(imageBuffer, kCVImageBufferCGColorSpaceKey); >+ CVBufferSetAttachment(imageBuffer, kCVImageBufferColorPrimariesKey, kCVImageBufferColorPrimaries_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate); >+ CVBufferSetAttachment(imageBuffer, kCVImageBufferTransferFunctionKey, kCVImageBufferTransferFunction_sRGB, kCVAttachmentMode_ShouldPropagate); >+ CVBufferSetAttachment(imageBuffer, kCVImageBufferYCbCrMatrixKey, kCVImageBufferYCbCrMatrix_ITU_R_709_2, kCVAttachmentMode_ShouldPropagate); >+ CVBufferSetAttachment(imageBuffer, (CFStringRef)@"ColorInfoGuessedBy", (CFStringRef)@"RTCVideoDecoderH264", kCVAttachmentMode_ShouldPropagate); >+} >+ > // This is the callback function that VideoToolbox calls when decode is > // complete. > void decompressionOutputCallback(void *decoderRef, >@@ -57,6 +75,8 @@ void decompressionOutputCallback(void *decoderRef, > return; > } > >+ overrideColorSpaceAttachmentsIfNeeded(imageBuffer); >+ > std::unique_ptr<RTCFrameDecodeParams> decodeParams(reinterpret_cast<RTCFrameDecodeParams *>(params)); > // TODO(tkchin): Handle CVO properly. > RTCCVPixelBuffer *frameBuffer = [[RTCCVPixelBuffer alloc] initWithPixelBuffer:imageBuffer];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 231353
:
440479
|
440480
|
440481
|
440483
|
440539
|
441028