Skip to content
  • dino@apple.com's avatar
    [Mac] Drawing video into canvas doesn't work on the first attempt · d039aa2b
    dino@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=122404
    
    Patch by Jer Noble <jer.noble@apple.com> on 2013-10-07
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Test: media/video-canvas-drawing.html
    
    If creating and painting from an AVPlayerItemVideoOutput fails, fall back
    to the (much slower) AVAssetImageGenerator path. Make sure to revert to the
    AVPlayerItemVideoOutput path when that object begins to have available
    images, however.
    
    To do so, remove the "__MAC_OS_X_VERSION_MIN_REQUIRED < 1080" check around
    the AVAssetImageGenerator code, and allow both the image generator and video
    output to exist simultaneously.
    
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::videoOutputHasAvailableFrame):
    (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
    
    LayoutTests:
    
    * media/video-canvas-drawing-expected.png: Added.
    * media/video-canvas-drawing-expected.txt: Added.
    * media/video-canvas-drawing.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d039aa2b