2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com>

        Reviewed by Mark Rowe.

        <rdar://problem/6747241> work around QTKit no longer reaching
        QTMovieLoadStateComplete

        * WebCore.base.exp: Export wkQTMovieMaxTimeLoadedChangeNotification.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::createQTMovie): observe QTMovieMaxTimeLoadedChangeNotification.
        (WebCore::MediaPlayerPrivate::updateStates): compare duuration() with maxTimeLoaded() instead of
        using QTMovieLoadStateComplete to determine if a movie are fully loaded.

        * platform/mac/WebCoreSystemInterface.h: Add wkQTMovieMaxTimeLoadedChangeNotification.
        * platform/mac/WebCoreSystemInterface.mm: Ditto.

2009-04-18  Pierre d'Herbemont  <pdherbemont@apple.com>

        Reviewed by Mark Rowe.

        <rdar://problem/6747241> work around QTKit no longer reaching
        QTMovieLoadStateComplete

        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface): Init the new WKSI exported symbol.



git-svn-id: svn://svn.chromium.org/blink/trunk@42641 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6cea9714
2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com>
Reviewed by Mark Rowe.
<rdar://problem/6747241> work around QTKit no longer reaching
QTMovieLoadStateComplete
* WebCore.base.exp: Export wkQTMovieMaxTimeLoadedChangeNotification.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::createQTMovie): observe QTMovieMaxTimeLoadedChangeNotification.
(WebCore::MediaPlayerPrivate::updateStates): compare duuration() with maxTimeLoaded() instead of
using QTMovieLoadStateComplete to determine if a movie are fully loaded.
* platform/mac/WebCoreSystemInterface.h: Add wkQTMovieMaxTimeLoadedChangeNotification.
* platform/mac/WebCoreSystemInterface.mm: Ditto.
2009-04-18 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
Reviewed by George Staikos.
......@@ -983,6 +983,7 @@ _wkPopupMenu
_wkQTIncludeOnlyModernMediaFileTypes
_wkQTMovieDataRate
_wkQTMovieMaxTimeLoaded
_wkQTMovieMaxTimeLoadedChangeNotification
_wkQTMovieViewSetDrawSynchronously
_wkSetCGFontRenderingMode
_wkSetDragImage
......
......@@ -230,7 +230,7 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
[NSNumber numberWithBool:YES], @"QTMovieOpenForPlaybackAttribute", // FIXME: Use defined attribute when required version of QT supports this attribute
nil];
NSError* error = nil;
NSError *error = nil;
m_qtMovie.adoptNS([[QTMovie alloc] initWithAttributes:movieAttributes error:&error]);
// FIXME: Find a proper way to detect streaming content.
......@@ -245,6 +245,17 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
selector:@selector(loadStateChanged:)
name:QTMovieLoadStateDidChangeNotification
object:m_qtMovie.get()];
// In updateState(), we track when maxTimeLoaded() == duration().
// In newer version of QuickTime, a notification is emitted when maxTimeLoaded changes.
// In older version of QuickTime, QTMovieLoadStateDidChangeNotification be fired.
if (NSString *maxTimeLoadedChangeNotification = wkQTMovieMaxTimeLoadedChangeNotification()) {
[[NSNotificationCenter defaultCenter] addObserver:m_objcObserver.get()
selector:@selector(loadStateChanged:)
name:maxTimeLoadedChangeNotification
object:m_qtMovie.get()];
}
[[NSNotificationCenter defaultCenter] addObserver:m_objcObserver.get()
selector:@selector(rateChanged:)
name:QTMovieRateDidChangeNotification
......@@ -665,7 +676,14 @@ void MediaPlayerPrivate::updateStates()
}
}
if (loadState >= QTMovieLoadStateComplete && !m_isStreaming) {
BOOL completelyLoaded = !m_isStreaming && (loadState >= QTMovieLoadStateComplete);
// Note: QT indicates that we are fully loaded with QTMovieLoadStateComplete.
// However newer versions of QT do not, so we check maxTimeLoaded against duration.
if (!completelyLoaded && !m_isStreaming && metaDataAvailable())
completelyLoaded = maxTimeLoaded() == duration();
if (completelyLoaded) {
// "Loaded" is reserved for fully buffered movies, never the case when streaming
m_networkState = MediaPlayer::Loaded;
m_readyState = MediaPlayer::HaveEnoughData;
......
......@@ -120,6 +120,7 @@ extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int
extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
extern int (*wkQTMovieDataRate)(QTMovie*);
extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
......
......@@ -54,6 +54,7 @@ void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selecte
unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
int (*wkQTMovieDataRate)(QTMovie*);
float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
......
2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com>
Reviewed by Mark Rowe.
<rdar://problem/6747241> work around QTKit no longer reaching
QTMovieLoadStateComplete
* WebCoreSupport/WebSystemInterface.m:
(InitWebCoreSystemInterface): Init the new WKSI exported symbol.
2009-04-17 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
......
......@@ -75,6 +75,7 @@ void InitWebCoreSystemInterface(void)
INIT(QTIncludeOnlyModernMediaFileTypes);
INIT(QTMovieDataRate);
INIT(QTMovieMaxTimeLoaded);
INIT(QTMovieMaxTimeLoadedChangeNotification);
INIT(QTMovieViewSetDrawSynchronously);
#ifndef BUILDING_ON_TIGER
......
2009-04-18 Pierre d'Herbemont <pdherbemont@apple.com>
Reviewed by Mark Rowe.
<rdar://problem/6747241> work around QTKit no longer reaching
QTMovieLoadStateComplete
* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceTiger.a:
2009-04-15 Steve Falkenburg <sfalken@apple.com>
Updated WebKitSystemInterface for Windows.
......
/*
WebKitSystemInterface.h
Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
Public header file.
*/
......@@ -182,6 +182,7 @@ BOOL WKAppVersionCheckLessThan(NSString *, int, double);
unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
int WKQTMovieDataRate(QTMovie* movie);
float WKQTMovieMaxTimeLoaded(QTMovie* movie);
NSString *WKQTMovieMaxTimeLoadedChangeNotification(void);
void WKQTMovieViewSetDrawSynchronously(QTMovieView* view, BOOL sync);
CFStringRef WKCopyFoundationCacheDirectory(void);
......
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