Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 05d2e2c1d5404a545b04cc31198a333f7d8694f2
      
https://github.com/WebKit/WebKit/commit/05d2e2c1d5404a545b04cc31198a333f7d8694f2
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2025-11-17 (Mon, 17 Nov 2025)

  Changed paths:
    M Source/WebCore/platform/TrackInfo.cpp
    M Source/WebCore/platform/TrackInfo.h
    M Source/WebCore/platform/graphics/cocoa/CMUtilities.h
    M Source/WebCore/platform/graphics/cocoa/CMUtilities.mm
    M Source/WebCore/platform/graphics/cocoa/H264UtilitiesCocoa.mm
    M Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm
    M Source/WebCore/platform/mediarecorder/MediaRecorderPrivateEncoder.cpp
    M 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.cpp
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  CMSampleBuffer serialiser doesn't handle when 
kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms contains more 
than one key
https://bugs.webkit.org/show_bug.cgi?id=302585
rdar://164817308

Reviewed by Youenn Fablet.

When serialising a CMSampleBuffer to be transferred over IPC we first convert
it to a MediaSampleBlock and its TrackInfo.
The file loaded by the test 
`LayoutTests/media/media-source/media-managedmse-webvtt-track.html `
causes a decoding error when MediaSourceUseRemoteAudioVideoRenderer is enabled.

The reason is that the file content/bip-bop-webvtt-frag.mp4's `avc1` box
contains two keys: that standard `avcC` and a `btrt` one.

The code to convert the CMFormatDescriptionRef to a VideoInfo 
createVideoInfoFromFormatDescription
assumed that the required data to decode the video when two keys were present
was the first one. But that's not always the case.
For future-proofing we now use the entire content of the CMFormatDescription's
kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms and store it
in VideoInfo structure. This removes most potential conversion error for
unexpected values.

Covered by existing tests.
* Source/WebCore/platform/TrackInfo.cpp:
(WebCore::VideoInfo::computeBoxType const): Deleted.
* Source/WebCore/platform/TrackInfo.h:
(WebCore::VideoInfo::create):
(WebCore::VideoInfo::VideoInfo):
* Source/WebCore/platform/graphics/cocoa/CMUtilities.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.mm:
(WebCore::createFormatDescriptionFromTrackInfo):
(WebCore::createVideoInfoFromFormatDescription):
(WebCore::computeBoxType):
* Source/WebCore/platform/graphics/cocoa/H264UtilitiesCocoa.mm:
(WebCore::createVideoInfoFromAVCC):
* Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::createVideoInfoFromVPCodecConfigurationRecord):
* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateEncoder.cpp:
(WebCore::MediaRecorderPrivateEncoder::processVideoEncoderActiveConfiguration):
* 
Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterWebM.cpp:
(WebCore::MediaRecorderPrivateWriterWebMDelegate::addVideoTrack):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/303154@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to