Reviewed by Eric Carlson.
REGRESSION (r72119): Audio never plays on Star Wars intro animation
https://bugs.webkit.org/show_bug.cgi?id=52467
Test the ability to read audio/m4a files. Disabled this new test
on the chromium and qt platforms, as they do not support M4A/AAC.
* media/audio-mpeg4-supported-expected.txt: Added.
* media/audio-mpeg4-supported.html: Added.
* media/content/silence.m4a: Added.
* platform/chromium/test_expectations.txt:
* platform/qt/Skipped:
2011-01-20 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
REGRESSION (r72119): Audio never plays on Star Wars intro animation
https://bugs.webkit.org/show_bug.cgi?id=52467
QuickTime's eat/m4a movie importer compontent doesn't list audio/m4a as a mime
type which it supports, though it handles .m4a files just fine. Change the way
we build the list of supported MIME Types through a new WebKitSystemInterface
function.
Caused by r72119, which adds system-specific extension->MIME entries to the cache
before global entries, and the system-specific entries include QuickTime's registry
entries which contain the audio/m4a MIME type, while its components do not.
Test: media/audio-mpeg4-supported.html
* WebCore.vcproj/QTMovieWinCommon.vsprops:
* platform/graphics/win/QTMovie.cpp:
(getMIMETypeCallBack):
(initializeSupportedTypes):
(QTMovie::countSupportedTypes): gSupportedTypes is now a CFArrayRef.
(QTMovie::getSupportedType): Ditto.
2011-01-24 Jer Noble <jer.noble@apple.com>
Reviewed by Eric Carlson.
REGRESSION (r72119): Audio never plays on Star Wars intro animation
https://bugs.webkit.org/show_bug.cgi?id=52467
Add wkGetQuickTimeMIMETypeList() function.
* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib/WebKitSystemInterface.lib:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76621
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-01-20 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ REGRESSION (r72119): Audio never plays on Star Wars intro animation
+ https://bugs.webkit.org/show_bug.cgi?id=52467
+
+ Test the ability to read audio/m4a files. Disabled this new test
+ on the chromium and qt platforms, as they do not support M4A/AAC.
+
+ * media/audio-mpeg4-supported-expected.txt: Added.
+ * media/audio-mpeg4-supported.html: Added.
+ * media/content/silence.m4a: Added.
+ * platform/chromium/test_expectations.txt:
+ * platform/qt/Skipped:
+
2011-01-25 Tony Chang <tony@chromium.org>
Unreviewed, rebaseline a test on chromium-win. Part of r76586 rebaselines.
--- /dev/null
+Test that the audio element supports M4A files.
+
+EVENT(canplaythrough)
+EXPECTED (mediaElement.currentTime == '0') OK
+EVENT(play)
+EXPECTED (mediaElement.currentTime > '0') OK
+END OF TEST
+
--- /dev/null
+<html>
+ <body>
+
+ <p>Test that the audio element supports M4A files.</p>
+
+ <audio controls></audio>
+
+ <script src=video-test.js></script>
+ <script>
+ var timeupdateEventCount = 0;
+ mediaElement = document.getElementsByTagName('audio')[0];
+
+ mediaElement.addEventListener('error', function() {
+ consoleWrite("<span style='color:red'>FAIL</span> : caught 'error' event, audio.error = " + mediaElement.error.code);
+ endTest();
+ });
+
+ mediaElement.addEventListener('canplaythrough', function() {
+ consoleWrite("EVENT(canplaythrough)");
+ testExpected("mediaElement.currentTime", 0);
+ mediaElement.play();
+ });
+
+ function timeupdate()
+ {
+ ++timeupdateEventCount;
+
+ // wait 2 timeupdate events so we are sure the media engine is
+ // playing the media.
+ if (timeupdateEventCount == 2) {
+ // make sure time is advancing
+ testExpected("mediaElement.currentTime", 0, '>');
+ // reset the counter to prevent infinite loop if the
+ // test is re-executed manually.
+ timeupdateEventCount = 0;
+ endTest();
+ }
+ }
+
+ mediaElement.addEventListener("timeupdate", timeupdate);
+ waitForEvent('play');
+
+ mediaElement.src = "content/silence.m4a";
+ </script>
+
+ </body>
+</html>
Test to make sure a <source> moved after the media element begins processing is handled correctly.
-Moving previous <source> element to end of list, it should be processed again.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was processed a second time. OK
-
-Moving current <source> element, it should be processed again.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was processed a second time. OK
-
-Moving next <source> element, it should be processed again.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was processed a second time. OK
-
-Moving current <source> element to beginning of list, it should not be processed again.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was not processed OK
-
-Moving next <source> element to beginning of list, it should never processed.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was not processed OK
-
-<span> inserted after current <source> element before it is removed, processing should proceed normally.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was not processed OK
-
-<span> inserted after next <source> element before it is removed, processing should proceed normally.
-EXPECTED ([object HTMLSourceElement] != 'null') OK
-<source> moved was not processed OK
-
-PASS
-
+not found in <source> list FAIL
END OF TEST
+CONSOLE MESSAGE: line 114: TypeError: 'null' is not an object (evaluating 'current.previousSibling')
1. Test that no usable <source> element leaves the media element with networkState == NETWORK_NO_SOURCE
++ ERROR, src = test.mp4, type = "audio/x-chicken-face"
BUGCR16779 WONTFIX SKIP : media/video-size-intrinsic-scale.html = FAIL TIMEOUT
BUGWK45102 WONTFIX SKIP : media/media-can-play-mpeg4-video.html = TEXT
BUGCR68289 WONTFIX SKIP : media/video-element-other-namespace-crash.html = TIMEOUT
+BUGCR16779 WONTFIX SKIP : media/audio-mpeg4-supported.html = FAIL TIMEOUT
// Chromium does not use the icon loader in WebCore for loading notifications.
WONTFIX SKIP : http/tests/notifications = FAIL
media/audio-delete-while-slider-thumb-clicked.html
media/audio-delete-while-step-button-clicked.html
media/audio-mpeg-supported.html
+media/audio-mpeg4-supported.html
media/audio-no-installed-engines.html
media/audio-play-event.html
media/before-load-member-access.html
-FAIL: Timed out waiting for notifyDone to be called
Test that audio element can use a data: url
EVENT(loadstart)
+EVENT(durationchange)
+EVENT(loadedmetadata)
+EVENT(loadeddata)
+EVENT(canplay)
+EVENT(canplaythrough)
+EXPECTED (mediaElement.duration.toFixed(2) == '2.94') OK
+END OF TEST
+2011-01-20 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ REGRESSION (r72119): Audio never plays on Star Wars intro animation
+ https://bugs.webkit.org/show_bug.cgi?id=52467
+
+ QuickTime's eat/m4a movie importer compontent doesn't list audio/m4a as a mime
+ type which it supports, though it handles .m4a files just fine. Change the way
+ we build the list of supported MIME Types through a new WebKitSystemInterface
+ function.
+
+ Caused by r72119, which adds system-specific extension->MIME entries to the cache
+ before global entries, and the system-specific entries include QuickTime's registry
+ entries which contain the audio/m4a MIME type, while its components do not.
+
+ Test: media/audio-mpeg4-supported.html
+
+ * WebCore.vcproj/QTMovieWinCommon.vsprops:
+ * platform/graphics/win/QTMovie.cpp:
+ (getMIMETypeCallBack):
+ (initializeSupportedTypes):
+ (QTMovie::countSupportedTypes): gSupportedTypes is now a CFArrayRef.
+ (QTMovie::getSupportedType): Ditto.
+
2011-01-25 Hans Wennborg <hans@chromium.org>
Reviewed by Jeremy Orlow.
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="QTMLClient.lib CVClient.lib JavaScriptCore$(WebKitDLLConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib Msimg32.lib user32.lib advapi32.lib"
+ AdditionalDependencies="QTMLClient.lib CVClient.lib JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitSystemInterface.lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib Msimg32.lib user32.lib advapi32.lib"
OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
AdditionalLibraryDirectories=""$(WebKitLibrariesDir)\QTInternalSDK\Libraries";"$(WebKitLibrariesDir)\QuickTime SDK\Libraries";"$(ProgramFiles)\QuickTime SDK\Libraries""
IgnoreDefaultLibraryNames="LIBCMT"
#include <Movies.h>
#include <QTML.h>
#include <QuickTimeComponents.h>
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
#include <wtf/Assertions.h>
#include <wtf/Noncopyable.h>
#include <wtf/Vector.h>
void* ptr;
};
-static Vector<CFStringRef>* gSupportedTypes = 0;
+static CFMutableArrayRef gSupportedTypes = 0;
static SInt32 quickTimeVersion = 0;
class QTMoviePrivate : public QTMovieTaskClient {
return GetMovieTimeScale(m_private->m_movie);
}
+static void getMIMETypeCallBack(const char* type);
+
static void initializeSupportedTypes()
{
if (gSupportedTypes)
return;
- gSupportedTypes = new Vector<CFStringRef>;
+ gSupportedTypes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
if (quickTimeVersion < minimumQuickTimeVersion) {
LOG_ERROR("QuickTime version %x detected, at least %x required. Returning empty list of supported media MIME types.", quickTimeVersion, minimumQuickTimeVersion);
return;
}
// QuickTime doesn't have an importer for video/quicktime. Add it manually.
- gSupportedTypes->append(CFSTR("video/quicktime"));
-
- for (int index = 0; index < 2; index++) {
- ComponentDescription findCD;
-
- // look at all movie importers that can import in place and are installed.
- findCD.componentType = MovieImportType;
- findCD.componentSubType = 0;
- findCD.componentManufacturer = 0;
- findCD.componentFlagsMask = cmpIsMissing | movieImportSubTypeIsFileExtension | canMovieImportInPlace | dontAutoFileMovieImport;
-
- // look at those registered by HFS file types the first time through, by file extension the second time
- findCD.componentFlags = canMovieImportInPlace | (index ? movieImportSubTypeIsFileExtension : 0);
-
- long componentCount = CountComponents(&findCD);
- if (!componentCount)
- continue;
+ CFArrayAppendValue(gSupportedTypes, CFSTR("video/quicktime"));
+
+ wkGetQuickTimeMIMETypeList(getMIMETypeCallBack);
+}
- Component comp = 0;
- while (comp = FindNextComponent(comp, &findCD)) {
- // Does this component have a MIME type container?
- ComponentDescription infoCD;
- OSErr err = GetComponentInfo(comp, &infoCD, nil /*name*/, nil /*info*/, nil /*icon*/);
- if (err)
- continue;
- if (!(infoCD.componentFlags & hasMovieImportMIMEList))
- continue;
- QTAtomContainer mimeList = 0;
- err = MovieImportGetMIMETypeList((ComponentInstance)comp, &mimeList);
- if (err || !mimeList)
- continue;
+static void getMIMETypeCallBack(const char* type)
+{
+ ASSERT(type);
+ CFStringRef cfType = CFStringCreateWithCString(kCFAllocatorDefault, type, kCFStringEncodingMacRoman);
+ if (!cfType)
+ return;
- // Grab every type from the container.
- QTLockContainer(mimeList);
- int typeCount = QTCountChildrenOfType(mimeList, kParentAtomIsContainer, kMimeInfoMimeTypeTag);
- for (int typeIndex = 1; typeIndex <= typeCount; typeIndex++) {
- QTAtom mimeTag = QTFindChildByIndex(mimeList, 0, kMimeInfoMimeTypeTag, typeIndex, 0);
- if (!mimeTag)
- continue;
- char* atomData;
- long typeLength;
- if (noErr != QTGetAtomDataPtr(mimeList, mimeTag, &typeLength, &atomData))
- continue;
-
- char typeBuffer[256];
- if (typeLength >= sizeof(typeBuffer))
- continue;
- memcpy(typeBuffer, atomData, typeLength);
- typeBuffer[typeLength] = 0;
-
- // Only add "audio/..." and "video/..." types.
- if (strncmp(typeBuffer, "audio/", 6) && strncmp(typeBuffer, "video/", 6))
- continue;
-
- CFStringRef cfMimeType = CFStringCreateWithCString(0, typeBuffer, kCFStringEncodingUTF8);
- if (!cfMimeType)
- continue;
-
- // Only add each type once.
- bool alreadyAdded = false;
- for (int addedIndex = 0; addedIndex < gSupportedTypes->size(); addedIndex++) {
- CFStringRef type = gSupportedTypes->at(addedIndex);
- if (kCFCompareEqualTo == CFStringCompare(cfMimeType, type, kCFCompareCaseInsensitive)) {
- alreadyAdded = true;
- break;
- }
- }
- if (!alreadyAdded)
- gSupportedTypes->append(cfMimeType);
- else
- CFRelease(cfMimeType);
- }
- DisposeHandle(mimeList);
- }
+ // Filter out all non-audio or -video MIME Types, and only add each type once:
+ if (CFStringHasPrefix(cfType, CFSTR("audio/")) || CFStringHasPrefix(cfType, CFSTR("video/"))) {
+ CFRange range = CFRangeMake(0, CFArrayGetCount(gSupportedTypes));
+ if (!CFArrayContainsValue(gSupportedTypes, range, cfType))
+ CFArrayAppendValue(gSupportedTypes, cfType);
}
+
+ CFRelease(cfType);
}
unsigned QTMovie::countSupportedTypes()
{
initializeSupportedTypes();
- return static_cast<unsigned>(gSupportedTypes->size());
+ return static_cast<unsigned>(CFArrayGetCount(gSupportedTypes));
}
void QTMovie::getSupportedType(unsigned index, const UChar*& str, unsigned& len)
{
initializeSupportedTypes();
- ASSERT(index < gSupportedTypes->size());
+ ASSERT(index < CFArrayGetCount(gSupportedTypes));
// Allocate sufficient buffer to hold any MIME type
static UniChar* staticBuffer = 0;
if (!staticBuffer)
staticBuffer = new UniChar[32];
- CFStringRef cfstr = gSupportedTypes->at(index);
+ CFStringRef cfstr = (CFStringRef)CFArrayGetValueAtIndex(gSupportedTypes, index);
len = CFStringGetLength(cfstr);
CFRange range = { 0, len };
CFStringGetCharacters(cfstr, range, staticBuffer);
+2011-01-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ REGRESSION (r72119): Audio never plays on Star Wars intro animation
+ https://bugs.webkit.org/show_bug.cgi?id=52467
+
+ Add wkGetQuickTimeMIMETypeList() function.
+
+ * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
+ * win/lib/WebKitSystemInterface.lib:
+
2011-01-18 Anders Carlsson <andersca@apple.com>
Reviewed by Darin Adler.
CFDictionaryRef wkCFURLResponseCreateSerializableRepresentation(CFURLResponseRef cfResponse, CFTypeRef tokenNull);
CFURLResponseRef wkCFURLResponseCreateFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
+typedef void (*wkQuickTimeMIMETypeCallBack)(const char* mimeType);
+void wkGetQuickTimeMIMETypeList(wkQuickTimeMIMETypeCallBack);
+
typedef enum {
WKMediaUIPartFullscreenButton = 0,
WKMediaUIPartMuteButton,