Repository navigation
Conversation
https://bugs.webkit.org/show_bug.cgi?id=327758 rdar://190173646 Reviewed by NOBODY (OOPS!). MediaSamplesDecoder was a skeleton whose methods were placeholders. It now decodes audio in the content process by wrapping AudioDecoder, for every codec AudioDecoder accepts: Opus, Vorbis, FLAC, MP3, AAC (LC, HE, HE v2), A-law, u-law and PCM. The decoded output is one MediaSamplesBlock of interleaved 32-bit float samples per call, backed by shared memory when UseSharedMemory is set. The AAC cookie of a track built from a format description is an ES_Descriptor, which is unwrapped to the AudioSpecificConfig AudioDecoder expects. Encrypted tracks, and blocks holding encrypted samples, are rejected. Only Cocoa is supported for now; other platforms and video report that they cannot decode. MediaSamplesBlock gains isolatedCopy() as NativePromise copies its resolve value across threads. * Source/WebCore/platform/MediaSamplesBlock.h: (WebCore::MediaSamplesBlock::isolatedCopy): * Source/WebCore/platform/MediaSamplesDecoder.cpp: (WebCore::nextDescriptor): Added. (WebCore::audioSpecificConfigFromESDescriptor): Added. (WebCore::audioDecoderConfiguration): Added. (WebCore::MediaSamplesDecoder::MediaSamplesDecoder): (WebCore::MediaSamplesDecoder::~MediaSamplesDecoder): (WebCore::MediaSamplesDecoder::canDecode): (WebCore::MediaSamplesDecoder::create): (WebCore::MediaSamplesDecoder::canContinueWith): (WebCore::MediaSamplesDecoder::decode): (WebCore::MediaSamplesDecoder::drain): (WebCore::MediaSamplesDecoder::flush): (WebCore::MediaSamplesDecoder::decodeOnQueue): Added. (WebCore::MediaSamplesDecoder::drainOnQueue): Added. (WebCore::MediaSamplesDecoder::flushOnQueue): Added. (WebCore::MediaSamplesDecoder::finishFlush): Added. (WebCore::MediaSamplesDecoder::settleWithPendingOutput): Added. (WebCore::MediaSamplesDecoder::setAudioDecoder): Added. (WebCore::MediaSamplesDecoder::didFailDecoding): Added. (WebCore::MediaSamplesDecoder::didDecodeAudio): Added. * Source/WebCore/platform/MediaSamplesDecoder.h: * Tools/TestWebKitAPI/PlatformCocoa.cmake: * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/WebCore/cocoa/MediaSamplesDecoderTests.mm: Added.
Collaborator
|
EWS run on current version of this PR (hash ffc83d5) Details
|
Collaborator
macOS Safer C++ Build #140369 (ffc83d5)❌ Found 1 failing file with 6 issues. Please address these issues before landing. See WebKit Guidelines for Safer C++ Programming. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧪 api-mac
ffc83d5
ffc83d5