Changeset 258314 in webkit
- Timestamp:
- Mar 11, 2020 9:57:31 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r258295 r258314 1 2020-03-11 Jer Noble <jer.noble@apple.com> 2 3 Adopt AVSampleBufferVideoOutput 4 https://bugs.webkit.org/show_bug.cgi?id=208951 5 6 Reviewed by Eric Carlson. 7 8 * wtf/PlatformHave.h: 9 1 10 2020-03-11 Jer Noble <jer.noble@apple.com> 2 11 -
trunk/Source/WTF/wtf/PlatformHave.h
r258283 r258314 601 601 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) 602 602 #define HAVE_WEBP 1 603 #define HAVE_AVSAMPLEBUFFERVIDEOOUTPUT 1 603 604 #endif 604 605 -
trunk/Source/WebCore/ChangeLog
r258313 r258314 1 2020-03-11 Jer Noble <jer.noble@apple.com> 2 3 Adopt AVSampleBufferVideoOutput 4 https://bugs.webkit.org/show_bug.cgi?id=208951 5 6 Reviewed by Eric Carlson. 7 8 Adopt AVSampleBufferVideoOutput, used for extracting decoded samples from an AVSampleBufferDisplayLayer. 9 10 Rather than use a separate decompression session when we need to, e.g., paint samples into WebGL, we will 11 add a AVSBVO to the AVSBDL and use it to extract CVPixelBuffers when asked. 12 13 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: 14 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: 15 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer): 16 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged): 17 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): 18 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isVideoOutputAvailable const): 19 1 20 2020-03-11 Andres Gonzalez <andresg_22@apple.com> 2 21 -
trunk/Source/WebCore/PAL/ChangeLog
r258295 r258314 1 2020-03-11 Jer Noble <jer.noble@apple.com> 2 3 Adopt AVSampleBufferVideoOutput 4 https://bugs.webkit.org/show_bug.cgi?id=208951 5 6 Reviewed by Eric Carlson. 7 8 * pal/cocoa/AVFoundationSoftLink.h: 9 * pal/cocoa/AVFoundationSoftLink.mm: 10 * pal/spi/cocoa/AVFoundationSPI.h: 11 1 12 2020-03-11 Jer Noble <jer.noble@apple.com> 2 13 -
trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h
r254257 r258314 63 63 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferDisplayLayer) 64 64 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferRenderSynchronizer) 65 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSampleBufferVideoOutput) 65 66 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVStreamDataParser) 66 67 SOFT_LINK_CLASS_FOR_HEADER(PAL, AVURLAsset) -
trunk/Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.mm
r255455 r258314 90 90 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferDisplayLayer, PAL_EXPORT) 91 91 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferRenderSynchronizer, PAL_EXPORT) 92 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVSampleBufferVideoOutput, PAL_EXPORT) 92 93 SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, AVFoundation, AVStreamDataParser, PAL_EXPORT) 93 94 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h
r258295 r258314 356 356 @end 357 357 #endif 358 359 #if HAVE(AVSAMPLEBUFFERVIDEOOUTPUT) 360 #if USE(APPLE_INTERNAL_SDK) 361 #include <AVFoundation/AVSampleBufferVideoOutput.h> 362 #else 363 @interface AVSampleBufferVideoOutput : NSObject 364 - (CVPixelBufferRef)copyPixelBufferForSourceTime:(CMTime)sourceTime sourceTimeForDisplay:(nullable CMTime *)outSourceTimeForDisplay; 365 @end 366 367 @interface AVSampleBufferDisplayLayer (VideoOutput) 368 @property (nonatomic, nullable) AVSampleBufferVideoOutput *output; 369 @end 370 #endif 371 #endif -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
r258082 r258314 42 42 OBJC_CLASS AVSampleBufferDisplayLayer; 43 43 OBJC_CLASS AVSampleBufferRenderSynchronizer; 44 OBJC_CLASS AVSampleBufferVideoOutput; 44 45 OBJC_CLASS AVStreamSession; 45 46 … … 261 262 262 263 bool shouldBePlaying() const; 264 265 bool isVideoOutputAvailable() const; 263 266 264 267 friend class MediaSourcePrivateAVFObjC; … … 283 286 RetainPtr<AVAsset> m_asset; 284 287 RetainPtr<AVSampleBufferDisplayLayer> m_sampleBufferDisplayLayer; 288 #if HAVE(AVSAMPLEBUFFERVIDEOOUTPUT) 289 RetainPtr<AVSampleBufferVideoOutput> m_videoOutput; 290 #endif 285 291 286 292 struct AudioRendererProperties { -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
r258082 r258314 586 586 bool MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer() 587 587 { 588 #if HAVE(AVSAMPLEBUFFERVIDEOOUTPUT) 589 if (m_videoOutput) { 590 CMTime outputTime; 591 if (auto pixelBuffer = [m_videoOutput copyPixelBufferForSourceTime:toCMTime(currentMediaTime()) sourceTimeForDisplay:&outputTime]) { 592 INFO_LOG(LOGIDENTIFIER, "new pixelbuffer found for time ", toMediaTime(outputTime)); 593 m_lastPixelBuffer = WTFMove(pixelBuffer); 594 return true; 595 } 596 } 597 #endif 598 588 599 if (m_sampleBufferDisplayLayer || !m_decompressionSession) 589 600 return false; … … 671 682 void MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged() 672 683 { 673 if (!m_hasBeenAskedToPaintGL ) {684 if (!m_hasBeenAskedToPaintGL || isVideoOutputAvailable()) { 674 685 destroyDecompressionSession(); 675 686 ensureLayer(); … … 756 767 #endif 757 768 769 #if HAVE(AVSAMPLEBUFFERVIDEOOUTPUT) 770 ASSERT(!m_videoOutput); 771 if (isVideoOutputAvailable()) { 772 m_videoOutput = adoptNS([PAL::allocAVSampleBufferVideoOutputInstance() init]); 773 ASSERT(m_videoOutput); 774 [m_sampleBufferDisplayLayer setOutput:m_videoOutput.get()]; 775 } 776 #endif 777 758 778 ASSERT(m_sampleBufferDisplayLayer); 759 779 if (!m_sampleBufferDisplayLayer) { … … 821 841 { 822 842 return m_playing && !seeking() && allRenderersHaveAvailableSamples() && m_readyState >= MediaPlayer::ReadyState::HaveFutureData; 843 } 844 845 bool MediaPlayerPrivateMediaSourceAVFObjC::isVideoOutputAvailable() const 846 { 847 #if HAVE(AVSAMPLEBUFFERVIDEOOUTPUT) 848 return PAL::getAVSampleBufferVideoOutputClass; 849 #else 850 return false; 851 #endif 823 852 } 824 853
Note: See TracChangeset
for help on using the changeset viewer.