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

        Reviewed by Adam Roben.
        
        https://bugs.webkit.org/show_bug.cgi?id=25545
        Bug 25545: HTMLMediaElement: display anamorphic video correctly
        
        Tell QuickTime to use clean aperture mode so movies with non-square pixels are sized
        and displayed correctly.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::createQTMovie): Ask QuickTime to use clean aperture mode.
        * platform/graphics/win/QTMovieWin.cpp:
        (QTMovieWin::load): Ditto. Add ASSERT to ensure that static movie property array isn't 
        filled beyond capacity.

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

        Reviewed by Adam Roben.

        https://bugs.webkit.org/show_bug.cgi?id=25545
        Bug 25545: HTMLMediaElement: display anamorphic video correctly
        
        Added 720x576i PAL anamorphic movie, extended video-size-intrinsic-scale
        test to check that it is sized correctly.

        * media/content/720x576i-anamorphic.mov: Added.
        * media/video-size-intrinsic-scale-expected.txt:
        * media/video-size-intrinsic-scale.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 67840e29
2009-05-04 Eric Carlson <eric.carlson@apple.com>
Reviewed by Adam Roben.
https://bugs.webkit.org/show_bug.cgi?id=25545
Bug 25545: HTMLMediaElement: display anamorphic video correctly
Added 720x576i PAL anamorphic movie, extended video-size-intrinsic-scale
test to check that it is sized correctly.
* media/content/720x576i-anamorphic.mov: Added.
* media/video-size-intrinsic-scale-expected.txt:
* media/video-size-intrinsic-scale.html:
2009-05-03 Eric Seidel <eric@webkit.org>
No review, just adding missing results.
Test that a movie saved with a non identity matrix is sized correctly when opened
Test size before movie is open:
EXPECTED (video.videoWidth == '0') OK
EXPECTED (video.videoHeight == '0') OK
Loading "content/scaled-matrix.mov". Movie saved with a non identity matrix.
EVENT(loadstart)
EVENT(durationchange)
EVENT(loadedmetadata)
Test size after movie is open:
EXPECTED (video.videoWidth == '640') OK
EXPECTED (video.videoHeight == '480') OK
Loading "content/720x576i-anamorphic.mov". Movie encoded with PAL non-square pixels and clean aperture dimenstions corrects pixel aspect ratio.
EVENT(loadstart)
EVENT(durationchange)
EVENT(loadedmetadata)
EXPECTED (video.videoWidth == '1024') OK
EXPECTED (video.videoHeight == '576') OK
END OF TEST
......@@ -5,38 +5,77 @@
<script src=video-test.js></script>
<script>
var movieInfo =
{
current:0,
movies:
[
{
url:"content/scaled-matrix.mov",
description:"saved with a non identity matrix",
width:640,
height:480
},
{
url:"content/720x576i-anamorphic.mov",
description:"Movie encoded with PAL non-square pixels, clean aperture corrects pixel aspect ratio when displayed",
width:1024,
height:576
},
]
};
function testSize()
{
var movie = movieInfo.movies[movieInfo.current];
testExpected("video.videoWidth", movie.width);
testExpected("video.videoHeight", movie.height);
movieInfo.current++;
openNextMovie();
}
function openNextMovie()
{
consoleWrite("");
if (movieInfo.current >= movieInfo.movies.length)
{
endTest();
return;
}
var url = movieInfo.movies[movieInfo.current].url;
video.src = url;
var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" +
". Movie " + movieInfo.movies[movieInfo.current].description + ".</em>";
consoleWrite(desc);
if (movieInfo.current > 0)
video.load();
}
function start()
{
findMediaElement();
waitForEvent("error");
waitForEvent("loadstart");
waitForEvent("ratechange");
waitForEvent("waiting");
waitForEvent("ratechange");
waitForEvent("durationchange");
waitForEvent("loadeddata");
waitForEvent("canplay");
waitForEvent("canplaythrough");
waitForEvent("pause");
waitForEvent("play");
waitForEvent("playing");
waitForEvent('loadedmetadata', function () {
consoleWrite("");
consoleWrite("<b>Test size after movie is open:</b>");
testExpected("video.videoWidth", 640);
testExpected("video.videoHeight", 480);
endTest();
} );
waitForEvent('loadedmetadata', testSize);
consoleWrite("<b>Test size before movie is open:</b>");
testExpected("video.videoWidth", 0, "==");
testExpected("video.videoHeight", 0, "==");
consoleWrite("");
video.src = "content/scaled-matrix.mov";
openNextMovie();
}
</script>
</head>
......@@ -45,8 +84,5 @@
<video controls></video>
<p>Test that a movie saved with a non identity matrix is sized correctly
when opened</p>
</body>
</html>
2009-05-04 Eric Carlson <eric.carlson@apple.com>
Reviewed by Adam Roben.
https://bugs.webkit.org/show_bug.cgi?id=25545
Bug 25545: HTMLMediaElement: display anamorphic video correctly
Tell QuickTime to use clean aperture mode so movies with non-square pixels are sized
and displayed correctly.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::createQTMovie): Ask QuickTime to use clean aperture mode.
* platform/graphics/win/QTMovieWin.cpp:
(QTMovieWin::load): Ditto. Add ASSERT to ensure that static movie property array isn't
filled beyond capacity.
2009-05-03 Mark Rowe <mrowe@apple.com>
Reviewed by Darin Adler.
......@@ -92,6 +92,10 @@ SOFT_LINK_POINTER(QTKit, QTMovieURLAttribute, NSString *)
SOFT_LINK_POINTER(QTKit, QTMovieVolumeDidChangeNotification, NSString *)
SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoCrossSiteAttribute, NSString *)
SOFT_LINK_POINTER(QTKit, QTVideoRendererWebKitOnlyNewImageAvailableNotification, NSString *)
#ifndef BUILDING_ON_TIGER
SOFT_LINK_POINTER(QTKit, QTMovieApertureModeClean, NSString *)
SOFT_LINK_POINTER(QTKit, QTMovieApertureModeAttribute, NSString *)
#endif
#define QTMovie getQTMovieClass()
#define QTMovieView getQTMovieViewClass()
......@@ -121,6 +125,10 @@ SOFT_LINK_POINTER(QTKit, QTVideoRendererWebKitOnlyNewImageAvailableNotification,
#define QTMovieVolumeDidChangeNotification getQTMovieVolumeDidChangeNotification()
#define QTSecurityPolicyNoCrossSiteAttribute getQTSecurityPolicyNoCrossSiteAttribute()
#define QTVideoRendererWebKitOnlyNewImageAvailableNotification getQTVideoRendererWebKitOnlyNewImageAvailableNotification()
#ifndef BUILDING_ON_TIGER
#define QTMovieApertureModeClean getQTMovieApertureModeClean()
#define QTMovieApertureModeAttribute getQTMovieApertureModeAttribute()
#endif
// Older versions of the QTKit header don't have these constants.
#if !defined QTKIT_VERSION_MAX_ALLOWED || QTKIT_VERSION_MAX_ALLOWED <= QTKIT_VERSION_7_0
......@@ -229,6 +237,9 @@ void MediaPlayerPrivate::createQTMovie(const String& url)
[NSNumber numberWithBool:YES], QTSecurityPolicyNoCrossSiteAttribute,
[NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute,
[NSNumber numberWithBool:YES], @"QTMovieOpenForPlaybackAttribute", // FIXME: Use defined attribute when required version of QT supports this attribute
#ifndef BUILDING_ON_TIGER
QTMovieApertureModeClean, QTMovieApertureModeAttribute,
#endif
nil];
NSError *error = nil;
......
......@@ -641,6 +641,7 @@ void QTMovieWin::load(const UChar* url, int len)
movieProps[moviePropCount].propStatus = 0;
moviePropCount++;
ASSERT(moviePropCount <= sizeof(movieProps)/sizeof(movieProps[0]));
m_private->m_loadError = NewMovieFromProperties(moviePropCount, movieProps, 0, NULL, &m_private->m_movie);
CFRelease(urlRef);
......@@ -649,8 +650,16 @@ end:
// get the load fail callback quickly
if (m_private->m_loadError)
updateTaskTimer(0);
else
else {
OSType mode = kQTApertureMode_CleanAperture;
// Set the aperture mode property on a movie to signal that we want aspect ratio
// and clean aperture dimensions. Don't worry about errors, we can't do anything if
// the installed version of QT doesn't support it and it isn't serious enough to
// warrant failing.
QTSetMovieProperty(m_private->m_movie, kQTPropertyClass_Visual, kQTVisualPropertyID_ApertureMode, sizeof(mode), &mode);
m_private->registerDrawingCallback();
}
CFRelease(urlStringRef);
}
......
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