Title: [93459] trunk/Source/WebCore
Revision
93459
Author
[email protected]
Date
2011-08-19 17:41:58 -0700 (Fri, 19 Aug 2011)

Log Message

MediaPlayerPrivateAVFoundationCF should use AVCFURLAssetCopyAudiovisualMIMETypes() to get list of supported MIME types
https://bugs.webkit.org/show_bug.cgi?id=66612

Reviewed by Darin Adler.

No new tests, should be covered by existing media tests.

* platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Added AVCFURLAssetCopyAudiovisualMIMETypes().
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::mimeTypeCache): Use AVCFURLAssetCopyAudiovisualMIMETypes() to build the cache of supported MIME types.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93458 => 93459)


--- trunk/Source/WebCore/ChangeLog	2011-08-20 00:20:48 UTC (rev 93458)
+++ trunk/Source/WebCore/ChangeLog	2011-08-20 00:41:58 UTC (rev 93459)
@@ -1,3 +1,16 @@
+2011-08-19  Jeff Miller  <[email protected]>
+
+        MediaPlayerPrivateAVFoundationCF should use AVCFURLAssetCopyAudiovisualMIMETypes() to get list of supported MIME types
+        https://bugs.webkit.org/show_bug.cgi?id=66612
+
+        Reviewed by Darin Adler.
+
+        No new tests, should be covered by existing media tests.
+
+        * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Added AVCFURLAssetCopyAudiovisualMIMETypes().
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::mimeTypeCache): Use AVCFURLAssetCopyAudiovisualMIMETypes() to build the cache of supported MIME types.
+
 2011-08-19  Adrienne Walker  <[email protected]>
 
         [chromium] Regression: Fix clang errors from r93424

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h (93458 => 93459)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	2011-08-20 00:20:48 UTC (rev 93458)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h	2011-08-20 00:41:58 UTC (rev 93459)
@@ -171,6 +171,9 @@
 SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFPlayerSetVolume, void, __cdecl, (AVCFPlayerRef player, Float32 volume), (player, volume))
 #define AVCFPlayerSetVolume softLink_AVCFPlayerSetVolume
 
+SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFURLAssetCopyAudiovisualMIMETypes, CFArrayRef, __cdecl, (), ())
+#define AVCFURLAssetCopyAudiovisualMIMETypes softLink_AVCFURLAssetCopyAudiovisualMIMETypes
+
 SOFT_LINK_DLL_IMPORT(AVFoundationCF, AVCFURLAssetCreateWithURLAndOptions, AVCFURLAssetRef, __cdecl, (CFAllocatorRef allocator, CFURLRef URL, CFDictionaryRef options, dispatch_queue_t notificationQueue), (allocator, URL, options, notificationQueue))
 #define AVCFURLAssetCreateWithURLAndOptions softLink_AVCFURLAssetCreateWithURLAndOptions
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (93458 => 93459)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2011-08-20 00:20:48 UTC (rev 93458)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2011-08-20 00:41:58 UTC (rev 93459)
@@ -704,20 +704,16 @@
     if (typeListInitialized)
         return cache;
     typeListInitialized = true;
+    
+    RetainPtr<CFArrayRef> supportedTypes(AdoptCF, AVCFURLAssetCopyAudiovisualMIMETypes());
+    
+    ASSERT(supportedTypes);
+    if (!supportedTypes)
+        return cache;
 
-    // Not possible to query AVFoundation for supported MIME types, <rdar://problem/8721693>, so
-    // hard code some types for now.
-    cache.add("video/quicktime");
-    cache.add("video/mp4");
-    cache.add("video/mpeg");
-    cache.add("audio/3gpp");
-    cache.add("audio/mp3");
-    cache.add("audio/mp4");
-    cache.add("audio/mp4");
-    cache.add("audio/m4a");
-    cache.add("audio/aac");
-    cache.add("audio/wav");
-    cache.add("application/vnd.apple.mpegurl");
+    CFIndex typeCount = CFArrayGetCount(supportedTypes.get());
+    for (CFIndex i = 0; i < typeCount; i++)
+        cache.add(static_cast<CFStringRef>(CFArrayGetValueAtIndex(supportedTypes.get(), i)));
 
     return cache;
 } 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to