Add url to supportsType
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 20:28:26 +0000 (20:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 20:28:26 +0000 (20:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89514

Patch by Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk> on 2012-06-22
Reviewed by Eric Carlson.

No new tests since there's no change on code behavior.

When a blob is created as the address for a Media Stream, the MediaEngine
will ask it's players if they support that media. However, a player built
for MediaStream needs to know to URL to decide if it's supported or not.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType):
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(MediaPlayerFactory):
(WebCore::MediaPlayerFactory::MediaPlayerFactory):
(WebCore):
(WebCore::textPlain):
(WebCore::bestMediaEngineForTypeAndCodecs):
(WebCore::MediaPlayer::load):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::paint):
(WebCore::MediaPlayer::supportsType):
* platform/graphics/MediaPlayer.h:
(WebCore):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
(MediaPlayerPrivateAVFoundationCF):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(MediaPlayerPrivateAVFoundationObjC):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::MediaPlayerPrivate::supportsType):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
(MediaPlayerPrivate):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(MediaPlayerPrivateGStreamer):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
(MediaPlayerPrivateQTKit):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::supportsType):
* platform/graphics/qt/MediaPlayerPrivateQt.cpp:
(WebCore::MediaPlayerPrivateQt::supportsType):
* platform/graphics/qt/MediaPlayerPrivateQt.h:
(MediaPlayerPrivateQt):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::supportsType):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
(MediaPlayerPrivateQuickTimeVisualContext):
* platform/graphics/wince/MediaPlayerPrivateWinCE.h:
(MediaPlayerPrivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/DOMImplementation.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp
Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h

index ae92bd9..1978742 100644 (file)
@@ -1,3 +1,64 @@
+2012-06-22  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
+
+        Add url to supportsType
+        https://bugs.webkit.org/show_bug.cgi?id=89514
+
+        Reviewed by Eric Carlson.
+
+        No new tests since there's no change on code behavior.
+
+        When a blob is created as the address for a Media Stream, the MediaEngine
+        will ask it's players if they support that media. However, a player built
+        for MediaStream needs to know to URL to decide if it's supported or not.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::canPlayType):
+        (WebCore::HTMLMediaElement::selectNextSourceChild):
+        * html/HTMLMediaElement.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (MediaPlayerFactory):
+        (WebCore::MediaPlayerFactory::MediaPlayerFactory):
+        (WebCore):
+        (WebCore::textPlain):
+        (WebCore::bestMediaEngineForTypeAndCodecs):
+        (WebCore::MediaPlayer::load):
+        (WebCore::MediaPlayer::loadWithNextMediaEngine):
+        (WebCore::MediaPlayer::paint):
+        (WebCore::MediaPlayer::supportsType):
+        * platform/graphics/MediaPlayer.h:
+        (WebCore):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+        (MediaPlayerPrivateAVFoundationCF):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        (MediaPlayerPrivateAVFoundationObjC):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
+        * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+        (WebCore::MediaPlayerPrivate::supportsType):
+        * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
+        (MediaPlayerPrivate):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        (MediaPlayerPrivateGStreamer):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        (MediaPlayerPrivateQTKit):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::supportsType):
+        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
+        (WebCore::MediaPlayerPrivateQt::supportsType):
+        * platform/graphics/qt/MediaPlayerPrivateQt.h:
+        (MediaPlayerPrivateQt):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::supportsType):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
+        (MediaPlayerPrivateQuickTimeVisualContext):
+        * platform/graphics/wince/MediaPlayerPrivateWinCE.h:
+        (MediaPlayerPrivate):
+
 2012-06-22  Joshua Netterfield  <jnetterfield@rim.com>
 
         [BlackBerry] Sanitize GLSL code using ANGLE.
index 3fafe19..3bbf9b6 100644 (file)
@@ -410,7 +410,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
      // Check to see if the type can be played by our MediaPlayer, if so create a MediaDocument
     // Key system is not applicable here.
     DOMImplementationSupportsTypeClient client(frame && frame->settings() && frame->settings()->needsSiteSpecificQuirks(), url.host());
-    if (MediaPlayer::supportsType(ContentType(type), String(), &client))
+    if (MediaPlayer::supportsType(ContentType(type), String(), url, &client))
          return MediaDocument::create(frame, url);
 #endif
 
index c4accad..bcc87fe 100644 (file)
@@ -615,9 +615,9 @@ HTMLMediaElement::NetworkState HTMLMediaElement::networkState() const
     return m_networkState;
 }
 
-String HTMLMediaElement::canPlayType(const String& mimeType, const String& keySystem) const
+String HTMLMediaElement::canPlayType(const String& mimeType, const String& keySystem, const KURL& url) const
 {
-    MediaPlayer::SupportsType support = MediaPlayer::supportsType(ContentType(mimeType), keySystem, this);
+    MediaPlayer::SupportsType support = MediaPlayer::supportsType(ContentType(mimeType), keySystem, url, this);
     String canPlay;
 
     // 4.8.10.3
@@ -634,7 +634,7 @@ String HTMLMediaElement::canPlayType(const String& mimeType, const String& keySy
             break;
     }
     
-    LOG(Media, "HTMLMediaElement::canPlayType(%s, %s) -> %s", mimeType.utf8().data(), keySystem.utf8().data(), canPlay.utf8().data());
+    LOG(Media, "HTMLMediaElement::canPlayType(%s, %s, %s) -> %s", mimeType.utf8().data(), keySystem.utf8().data(), url.string().utf8().data(), canPlay.utf8().data());
 
     return canPlay;
 }
@@ -3174,7 +3174,7 @@ KURL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* k
             if (shouldLog)
                 LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'type' is '%s' - key system is '%s'", type.utf8().data(), system.utf8().data());
 #endif
-            if (!MediaPlayer::supportsType(ContentType(type), system, this))
+            if (!MediaPlayer::supportsType(ContentType(type), system, mediaURL, this))
                 goto check_again;
         }
 
index 1673e15..4015a2f 100644 (file)
@@ -128,7 +128,7 @@ public:
 
     PassRefPtr<TimeRanges> buffered() const;
     void load(ExceptionCode&);
-    String canPlayType(const String& mimeType, const String& keySystem = String()) const;
+    String canPlayType(const String& mimeType, const String& keySystem = String(), const KURL& = KURL()) const;
 
 // ready state
     ReadyState readyState() const;
index 7d845ac..73aacd4 100644 (file)
@@ -176,15 +176,14 @@ struct MediaPlayerFactory {
     WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED;
 public:
     MediaPlayerFactory(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs,
-        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite) 
+        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite)
         : constructor(constructor)
         , getSupportedTypes(getSupportedTypes)
         , supportsTypeAndCodecs(supportsTypeAndCodecs)
         , getSitesInMediaCache(getSitesInMediaCache)
         , clearMediaCache(clearMediaCache)
         , clearMediaCacheForSite(clearMediaCacheForSite)
-
-    { 
+    {
     }
 
     CreateMediaEnginePlayer constructor;
@@ -196,7 +195,8 @@ public:
 };
 
 static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite);
-static MediaPlayerFactory* bestMediaEngineForTypeAndCodecs(const String& type, const String& codecs, const String& keySystem, MediaPlayerFactory* current = 0);
+
+static MediaPlayerFactory* bestMediaEngineForTypeAndCodecs(const String& type, const String& codecs, const String& keySystem, const KURL&, MediaPlayerFactory* current = 0);
 static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current);
 
 static Vector<MediaPlayerFactory*>& installedMediaEngines() 
@@ -253,7 +253,7 @@ static const AtomicString& codecs()
     return codecs;
 }
 
-static MediaPlayerFactory* bestMediaEngineForTypeAndCodecs(const String& type, const String& codecs, const String& keySystem, MediaPlayerFactory* current)
+static MediaPlayerFactory* bestMediaEngineForTypeAndCodecs(const String& type, const String& codecs, const String& keySystem, const KURL& url, MediaPlayerFactory* current)
 {
     if (type.isEmpty())
         return 0;
@@ -280,11 +280,11 @@ static MediaPlayerFactory* bestMediaEngineForTypeAndCodecs(const String& type, c
             continue;
         }
 #if ENABLE(ENCRYPTED_MEDIA)
-        MediaPlayer::SupportsType engineSupport = engines[ndx]->supportsTypeAndCodecs(type, codecs, keySystem);
+        MediaPlayer::SupportsType engineSupport = engines[ndx]->supportsTypeAndCodecs(type, codecs, keySystem, url);
 #else
         UNUSED_PARAM(keySystem);
         ASSERT(keySystem.isEmpty());
-        MediaPlayer::SupportsType engineSupport = engines[ndx]->supportsTypeAndCodecs(type, codecs);
+        MediaPlayer::SupportsType engineSupport = engines[ndx]->supportsTypeAndCodecs(type, codecs, url);
 #endif
         if (engineSupport > supported) {
             supported = engineSupport;
@@ -352,14 +352,14 @@ bool MediaPlayer::load(const KURL& url, const ContentType& contentType, const St
 {
     m_contentMIMEType = contentType.type().lower();
     m_contentTypeCodecs = contentType.parameter(codecs());
-    m_url = url.string();
+    m_url = url;
     m_keySystem = keySystem.lower();
     m_contentMIMETypeWasInferredFromExtension = false;
 
     // If the MIME type is missing or is not meaningful, try to figure it out from the URL.
     if (m_contentMIMEType.isEmpty() || m_contentMIMEType == applicationOctetStream() || m_contentMIMEType == textPlain()) {
-        if (protocolIs(m_url, "data"))
-            m_contentMIMEType = mimeTypeFromDataURL(m_url);
+        if (protocolIs(m_url.string(), "data"))
+            m_contentMIMEType = mimeTypeFromDataURL(m_url.string());
         else {
             String lastPathComponent = url.lastPathComponent();
             size_t pos = lastPathComponent.reverseFind('.');
@@ -383,7 +383,7 @@ void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current)
     MediaPlayerFactory* engine = 0;
 
     if (!m_contentMIMEType.isEmpty())
-        engine = bestMediaEngineForTypeAndCodecs(m_contentMIMEType, m_contentTypeCodecs, m_keySystem, current);
+        engine = bestMediaEngineForTypeAndCodecs(m_contentMIMEType, m_contentTypeCodecs, m_keySystem, m_url, current);
 
     // If no MIME type is specified or the type was inferred from the file extension, just use the next engine.
     if (!engine && (m_contentMIMEType.isEmpty() || m_contentMIMETypeWasInferredFromExtension))
@@ -410,7 +410,7 @@ void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current)
     }
 
     if (m_private)
-        m_private->load(m_url);
+        m_private->load(m_url.string());
     else {
         m_private = createNullMediaPlayer(this);
         if (m_mediaPlayerClient) {
@@ -418,7 +418,7 @@ void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current)
             m_mediaPlayerClient->mediaPlayerResourceNotSupported(this);
         }
     }
-}    
+}
 
 bool MediaPlayer::hasAvailableVideoFrame() const
 {
@@ -724,7 +724,7 @@ void MediaPlayer::paintCurrentFrameInContext(GraphicsContext* p, const IntRect&
     m_private->paintCurrentFrameInContext(p, r);
 }
 
-MediaPlayer::SupportsType MediaPlayer::supportsType(const ContentType& contentType, const String& keySystem, const MediaPlayerSupportsTypeClient* client)
+MediaPlayer::SupportsType MediaPlayer::supportsType(const ContentType& contentType, const String& keySystem, const KURL& url, const MediaPlayerSupportsTypeClient* client)
 {
     String type = contentType.type().lower();
     // The codecs string is not lower-cased because MP4 values are case sensitive
@@ -737,7 +737,7 @@ MediaPlayer::SupportsType MediaPlayer::supportsType(const ContentType& contentTy
     if (type == applicationOctetStream())
         return IsNotSupported;
 
-    MediaPlayerFactory* engine = bestMediaEngineForTypeAndCodecs(type, typeCodecs, system);
+    MediaPlayerFactory* engine = bestMediaEngineForTypeAndCodecs(type, typeCodecs, system, url);
     if (!engine)
         return IsNotSupported;
 
@@ -757,10 +757,10 @@ MediaPlayer::SupportsType MediaPlayer::supportsType(const ContentType& contentTy
 #endif
 
 #if ENABLE(ENCRYPTED_MEDIA)
-    return engine->supportsTypeAndCodecs(type, typeCodecs, system);
+    return engine->supportsTypeAndCodecs(type, typeCodecs, system, url);
 #else
     ASSERT(system.isEmpty());
-    return engine->supportsTypeAndCodecs(type, typeCodecs);
+    return engine->supportsTypeAndCodecs(type, typeCodecs, url);
 #endif
 }
 
@@ -942,7 +942,7 @@ void MediaPlayer::networkStateChanged()
     if (m_private->networkState() >= FormatError
         && m_private->readyState() < HaveMetadata
         && installedMediaEngines().size() > 1) {
-        if (m_contentMIMEType.isEmpty() || bestMediaEngineForTypeAndCodecs(m_contentMIMEType, m_contentTypeCodecs, m_keySystem, m_currentMediaEngine)) {
+        if (m_contentMIMEType.isEmpty() || bestMediaEngineForTypeAndCodecs(m_contentMIMEType, m_contentTypeCodecs, m_keySystem, m_url, m_currentMediaEngine)) {
             m_reloadTimer.startOneShot(0);
             return;
         }
index 3fdfcce..8eb7285 100644 (file)
@@ -203,7 +203,7 @@ public:
 
     // Media engine support.
     enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
-    static MediaPlayer::SupportsType supportsType(const ContentType&, const String& keySystem, const MediaPlayerSupportsTypeClient*);
+    static MediaPlayer::SupportsType supportsType(const ContentType&, const String& keySystem, const KURL&, const MediaPlayerSupportsTypeClient*);
     static void getSupportedTypes(HashSet<String>&);
     static bool isAvailable();
     static void getSitesInMediaCache(Vector<String>&);
@@ -401,7 +401,7 @@ private:
     Timer<MediaPlayer> m_reloadTimer;
     OwnPtr<MediaPlayerPrivateInterface> m_private;
     MediaPlayerFactory* m_currentMediaEngine;
-    String m_url;
+    KURL m_url;
     String m_contentMIMEType;
     String m_contentTypeCodecs;
     String m_keySystem;
@@ -424,17 +424,16 @@ private:
 typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
 typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
 #if ENABLE(ENCRYPTED_MEDIA)
-typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs, const String& keySystem);
+typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs, const String& keySystem, const KURL& url);
 #else
-typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs);
+typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs, const KURL& url);
 #endif
 typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
 typedef void (*MediaEngineClearMediaCache)();
 typedef void (*MediaEngineClearMediaCacheForSite)(const String&);
 
-typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, 
-    MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite); 
-
+typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType,
+    MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite);
 
 }
 
index 875d12d..a9f39a4 100644 (file)
@@ -725,7 +725,7 @@ void MediaPlayerPrivateAVFoundationCF::getSupportedTypes(HashSet<String>& suppor
     supportedTypes = mimeTypeCache();
 } 
 
-MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationCF::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationCF::supportsType(const String& type, const String& codecs, const KURL&)
 {
     // Only return "IsSupported" if there is no codecs parameter for now as there is no way to ask if it supports an
     // extended MIME type until rdar://8721715 is fixed.
index f5dd001..81a9bc6 100644 (file)
@@ -46,7 +46,7 @@ private:
     // Engine support
     static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
     static void getSupportedTypes(HashSet<String>& types);
-    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
     static bool isAvailable();
 
     virtual void cancelLoad();
index dcc046d..e5cfcb4 100644 (file)
@@ -60,7 +60,7 @@ private:
     // engine support
     static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
     static void getSupportedTypes(HashSet<String>& types);
-    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
     static bool isAvailable();
 
     virtual void cancelLoad();
index 0c97c42..a26141d 100644 (file)
@@ -670,7 +670,7 @@ void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String>& supp
     supportedTypes = mimeTypeCache();
 } 
 
-MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationObjC::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationObjC::supportsType(const String& type, const String& codecs, const KURL&)
 {
     if (!mimeTypeCache().contains(type))
         return MediaPlayer::IsNotSupported;
index 2d008b6..781dfc5 100644 (file)
@@ -72,7 +72,7 @@ void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types)
         types.add(i->c_str());
 }
 
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs, const KURL&)
 {
     if (type.isNull() || type.isEmpty()) {
         LOG(Media, "MediaPlayer does not support type; type is null or empty.");
index 19b654c..589749c 100644 (file)
@@ -39,7 +39,7 @@ public:
     static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
     static void registerMediaEngine(MediaEngineRegistrar);
     static void getSupportedTypes(HashSet<String>&);
-    static MediaPlayer::SupportsType supportsType(const String&, const String&);
+    static MediaPlayer::SupportsType supportsType(const String&, const String&, const KURL&);
     static void notifyAppActivatedEvent(bool);
     static void setCertificatePath(const String&);
 
index 05b78b0..d285448 100644 (file)
@@ -1586,7 +1586,7 @@ void MediaPlayerPrivateGStreamer::getSupportedTypes(HashSet<String>& types)
     types = mimeTypeCache();
 }
 
-MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const String& type, const String& codecs, const KURL&)
 {
     if (type.isNull() || type.isEmpty())
         return MediaPlayer::IsNotSupported;
index 4a056a2..506942c 100644 (file)
@@ -130,7 +130,8 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
             static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
 
             static void getSupportedTypes(HashSet<String>&);
-            static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+            static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
+
             static bool isAvailable();
 
             void updateAudioSink();
index 20c855f..d38265f 100644 (file)
@@ -75,7 +75,7 @@ private:
     // engine support
     static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
     static void getSupportedTypes(HashSet<String>& types);
-    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
     static void getSitesInMediaCache(Vector<String>&);
     static void clearMediaCache();
     static void clearMediaCacheForSite(const String&);
index 32f344c..cd161a3 100644 (file)
@@ -1501,7 +1501,7 @@ void MediaPlayerPrivateQTKit::getSupportedTypes(HashSet<String>& supportedTypes)
         supportedTypes.add(*it);
 } 
 
-MediaPlayer::SupportsType MediaPlayerPrivateQTKit::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivateQTKit::supportsType(const String& type, const String& codecs, const KURL&)
 {
     // Only return "IsSupported" if there is no codecs parameter for now as there is no way to ask QT if it supports an
     // extended MIME type yet.
index 3a307cb..794bc10 100644 (file)
@@ -81,7 +81,7 @@ void MediaPlayerPrivateQt::getSupportedTypes(HashSet<String> &supported)
     }
 }
 
-MediaPlayer::SupportsType MediaPlayerPrivateQt::supportsType(const String& mime, const String& codec)
+MediaPlayer::SupportsType MediaPlayerPrivateQt::supportsType(const String& mime, const String& codec, const KURL&)
 {
     if (!mime.startsWith("audio/") && !mime.startsWith("video/"))
         return MediaPlayer::IsNotSupported;
index c6fcbd8..a129e5d 100644 (file)
@@ -51,7 +51,7 @@ public:
 
     static void registerMediaEngine(MediaEngineRegistrar);
     static void getSupportedTypes(HashSet<String>&);
-    static MediaPlayer::SupportsType supportsType(const String&, const String&);
+    static MediaPlayer::SupportsType supportsType(const String&, const String&, const KURL&);
     static bool isAvailable() { return true; }
 
     bool hasVideo() const;
index 1304963..c33cce5 100644 (file)
@@ -1011,7 +1011,7 @@ bool MediaPlayerPrivateQuickTimeVisualContext::isAvailable()
     return QTMovie::initializeQuickTime();
 }
 
-MediaPlayer::SupportsType MediaPlayerPrivateQuickTimeVisualContext::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivateQuickTimeVisualContext::supportsType(const String& type, const String& codecs, const KURL&)
 {
     // only return "IsSupported" if there is no codecs parameter for now as there is no way to ask QT if it supports an
     //  extended MIME type
index 4c44af4..eb52ef6 100644 (file)
@@ -128,7 +128,7 @@ private:
     // engine support
     static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
     static void getSupportedTypes(HashSet<String>& types);
-    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
     static bool isAvailable();
 
 #if USE(ACCELERATED_COMPOSITING)
index 0faa045..ab4ec4d 100644 (file)
@@ -100,7 +100,7 @@ namespace WebCore {
         // engine support
         static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
         static void getSupportedTypes(HashSet<String>& types);
-        static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
+        static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs, const KURL&);
         static bool isAvailable();
 
         MediaPlayer* m_player;
index 95186dd..3ca9f5d 100644 (file)
@@ -803,11 +803,13 @@ void WebMediaPlayerClientImpl::getSupportedTypes(HashSet<String>& supportedTypes
 #if ENABLE(ENCRYPTED_MEDIA)
 MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
                                                                  const String& codecs,
-                                                                 const String& keySystem)
+                                                                 const String& keySystem,
+                                                                 const KURL&)
 {
 #else
 MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
-                                                                 const String& codecs)
+                                                                 const String& codecs,
+                                                                 const KURL&)
 {
     String keySystem;
 #endif
index 53a24d6..b3c94fe 100644 (file)
@@ -186,10 +186,10 @@ private:
     static void getSupportedTypes(WTF::HashSet<WTF::String>&);
 #if ENABLE(ENCRYPTED_MEDIA)
     static WebCore::MediaPlayer::SupportsType supportsType(
-        const WTF::String& type, const WTF::String& codecs, const String& keySystem);
+        const WTF::String& type, const WTF::String& codecs, const String& keySystem, const WebCore::KURL&);
 #else
     static WebCore::MediaPlayer::SupportsType supportsType(
-        const WTF::String& type, const WTF::String& codecs);
+        const WTF::String& type, const WTF::String& codecs, const WebCore::KURL&);
 #endif
 #if USE(ACCELERATED_COMPOSITING)
     bool acceleratedRenderingInUse();