[webkit-changes] [WebKit/WebKit] b41ec2: Add variable frame size support in Opus and Vorbis...
Jean-Yves Avenard
noreply at github.com
Thu Sep 28 20:18:31 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b41ec215a5167f97c2297bb8d08ae0390444dc06
https://github.com/WebKit/WebKit/commit/b41ec215a5167f97c2297bb8d08ae0390444dc06
Author: Jean-Yves Avenard <jya at apple.com>
Date: 2023-09-28 (Thu, 28 Sep 2023)
Changed paths:
A LayoutTests/media/content/opus_variable.webm
A LayoutTests/media/media-webm-opus-variable-length-expected.txt
A LayoutTests/media/media-webm-opus-variable-length.html
M LayoutTests/platform/ios-16/TestExpectations
M LayoutTests/platform/mac/TestExpectations
M Source/WTF/wtf/PlatformHave.h
M Source/WebCore/PAL/pal/spi/cocoa/AudioToolboxSPI.h
M Source/WebCore/platform/SharedBuffer.cpp
M Source/WebCore/platform/SharedBuffer.h
M Source/WebCore/platform/graphics/cocoa/CMUtilities.h
M Source/WebCore/platform/graphics/cocoa/CMUtilities.mm
M Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp
M Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h
M Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h
M Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm
Log Message:
-----------
Add variable frame size support in Opus and Vorbis webm file
https://bugs.webkit.org/show_bug.cgi?id=261953
rdar://99712672
Reviewed by Eric Carlson
Adopt new CoreMedia support for variable size packets.
This is done by creating different magic cookies for Opus and Vorbis
stream.
And we then calculate the packet's frame size by parsing the first byte
of each packets according to the specs.
As this is only supported in iOS 17 and macOS Sonoma we keep the previous
way, which was just assuming all streams never changed.
Test added, on cocoa platforms, requires Sonoma or iOS 17.
* LayoutTests/media/content/opus_variable.webm: Added.
* LayoutTests/media/media-webm-opus-variable-length-expected.txt: Added.
* LayoutTests/media/media-webm-opus-variable-length.html: Added.
* LayoutTests/platform/ios-16/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/PAL/pal/spi/cocoa/AudioToolboxSPI.h:
* Source/WebCore/platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::operator[] const):
* Source/WebCore/platform/SharedBuffer.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.mm:
(WebCore::createFormatDescriptionFromTrackInfo):
(WebCore::PacketDurationParser::PacketDurationParser):
(WebCore::PacketDurationParser::framesInPacket):
(WebCore::PacketDurationParser::reset):
* Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::WebMParser::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::setLogger):
* Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h:
* Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h:
* Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:
(WebCore::opusConfigToFrameDuration):
(WebCore::parseOpusTOCData):
(WebCore::parseOpusPrivateData):
(WebCore::cookieFromOpusCookieContents):
(WebCore::createOpusAudioInfo):
(WebCore::cookieFromVorbisCodecPrivate):
(WebCore::registerVorbisDecoderIfNeeded):
(WebCore::createVorbisAudioInfo):
Canonical link: https://commits.webkit.org/268625@main
More information about the webkit-changes
mailing list