Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6446fdc8e0be049f61e48d8beb8556ee8e2e1009
https://github.com/WebKit/WebKit/commit/6446fdc8e0be049f61e48d8beb8556ee8e2e1009
Author: Jer Noble <[email protected]>
Date: 2026-08-18 (Tue, 18 Aug 2026)
Changed paths:
M Source/JavaScriptCore/runtime/DataView.h
M Source/WebCore/Modules/encryptedmedia/InitDataRegistry.cpp
M Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
M
Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp
M
Source/WebCore/platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h
M
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
M Source/WebCore/platform/graphics/iso/ISOBox.cpp
M Source/WebCore/platform/graphics/iso/ISOBox.h
M Source/WebCore/platform/graphics/iso/ISOOriginalFormatBox.cpp
M Source/WebCore/platform/graphics/iso/ISOOriginalFormatBox.h
M Source/WebCore/platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp
M Source/WebCore/platform/graphics/iso/ISOProtectionSchemeInfoBox.h
M
Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp
M
Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h
M Source/WebCore/platform/graphics/iso/ISOSchemeInformationBox.cpp
M Source/WebCore/platform/graphics/iso/ISOSchemeInformationBox.h
M Source/WebCore/platform/graphics/iso/ISOSchemeTypeBox.cpp
M Source/WebCore/platform/graphics/iso/ISOSchemeTypeBox.h
M Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp
M Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h
M Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp
M Source/WebCore/platform/graphics/iso/ISOVTTCue.h
M Tools/TestWebKitAPI/Tests/WebCore/ISOBox.cpp
Log Message:
-----------
Support writing ISOBoxes as well as reading/parsing
rdar://180057740
https://bugs.webkit.org/show_bug.cgi?id=317430
Reviewed by Jean-Yves Avenard.
ISOBoxes and their subclasses are parsed representations of ISO-BMFF media
data. In addition
to reading these boxes from files and memory, we may also want to serialize
these boxes to
memory, for features like mp4-file authoring and editing.
Add the ability to write a box (and all its children) to memory. Each box must
be able to
calculate its own size, so there is a new pair of methods: `partialSize` and
`requiredSize`.
Base ISOBoxes boxes need their subclasses' sizes to be fully calculated, hence
the split
between the two functions. Also add a `serialize` and virtual `write` method,
and a convenience
template `checkedReadSequence` and `checkedWriteSequence` to support reading
and writing
data arrays.
Test: Tools/TestWebKitAPI/Tests/WebCore/ISOBox.cpp
* Source/WebCore/platform/graphics/iso/ISOBox.cpp:
(WebCore::ISOBox::ISOBox):
(WebCore::ISOBox::peekBox):
(WebCore::ISOBox::read):
(WebCore::ISOBox::updateSize):
(WebCore::ISOBox::partialSize const):
(WebCore::ISOBox::requiredSize const):
(WebCore::ISOBox::parse):
(WebCore::ISOBox::write const):
(WebCore::ISOBox::serialize const):
(WebCore::ISOFullBox::ISOFullBox):
(WebCore::ISOFullBox::parse):
(WebCore::ISOFullBox::write const):
(WebCore::ISOFullBox::parseVersionAndFlags):
* Source/WebCore/platform/graphics/iso/ISOBox.h:
(WebCore::ISOBox::checkedRead):
(WebCore::ISOBox::checkedReadSequence):
(WebCore::ISOBox::checkedWrite):
(WebCore::ISOBox::checkedWriteSequence):
(WebCore::ISOFullBox::setVersion):
(WebCore::ISOFullBox::setFlags):
* Source/WebCore/platform/graphics/iso/ISOOriginalFormatBox.cpp:
(WebCore::ISOOriginalFormatBox::ISOOriginalFormatBox):
(WebCore::ISOOriginalFormatBox::parse):
* Source/WebCore/platform/graphics/iso/ISOOriginalFormatBox.h:
* Source/WebCore/platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp:
(WebCore::ISOProtectionSchemeInfoBox::ISOProtectionSchemeInfoBox):
(WebCore::ISOProtectionSchemeInfoBox::parse):
(WebCore::ISOProtectionSchemeInfoBox::updateSize):
(WebCore::ISOProtectionSchemeInfoBox::partialSize const):
* Source/WebCore/platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
(WebCore::ISOProtectionSystemSpecificHeaderBox::commonSystemID const):
(WebCore::ISOProtectionSystemSpecificHeaderBox::ISOProtectionSystemSpecificHeaderBox):
(WebCore::ISOProtectionSystemSpecificHeaderBox::peekSystemID):
(WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
(WebCore::ISOProtectionSystemSpecificHeaderBox::parseData):
(WebCore::ISOProtectionSystemSpecificHeaderBox::write const):
(WebCore::ISOProtectionSystemSpecificHeaderBox::writeData const):
(WebCore::ISOProtectionSystemSpecificHeaderBox::partialSize const):
* Source/WebCore/platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
* Source/WebCore/platform/graphics/iso/ISOSchemeInformationBox.cpp:
(WebCore::ISOSchemeInformationBox::ISOSchemeInformationBox):
(WebCore::ISOSchemeInformationBox::parse):
(WebCore::ISOSchemeInformationBox::updateSize):
(WebCore::ISOSchemeInformationBox::partialSize const):
* Source/WebCore/platform/graphics/iso/ISOSchemeInformationBox.h:
* Source/WebCore/platform/graphics/iso/ISOSchemeTypeBox.cpp:
(WebCore::ISOSchemeTypeBox::ISOSchemeTypeBox):
(WebCore::ISOSchemeTypeBox::parse):
* Source/WebCore/platform/graphics/iso/ISOSchemeTypeBox.h:
* Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::ISOTrackEncryptionBox):
(WebCore::ISOTrackEncryptionBox::parse):
(WebCore::ISOTrackEncryptionBox::parsePayload):
* Source/WebCore/platform/graphics/iso/ISOTrackEncryptionBox.h:
* Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::ISOWebVTTCue):
* Source/WebCore/platform/graphics/iso/ISOVTTCue.h:
* Tools/TestWebKitAPI/Tests/WebCore/ISOBox.cpp:
(TestWebKitAPI::TEST(ISOBox, ISOFairPlayStreamingPsshBox)):
(TestWebKitAPI::serializeBox):
(TestWebKitAPI::TEST(ISOBox, FairPlay_KeyRequestInfoBox_Write)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_KeyRequestInfoBox_Roundtrip)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_InfoBox_Write)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_InfoBox_Roundtrip)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_KeyAssetIdBox_ParseAndRewrite)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_KeyRequestBox_WriteWithFkriOnly)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_KeyRequestBox_RoundtripWithAssetId)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_InitDataBox_WriteAndRoundtrip)):
(TestWebKitAPI::TEST(ISOBox, FairPlay_PsshBox_ParseWriteParseRoundtrip)):
(TestWebKitAPI::TEST(ISOBox,
PsshBox_V1_PartialSizeIncludesSystemIDAndDataSize)):
Canonical link: https://commits.webkit.org/319410@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications