Changeset 272822 in webkit
- Timestamp:
- Feb 12, 2021 4:29:35 PM (17 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-bigsur/media (added)
-
LayoutTests/platform/mac-bigsur/media/media-webm-no-duration-expected.txt (added)
-
LayoutTests/platform/mac-bigsur/media/media-webm-no-duration.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm (modified) (1 diff)
-
Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm (modified) (2 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/mac/MediaFormatReader/MediaFormatReader.cpp (modified) (2 diffs)
-
Source/WebKit/Shared/mac/MediaFormatReader/MediaTrackReader.cpp (modified) (1 diff)
-
Source/WebKit/Shared/mac/MediaFormatReader/MediaTrackReader.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r272818 r272822 1 2021-02-12 Jer Noble <jer.noble@apple.com> 2 3 [Mac] Unable to play WebM/Opus generated from Chrome MediaRecorder 4 https://bugs.webkit.org/show_bug.cgi?id=221808 5 6 Reviewed by Eric Carlson. 7 8 * platform/mac-bigsur/media/media-webm-no-duration-expected.txt: Added. 9 * platform/mac-bigsur/media/media-webm-no-duration.html: Added. 10 1 11 2021-02-12 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r272811 r272822 1 2021-02-12 Jer Noble <jer.noble@apple.com> 2 3 [Mac] Unable to play WebM/Opus generated from Chrome MediaRecorder 4 https://bugs.webkit.org/show_bug.cgi?id=221808 5 6 Reviewed by Eric Carlson. 7 8 Test: platform/mac-bigsur/media/media-webm-no-duration.html 9 10 In the absense of an explicit decode timestamp, CoreMedia convention is to use 11 the presentation timestamp instead. 12 13 All fields in the CoreAudioOpusHeader must be byte-swapped. 14 15 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: 16 (WebCore::MediaSampleAVFObjC::decodeTime const): 17 * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: 18 (WebCore::cookieFromOpusCodecPrivate): 19 1 20 2021-02-12 Stephan Szabo <stephan.szabo@sony.com> 2 21 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm
r272353 r272822 88 88 MediaTime MediaSampleAVFObjC::decodeTime() const 89 89 { 90 return PAL::toMediaTime(CMSampleBufferGetDecodeTimeStamp(m_sample.get())); 90 auto timeStamp = CMSampleBufferGetDecodeTimeStamp(m_sample.get()); 91 if (CMTIME_IS_INVALID(timeStamp)) 92 return presentationTime(); 93 return PAL::toMediaTime(timeStamp); 91 94 } 92 95 -
trunk/Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm
r272758 r272822 298 298 int packetBandwidth; 299 299 unsigned packetStreamChannels; 300 unsigned useInbandFEC { 1 };300 unsigned useInbandFEC; 301 301 unsigned encFinalRange { 0 }; 302 302 }; … … 308 308 static_cast<int>(CFSwapInt32HostToBig(bandwidth)), 309 309 CFSwapInt32HostToBig(channelCount), 310 CFSwapInt32HostToBig(1), 310 311 }; 311 312 -
trunk/Source/WebKit/ChangeLog
r272816 r272822 1 2021-02-12 Jer Noble <jer.noble@apple.com> 2 3 [Mac] Unable to play WebM/Opus generated from Chrome MediaRecorder 4 https://bugs.webkit.org/show_bug.cgi?id=221808 5 6 Reviewed by Eric Carlson. 7 8 In the absense of an explicit duration parsed from the InitializationSegment, 9 rely instead on the maximum presentation timestamp available in any MediaTrackReader 10 to generate an explicit duration. 11 12 * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: 13 (WebKit::MediaFormatReader::finishParsing): 14 (WebKit::MediaFormatReader::copyProperty): 15 * Shared/mac/MediaFormatReader/MediaTrackReader.cpp: 16 (WebKit::MediaTrackReader::greatestPresentationTime const): 17 * Shared/mac/MediaFormatReader/MediaTrackReader.h: 18 1 19 2021-02-12 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/Source/WebKit/Shared/mac/MediaFormatReader/MediaFormatReader.cpp
r272039 r272822 218 218 trackReader->finishParsing(); 219 219 220 if (m_duration.isIndefinite()) { 221 MediaTime greatestPresentationTime { MediaTime::invalidTime() }; 222 for (auto& trackReader : m_trackReaders) { 223 if (greatestPresentationTime.isInvalid() || trackReader->greatestPresentationTime() > greatestPresentationTime) 224 greatestPresentationTime = trackReader->greatestPresentationTime(); 225 } 226 if (greatestPresentationTime.isValid()) 227 m_duration = greatestPresentationTime; 228 } 229 220 230 parser->setDidParseInitializationDataCallback(nullptr); 221 231 parser->setDidEncounterErrorDuringParsingCallback(nullptr); … … 232 242 233 243 if (CFEqual(key, PAL::get_MediaToolbox_kMTPluginFormatReaderProperty_Duration())) { 244 if (m_duration.isIndefinite()) 245 return kCMBaseObjectError_ValueNotAvailable; 246 234 247 if (auto leakedDuration = adoptCF(CMTimeCopyAsDictionary(PAL::toCMTime(m_duration), allocator)).leakRef()) { 235 248 *reinterpret_cast<CFDictionaryRef*>(valueCopy) = leakedDuration; -
trunk/Source/WebKit/Shared/mac/MediaFormatReader/MediaTrackReader.cpp
r271939 r272822 86 86 } 87 87 88 MediaTime MediaTrackReader::greatestPresentationTime() const 89 { 90 auto& sampleMap = m_sampleStorage->sampleMap; 91 if (sampleMap.empty()) 92 return MediaTime::invalidTime(); 93 94 auto& lastSample = *sampleMap.decodeOrder().rbegin()->second; 95 return lastSample.presentationTime() + lastSample.duration(); 96 } 97 88 98 void MediaTrackReader::addSample(Ref<MediaSample>&& sample, MTPluginByteSourceRef byteSource) 89 99 { -
trunk/Source/WebKit/Shared/mac/MediaFormatReader/MediaTrackReader.h
r271939 r272822 62 62 CMMediaType mediaType() const { return m_mediaType; } 63 63 const MediaTime& duration() const { return m_duration; } 64 MediaTime greatestPresentationTime() const; 64 65 65 66 void setEnabled(bool enabled) { m_isEnabled = enabled ? Enabled::True : Enabled::False; }
Note: See TracChangeset
for help on using the changeset viewer.