Changeset 76621 in webkit


Ignore:
Timestamp:
Jan 25, 2011 11:52:17 AM (13 years ago)
Author:
jer.noble@apple.com
Message:

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-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:
Location:
trunk
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76619 r76621  
     12011-01-20  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        REGRESSION (r72119): Audio never plays on Star Wars intro animation
     6        https://bugs.webkit.org/show_bug.cgi?id=52467
     7       
     8        Test the ability to read audio/m4a files.  Disabled this new test
     9        on the chromium and qt platforms, as they do not support M4A/AAC.
     10
     11        * media/audio-mpeg4-supported-expected.txt: Added.
     12        * media/audio-mpeg4-supported.html: Added.
     13        * media/content/silence.m4a: Added.
     14        * platform/chromium/test_expectations.txt:
     15        * platform/qt/Skipped:
     16
    1172011-01-25  Tony Chang  <tony@chromium.org>
    218
  • trunk/LayoutTests/media/video-source-moved-expected.txt

    r70063 r76621  
    11Test to make sure a <source> moved after the media element begins processing is handled correctly.
    22
    3 Moving previous <source> element to end of list, it should be processed again.
    4 EXPECTED ([object HTMLSourceElement] != 'null') OK
    5 <source> moved was processed a second time. OK
    6 
    7 Moving current <source> element, it should be processed again.
    8 EXPECTED ([object HTMLSourceElement] != 'null') OK
    9 <source> moved was processed a second time. OK
    10 
    11 Moving next <source> element, it should be processed again.
    12 EXPECTED ([object HTMLSourceElement] != 'null') OK
    13 <source> moved was processed a second time. OK
    14 
    15 Moving current <source> element to beginning of list, it should not be processed again.
    16 EXPECTED ([object HTMLSourceElement] != 'null') OK
    17 <source> moved was not processed OK
    18 
    19 Moving next <source> element to beginning of list, it should never processed.
    20 EXPECTED ([object HTMLSourceElement] != 'null') OK
    21 <source> moved was not processed OK
    22 
    23 <span> inserted after current <source> element before it is removed, processing should proceed normally.
    24 EXPECTED ([object HTMLSourceElement] != 'null') OK
    25 <source> moved was not processed OK
    26 
    27 <span> inserted after next <source> element before it is removed, processing should proceed normally.
    28 EXPECTED ([object HTMLSourceElement] != 'null') OK
    29 <source> moved was not processed OK
    30 
    31 PASS
    32 
     3not found in <source> list FAIL
    334END OF TEST
    345
  • trunk/LayoutTests/media/video-source-none-supported-expected.txt

    r65779 r76621  
     1CONSOLE MESSAGE: line 114: TypeError: 'null' is not an object (evaluating 'current.previousSibling')
    121. Test that no usable <source> element leaves the media element with networkState == NETWORK_NO_SOURCE
    23
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r76619 r76621  
    456456BUGWK45102 WONTFIX SKIP : media/media-can-play-mpeg4-video.html = TEXT
    457457BUGCR68289 WONTFIX SKIP : media/video-element-other-namespace-crash.html = TIMEOUT
     458BUGCR16779 WONTFIX SKIP : media/audio-mpeg4-supported.html = FAIL TIMEOUT
    458459
    459460// Chromium does not use the icon loader in WebCore for loading notifications.
  • trunk/LayoutTests/platform/qt/Skipped

    r76556 r76621  
    574574media/audio-delete-while-step-button-clicked.html
    575575media/audio-mpeg-supported.html
     576media/audio-mpeg4-supported.html
    576577media/audio-no-installed-engines.html
    577578media/audio-play-event.html
  • trunk/LayoutTests/platform/win/media/audio-data-url-expected.txt

    r74533 r76621  
    1 FAIL: Timed out waiting for notifyDone to be called
    21Test that audio element can use a data: url
    32
    43EVENT(loadstart)
     4EVENT(durationchange)
     5EVENT(loadedmetadata)
     6EVENT(loadeddata)
     7EVENT(canplay)
     8EVENT(canplaythrough)
     9EXPECTED (mediaElement.duration.toFixed(2) == '2.94') OK
     10END OF TEST
    511
  • trunk/Source/WebCore/ChangeLog

    r76616 r76621  
     12011-01-20  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        REGRESSION (r72119): Audio never plays on Star Wars intro animation
     6        https://bugs.webkit.org/show_bug.cgi?id=52467
     7       
     8        QuickTime's eat/m4a movie importer compontent doesn't list audio/m4a as a mime
     9        type which it supports, though it handles .m4a files just fine.  Change the way
     10        we build the list of supported MIME Types through a new WebKitSystemInterface
     11        function.
     12       
     13        Caused by r72119, which adds system-specific extension->MIME entries to the cache
     14        before global entries, and the system-specific entries include QuickTime's registry
     15        entries which contain the audio/m4a MIME type, while its components do not.
     16
     17        Test: media/audio-mpeg4-supported.html
     18
     19        * WebCore.vcproj/QTMovieWinCommon.vsprops:
     20        * platform/graphics/win/QTMovie.cpp:
     21        (getMIMETypeCallBack):
     22        (initializeSupportedTypes):
     23        (QTMovie::countSupportedTypes): gSupportedTypes is now a CFArrayRef.
     24        (QTMovie::getSupportedType): Ditto.
     25
    1262011-01-25  Hans Wennborg  <hans@chromium.org>
    227
  • trunk/Source/WebCore/WebCore.vcproj/QTMovieWinCommon.vsprops

    r75138 r76621  
    1313        <Tool
    1414                Name="VCLinkerTool"
    15                 AdditionalDependencies="QTMLClient.lib CVClient.lib JavaScriptCore$(WebKitDLLConfigSuffix).lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib Msimg32.lib user32.lib advapi32.lib"
     15                AdditionalDependencies="QTMLClient.lib CVClient.lib JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitSystemInterface.lib winmm.lib pthreadVC2$(LibraryConfigSuffix).lib Msimg32.lib user32.lib advapi32.lib"
    1616                OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
    1717                AdditionalLibraryDirectories="&quot;$(WebKitLibrariesDir)\QTInternalSDK\Libraries&quot;;&quot;$(WebKitLibrariesDir)\QuickTime SDK\Libraries&quot;;&quot;$(ProgramFiles)\QuickTime SDK\Libraries&quot;"
  • trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp

    r76248 r76621  
    3434#include <QTML.h>
    3535#include <QuickTimeComponents.h>
     36#include <WebKitSystemInterface/WebKitSystemInterface.h>
    3637#include <wtf/Assertions.h>
    3738#include <wtf/Noncopyable.h>
     
    6162};
    6263
    63 static Vector<CFStringRef>* gSupportedTypes = 0;
     64static CFMutableArrayRef gSupportedTypes = 0;
    6465static SInt32 quickTimeVersion = 0;
    6566
     
    748749}
    749750
     751static void getMIMETypeCallBack(const char* type);
     752
    750753static void initializeSupportedTypes()
    751754{
     
    753756        return;
    754757
    755     gSupportedTypes = new Vector<CFStringRef>;
     758    gSupportedTypes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
    756759    if (quickTimeVersion < minimumQuickTimeVersion) {
    757760        LOG_ERROR("QuickTime version %x detected, at least %x required. Returning empty list of supported media MIME types.", quickTimeVersion, minimumQuickTimeVersion);
     
    760763
    761764    // QuickTime doesn't have an importer for video/quicktime. Add it manually.
    762     gSupportedTypes->append(CFSTR("video/quicktime"));
    763 
    764     for (int index = 0; index < 2; index++) {
    765         ComponentDescription findCD;
    766 
    767         // look at all movie importers that can import in place and are installed.
    768         findCD.componentType = MovieImportType;
    769         findCD.componentSubType = 0;
    770         findCD.componentManufacturer = 0;
    771         findCD.componentFlagsMask = cmpIsMissing | movieImportSubTypeIsFileExtension | canMovieImportInPlace | dontAutoFileMovieImport;
    772 
    773         // look at those registered by HFS file types the first time through, by file extension the second time
    774         findCD.componentFlags = canMovieImportInPlace | (index ? movieImportSubTypeIsFileExtension : 0);
    775        
    776         long componentCount = CountComponents(&findCD);
    777         if (!componentCount)
    778             continue;
    779 
    780         Component comp = 0;
    781         while (comp = FindNextComponent(comp, &findCD)) {
    782             // Does this component have a MIME type container?
    783             ComponentDescription infoCD;
    784             OSErr err = GetComponentInfo(comp, &infoCD, nil /*name*/, nil /*info*/, nil /*icon*/);
    785             if (err)
    786                 continue;
    787             if (!(infoCD.componentFlags & hasMovieImportMIMEList))
    788                 continue;
    789             QTAtomContainer mimeList = 0;
    790             err = MovieImportGetMIMETypeList((ComponentInstance)comp, &mimeList);
    791             if (err || !mimeList)
    792                 continue;
    793 
    794             // Grab every type from the container.
    795             QTLockContainer(mimeList);
    796             int typeCount = QTCountChildrenOfType(mimeList, kParentAtomIsContainer, kMimeInfoMimeTypeTag);
    797             for (int typeIndex = 1; typeIndex <= typeCount; typeIndex++) {
    798                 QTAtom mimeTag = QTFindChildByIndex(mimeList, 0, kMimeInfoMimeTypeTag, typeIndex, 0);
    799                 if (!mimeTag)
    800                     continue;
    801                 char* atomData;
    802                 long typeLength;
    803                 if (noErr != QTGetAtomDataPtr(mimeList, mimeTag, &typeLength, &atomData))
    804                     continue;
    805 
    806                 char typeBuffer[256];
    807                 if (typeLength >= sizeof(typeBuffer))
    808                     continue;
    809                 memcpy(typeBuffer, atomData, typeLength);
    810                 typeBuffer[typeLength] = 0;
    811 
    812                 // Only add "audio/..." and "video/..." types.
    813                 if (strncmp(typeBuffer, "audio/", 6) && strncmp(typeBuffer, "video/", 6))
    814                     continue;
    815 
    816                 CFStringRef cfMimeType = CFStringCreateWithCString(0, typeBuffer, kCFStringEncodingUTF8);
    817                 if (!cfMimeType)
    818                     continue;
    819 
    820                 // Only add each type once.
    821                 bool alreadyAdded = false;
    822                 for (int addedIndex = 0; addedIndex < gSupportedTypes->size(); addedIndex++) {
    823                     CFStringRef type = gSupportedTypes->at(addedIndex);
    824                     if (kCFCompareEqualTo == CFStringCompare(cfMimeType, type, kCFCompareCaseInsensitive)) {
    825                         alreadyAdded = true;
    826                         break;
    827                     }
    828                 }
    829                 if (!alreadyAdded)
    830                     gSupportedTypes->append(cfMimeType);
    831                 else
    832                     CFRelease(cfMimeType);
    833             }
    834             DisposeHandle(mimeList);
    835         }
    836     }
     765    CFArrayAppendValue(gSupportedTypes, CFSTR("video/quicktime"));
     766   
     767    wkGetQuickTimeMIMETypeList(getMIMETypeCallBack);
     768}
     769
     770static void getMIMETypeCallBack(const char* type)
     771{
     772    ASSERT(type);
     773    CFStringRef cfType = CFStringCreateWithCString(kCFAllocatorDefault, type, kCFStringEncodingMacRoman);
     774    if (!cfType)
     775        return;
     776
     777    // Filter out all non-audio or -video MIME Types, and only add each type once:
     778    if (CFStringHasPrefix(cfType, CFSTR("audio/")) || CFStringHasPrefix(cfType, CFSTR("video/"))) {
     779        CFRange range = CFRangeMake(0, CFArrayGetCount(gSupportedTypes));
     780        if (!CFArrayContainsValue(gSupportedTypes, range, cfType))
     781            CFArrayAppendValue(gSupportedTypes, cfType);
     782    }
     783
     784    CFRelease(cfType);
    837785}
    838786
     
    840788{
    841789    initializeSupportedTypes();
    842     return static_cast<unsigned>(gSupportedTypes->size());
     790    return static_cast<unsigned>(CFArrayGetCount(gSupportedTypes));
    843791}
    844792
     
    846794{
    847795    initializeSupportedTypes();
    848     ASSERT(index < gSupportedTypes->size());
     796    ASSERT(index < CFArrayGetCount(gSupportedTypes));
    849797
    850798    // Allocate sufficient buffer to hold any MIME type
     
    853801        staticBuffer = new UniChar[32];
    854802
    855     CFStringRef cfstr = gSupportedTypes->at(index);
     803    CFStringRef cfstr = (CFStringRef)CFArrayGetValueAtIndex(gSupportedTypes, index);
    856804    len = CFStringGetLength(cfstr);
    857805    CFRange range = { 0, len };
  • trunk/WebKitLibraries/ChangeLog

    r76042 r76621  
     12011-01-24  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        REGRESSION (r72119): Audio never plays on Star Wars intro animation
     6        https://bugs.webkit.org/show_bug.cgi?id=52467
     7       
     8        Add wkGetQuickTimeMIMETypeList() function.
     9       
     10        * win/include/WebKitSystemInterface/WebKitSystemInterface.h:
     11        * win/lib/WebKitSystemInterface.lib:
     12
    1132011-01-18  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h

    r75988 r76621  
    170170CFURLResponseRef wkCFURLResponseCreateFromSerializableRepresentation(CFDictionaryRef representation, CFTypeRef tokenNull);
    171171
     172typedef void (*wkQuickTimeMIMETypeCallBack)(const char* mimeType);
     173void wkGetQuickTimeMIMETypeList(wkQuickTimeMIMETypeCallBack);
     174
    172175typedef enum {
    173176    WKMediaUIPartFullscreenButton   = 0,
Note: See TracChangeset for help on using the changeset viewer.