2009-05-13 Eric Carlson <eric.carlson@apple.com>

        Reviewed by Darin Adler.

        <rdar://problem/6438177> QTMoviePreferredTransformAttribute only supported on SnowLeopard
        <rdar://problem/6872468> QTMovieOpenForPlaybackAttribute only supported on SnowLeopard

        QTMoviePreferredTransformAttribute and QTMovieOpenForPlaybackAttribute are not supported
        on Tiger or Leopard.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setNetworkState): Remove invalid ASSERT.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::createQTMovie): Only request QTMoviePreferredTransformAttribute
        when !BUILDING_ON_TIGER and !BUILDING_ON_LEOPARD.
        (WebCore::MediaPlayerPrivate::cacheMovieScale): Only ask for QTMovieOpenForPlaybackAttribute 
        when !BUILDING_ON_TIGER and !BUILDING_ON_LEOPARD,



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f1550984
2009-05-13 Eric Carlson <eric.carlson@apple.com>
Reviewed by Darin Adler.
<rdar://problem/6438177> QTMoviePreferredTransformAttribute only supported on SnowLeopard
<rdar://problem/6872468> QTMovieOpenForPlaybackAttribute only supported on SnowLeopard
QTMoviePreferredTransformAttribute and QTMovieOpenForPlaybackAttribute are not supported
on Tiger or Leopard.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setNetworkState): Remove invalid ASSERT.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::createQTMovie): Only request QTMoviePreferredTransformAttribute
when !BUILDING_ON_TIGER and !BUILDING_ON_LEOPARD.
(WebCore::MediaPlayerPrivate::cacheMovieScale): Only ask for QTMovieOpenForPlaybackAttribute
when !BUILDING_ON_TIGER and !BUILDING_ON_LEOPARD,
2009-05-12 Roland Steiner <rolandsteiner@google.com>
Reviewed by Eric Seidel.
......@@ -644,7 +644,6 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
}
if (state == MediaPlayer::Loading) {
ASSERT(static_cast<ReadyState>(m_player->readyState()) < HAVE_ENOUGH_DATA);
if (m_networkState < NETWORK_LOADING || m_networkState == NETWORK_NO_SOURCE)
startProgressEventTimer();
m_networkState = NETWORK_LOADING;
......
......@@ -236,7 +236,9 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
[NSNumber numberWithBool:YES], QTMoviePreventExternalURLLinksAttribute,
[NSNumber numberWithBool:YES], QTSecurityPolicyNoCrossSiteAttribute,
[NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute,
[NSNumber numberWithBool:YES], @"QTMovieOpenForPlaybackAttribute", // FIXME: Use defined attribute when required version of QT supports this attribute
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
[NSNumber numberWithBool:YES], @"QTMovieOpenForPlaybackAttribute",
#endif
#ifndef BUILDING_ON_TIGER
QTMovieApertureModeClean, QTMovieApertureModeAttribute,
#endif
......@@ -678,19 +680,19 @@ void MediaPlayerPrivate::cacheMovieScale()
NSSize initialSize = NSZeroSize;
NSSize naturalSize = [[m_qtMovie.get() attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
// QTMovieCurrentSizeAttribute is not allowed with some versions of QuickTime so ask for the display
// transform attribute first. If it is supported we don't need QTMovieCurrentSizeAttribute.
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
// QTMovieCurrentSizeAttribute is not allowed with instances of QTMovie that have been
// opened with QTMovieOpenForPlaybackAttribute, so ask for the display transform attribute instead.
NSAffineTransform *displayTransform = [m_qtMovie.get() attributeForKey:@"QTMoviePreferredTransformAttribute"];
if (displayTransform)
initialSize = [displayTransform transformSize:naturalSize];
else {
@try {
initialSize = [[m_qtMovie.get() attributeForKey:QTMovieCurrentSizeAttribute] sizeValue];
} @catch (id) {
initialSize.width = naturalSize.width;
initialSize.height = naturalSize.height;
}
initialSize.width = naturalSize.width;
initialSize.height = naturalSize.height;
}
#else
initialSize = [[m_qtMovie.get() attributeForKey:QTMovieCurrentSizeAttribute] sizeValue];
#endif
if (naturalSize.width)
m_scaleFactor.setWidth(initialSize.width / naturalSize.width);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment