Commit eb13887c authored by antti@apple.com's avatar antti@apple.com

        Reviewed by Adam.

        Fix <rdar://problem/5682767>
        Video does not show up in http://webkit.org/blog/140/html5-media-support/ on Windows
        
        Take care that GWorld is created and deletes when needed as size or visibility changes.



git-svn-id: svn://svn.chromium.org/blink/trunk@29410 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3ac060e1
2008-01-10 Antti Koivisto <antti@apple.com>
Reviewed by Adam.
Fix <rdar://problem/5682767>
Video does not show up in http://webkit.org/blog/140/html5-media-support/ on Windows
Take care that GWorld is created and deletes when needed as size or visibility changes.
* platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
(WebCore::MediaPlayerPrivate::load):
* platform/graphics/win/QTMovieWin.cpp:
(QTMovieWinPrivate::QTMovieWinPrivate):
(QTMovieWinPrivate::updateGWorld):
(QTMovieWinPrivate::setSize):
(QTMovieWin::setVisible):
(QTMovieWin::initializeQuickTime):
2008-01-11 David Hyatt <hyatt@apple.com>
Fix for bug 11188, setting hspace on a table overrides align=center. Fix align=center to be done using
......
......@@ -81,6 +81,7 @@ void MediaPlayerPrivate::load(const String& url)
m_qtMovie->load(url.characters(), url.length());
m_qtMovie->setMuted(m_player->m_muted);
m_qtMovie->setVolume(m_player->m_volume);
m_qtMovie->setVisible(m_player->m_visible);
}
void MediaPlayerPrivate::play()
......
......@@ -82,6 +82,7 @@ public:
void registerDrawingCallback();
void drawingComplete();
void updateGWorld();
void createGWorld();
void deleteGWorld();
......@@ -98,6 +99,7 @@ public:
double m_lastLoadStateCheckTime;
int m_width;
int m_height;
bool m_visible;
GWorldPtr m_gWorld;
int m_gWorldWidth;
int m_gWorldHeight;
......@@ -117,6 +119,7 @@ QTMovieWinPrivate::QTMovieWinPrivate()
, m_lastLoadStateCheckTime(0)
, m_width(0)
, m_height(0)
, m_visible(false)
, m_gWorld(0)
, m_gWorldWidth(0)
, m_gWorldHeight(0)
......@@ -218,6 +221,23 @@ void QTMovieWinPrivate::drawingComplete()
m_client->movieNewImageAvailable(m_movieWin);
}
void QTMovieWinPrivate::updateGWorld()
{
bool shouldBeVisible = m_visible;
if (!m_height || !m_width)
shouldBeVisible = false;
if (shouldBeVisible && !m_gWorld)
createGWorld();
else if (!shouldBeVisible && m_gWorld)
deleteGWorld();
else if (m_gWorld && (m_width > m_gWorldWidth || m_height > m_gWorldHeight)) {
// need a bigger, better gWorld
deleteGWorld();
createGWorld();
}
}
void QTMovieWinPrivate::createGWorld()
{
ASSERT(!m_gWorld);
......@@ -255,11 +275,7 @@ void QTMovieWinPrivate::setSize(int width, int height)
bounds.right = width;
bounds.bottom = height;
SetMovieBox(m_movie, &bounds);
if (m_gWorld && (m_width > m_gWorldWidth || m_height > m_gWorldHeight)) {
// need a bigger, better gWorld
deleteGWorld();
createGWorld();
}
updateGWorld();
}
void QTMovieWinPrivate::deleteGWorld()
......@@ -270,6 +286,8 @@ void QTMovieWinPrivate::deleteGWorld()
m_savedGWorld = 0;
DisposeGWorld(m_gWorld);
m_gWorld = 0;
m_gWorldWidth = 0;
m_gWorldHeight = 0;
}
......@@ -380,13 +398,8 @@ void QTMovieWin::setSize(int width, int height)
void QTMovieWin::setVisible(bool b)
{
if (!m_private->m_height || !m_private->m_width)
b = false;
if (b && !m_private->m_gWorld)
m_private->createGWorld();
else if (!b && m_private->m_gWorld)
m_private->deleteGWorld();
m_private->m_visible = b;
m_private->updateGWorld();
}
void QTMovieWin::paint(HDC hdc, int x, int y)
......@@ -412,7 +425,8 @@ void QTMovieWin::load(const UChar* url, int len)
{
if (m_private->m_movie) {
m_private->endTask();
setVisible(false);
if (m_private->m_gWorld)
m_private->deleteGWorld();
DisposeMovie(m_private->m_movie);
m_private->m_movie = 0;
}
......@@ -538,14 +552,14 @@ bool QTMovieWin::initializeQuickTime()
OSErr result = InitializeQTML(0);
SInt32 version;
if (result == noErr)
result = Gestalt(gestaltQuickTime, &version);
if (result != noErr) {
LOG_ERROR("No QuickTime available. Disabling <video> and <audio> support.");
return false;
}
if (version < minimumQuickTimeVersion) {
LOG_ERROR("QuickTime version %x detected, at least %x required. Disabling <video> and <audio> support.", version, minimumQuickTimeVersion);
return false;
result = Gestalt(gestaltQuickTime, &version);
if (result != noErr) {
LOG_ERROR("No QuickTime available. Disabling <video> and <audio> support.");
return false;
}
if (version < minimumQuickTimeVersion) {
LOG_ERROR("QuickTime version %x detected, at least %x required. Disabling <video> and <audio> support.", version, minimumQuickTimeVersion);
return false;
}
EnterMovies();
setSharedTimerFiredFunction(taskTimerFired);
......
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