Changeset 171292 in webkit


Ignore:
Timestamp:
Jul 20, 2014, 11:16:44 PM (11 years ago)
Author:
jeremyj-wk@apple.com
Message:

Unreviewed Fix test crashes when cloning video layer since r171286
https://bugs.webkit.org/show_bug.cgi?id=135112

Unreviewed. Fix crashing tests by conditionalizing inline video layer change.
compositing/video/video-reflection.html [ Crash ]
media/video-layer-crash.html [ Crash ]

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add conditional
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto

(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): ditto
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): ditto

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r171289 r171292  
    2121        * platform/SharedBuffer.cpp:
    2222        (WebCore::SharedBuffer::append):
     23
     242014-07-20  Jeremy Jones  <jeremyj@apple.com>
     25
     26        Fix test crashes when cloning video layer since r171286
     27        https://bugs.webkit.org/show_bug.cgi?id=135112
     28
     29        Unreviewed. Fix crashing tests by conditionalizing inline video layer change.
     30        compositing/video/video-reflection.html [ Crash ]
     31        media/video-layer-crash.html [ Crash ]
     32
     33        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add conditional
     34        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
     35        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): ditto
     36        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto
     37        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): ditto
    2338
    24392014-07-20  Jeremy Jones  <jeremyj@apple.com>
  • TabularUnified trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h

    r171288 r171292  
    277277    RetainPtr<AVPlayerItem> m_avPlayerItem;
    278278    RetainPtr<AVPlayerLayer> m_videoLayer;
     279#if PLATFORM(IOS)
    279280    RetainPtr<PlatformLayer> m_videoInlineLayer;
    280 #if PLATFORM(IOS)
    281281    RetainPtr<PlatformLayer> m_videoFullscreenLayer;
    282282    FloatRect m_videoFullscreenFrame;
  • TabularUnified trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r171288 r171292  
    587587    [m_videoLayer setPlayer:m_avPlayer.get()];
    588588    [m_videoLayer setBackgroundColor:cachedCGColor(Color::black, ColorSpaceDeviceRGB)];
    589     m_videoInlineLayer = adoptNS([[WebVideoContainerLayer alloc] init]);
    590589#ifndef NDEBUG
    591590    [m_videoLayer setName:@"MediaPlayerPrivate AVPlayerLayer"];
     
    594593    updateVideoLayerGravity();
    595594    IntSize defaultSize = player()->mediaPlayerClient() ? player()->mediaPlayerClient()->mediaPlayerContentBoxRect().pixelSnappedSize() : IntSize();
     595    LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createVideoLayer(%p) - returning %p", this, m_videoLayer.get());
     596
     597#if PLATFORM(IOS)
     598    m_videoInlineLayer = adoptNS([[WebVideoContainerLayer alloc] init]);
    596599    [m_videoInlineLayer setFrame:CGRectMake(0, 0, defaultSize.width(), defaultSize.height())];
    597     LOG(Media, "MediaPlayerPrivateAVFoundationObjC::createVideoLayer(%p) - returning %p", this, m_videoLayer.get());
    598 
    599 #if PLATFORM(IOS)
    600600    if (m_videoFullscreenLayer) {
    601601        [m_videoLayer setFrame:[m_videoFullscreenLayer bounds]];
    602602        [m_videoFullscreenLayer insertSublayer:m_videoLayer.get() atIndex:0];
    603     } else
    604 #endif
    605     {
     603    } else {
    606604        [m_videoInlineLayer insertSublayer:m_videoLayer.get() atIndex:0];
    607605        [m_videoLayer setFrame:m_videoInlineLayer.get().bounds];
    608606    }
     607#else
     608    [m_videoLayer setFrame:CGRectMake(0, 0, defaultSize.width(), defaultSize.height())];
     609#endif
    609610}
    610611
     
    622623    if (m_videoFullscreenLayer)
    623624        [m_videoLayer removeFromSuperlayer];
     625    m_videoInlineLayer = nil;
    624626#endif
    625627
    626628    m_videoLayer = nil;
    627     m_videoInlineLayer = nil;
    628629}
    629630
     
    956957PlatformLayer* MediaPlayerPrivateAVFoundationObjC::platformLayer() const
    957958{
     959#if PLATFORM(IOS)
    958960    return m_haveBeenAskedToCreateLayer ? m_videoInlineLayer.get() : nullptr;
     961#else
     962    return m_haveBeenAskedToCreateLayer ? m_videoLayer.get() : nullptr;
     963#endif
    959964}
    960965
Note: See TracChangeset for help on using the changeset viewer.