[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

scherkus at chromium.org scherkus at chromium.org
Wed Dec 22 11:23:59 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cdb8a93bd8a819e80aff31b98475c641863586a9
Author: scherkus at chromium.org <scherkus at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 21 22:12:16 2010 +0000

    2010-07-21  Bo Liu  <boliu at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [Chromium] Add chromium WebMediaPlayer to PlatformMedia
            https://bugs.webkit.org/show_bug.cgi?id=41295
    
            * platform/graphics/MediaPlayer.h:
            (WebCore::PlatformMedia::):
    
    2010-07-21  Bo Liu  <boliu at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [Chromium] Add chromium WebMediaPlayer to PlatformMedia
            https://bugs.webkit.org/show_bug.cgi?id=41295
    
            * WebKit.gyp:
            * public/WebMediaElement.h: Added.
            * src/WebMediaElement.cpp: Added.
            (WebKit::WebMediaElement::player):
            (WebKit::WebMediaElement::WebMediaElement):
            (WebKit::WebMediaElement::operator=):
            (WebKit::WebMediaElement::operator PassRefPtr<HTMLMediaElement>):
            * src/WebMediaPlayerClientImpl.cpp:
            (WebKit::WebMediaPlayerClientImpl::fromMediaElement):
            (WebKit::WebMediaPlayerClientImpl::mediaPlayer):
            (WebKit::WebMediaPlayerClientImpl::platformLayer):
            (WebKit::WebMediaPlayerClientImpl::platformMedia):
            * src/WebMediaPlayerClientImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63859 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 017148d..79eb390 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-21  Bo Liu  <boliu at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Add chromium WebMediaPlayer to PlatformMedia
+        https://bugs.webkit.org/show_bug.cgi?id=41295
+
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::PlatformMedia::):
+
 2010-07-21  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebCore/platform/graphics/MediaPlayer.h b/WebCore/platform/graphics/MediaPlayer.h
index c7fba99..6945872 100644
--- a/WebCore/platform/graphics/MediaPlayer.h
+++ b/WebCore/platform/graphics/MediaPlayer.h
@@ -55,6 +55,7 @@ class QTMovieVisualContext;
 namespace WebCore {
 
 class GStreamerGWorld;
+class MediaPlayerPrivateInterface;
 
 // Structure that will hold every native
 // types supported by the current media player.
@@ -67,6 +68,7 @@ struct PlatformMedia {
         QTMovieGWorldType,
         QTMovieVisualContextType,
         GStreamerGWorldType,
+        ChromiumMediaPlayerType,
     } type;
 
     union {
@@ -74,6 +76,7 @@ struct PlatformMedia {
         QTMovieGWorld* qtMovieGWorld;
         QTMovieVisualContext* qtMovieVisualContext;
         GStreamerGWorld* gstreamerGWorld;
+        MediaPlayerPrivateInterface* chromiumMediaPlayer;
     } media;
 };
 
@@ -85,7 +88,6 @@ class GraphicsContext;
 class IntRect;
 class IntSize;
 class MediaPlayer;
-class MediaPlayerPrivateInterface;
 class String;
 class TimeRanges;
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index e9a1111..009dc60 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-21  Bo Liu  <boliu at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Add chromium WebMediaPlayer to PlatformMedia
+        https://bugs.webkit.org/show_bug.cgi?id=41295
+
+        * WebKit.gyp:
+        * public/WebMediaElement.h: Added.
+        * src/WebMediaElement.cpp: Added.
+        (WebKit::WebMediaElement::player):
+        (WebKit::WebMediaElement::WebMediaElement):
+        (WebKit::WebMediaElement::operator=):
+        (WebKit::WebMediaElement::operator PassRefPtr<HTMLMediaElement>):
+        * src/WebMediaPlayerClientImpl.cpp:
+        (WebKit::WebMediaPlayerClientImpl::fromMediaElement):
+        (WebKit::WebMediaPlayerClientImpl::mediaPlayer):
+        (WebKit::WebMediaPlayerClientImpl::platformLayer):
+        (WebKit::WebMediaPlayerClientImpl::platformMedia):
+        * src/WebMediaPlayerClientImpl.h:
+
 2010-07-21  Finnur Thorarinsson  <finnur.webkit at gmail.com>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index b47d756..8abc159 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -182,6 +182,7 @@
                 'public/WebKitClient.h',
                 'public/WebLabelElement.h',
                 'public/WebLocalizedString.h',
+                'public/WebMediaElement.h',
                 'public/WebMediaPlayer.h',
                 'public/WebMediaPlayerAction.h',
                 'public/WebMediaPlayerClient.h',
@@ -415,6 +416,7 @@
                 'src/WebInputEventConversion.h',
                 'src/WebKit.cpp',
                 'src/WebLabelElement.cpp',
+                'src/WebMediaElement.cpp',
                 'src/WebMediaPlayerClientImpl.cpp',
                 'src/WebMediaPlayerClientImpl.h',
                 'src/WebMutationEvent.cpp',
diff --git a/WebKit/chromium/public/WebMediaElement.h b/WebKit/chromium/public/WebMediaElement.h
new file mode 100644
index 0000000..94837a5
--- /dev/null
+++ b/WebKit/chromium/public/WebMediaElement.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebMediaElement_h
+#define WebMediaElement_h
+
+#include "WebElement.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class HTMLMediaElement; }
+#endif
+
+namespace WebKit {
+
+class WebMediaPlayer;
+
+class WebMediaElement : public WebElement {
+public:
+    WEBKIT_API WebMediaPlayer* player() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebMediaElement(const WTF::PassRefPtr<WebCore::HTMLMediaElement>&);
+    WebMediaElement& operator=(const WTF::PassRefPtr<WebCore::HTMLMediaElement>&);
+    operator WTF::PassRefPtr<WebCore::HTMLMediaElement>() const;
+#endif
+};
+} // namespace WebKit
+
+#endif // WebMediaElement_h
diff --git a/WebKit/chromium/src/WebMediaElement.cpp b/WebKit/chromium/src/WebMediaElement.cpp
new file mode 100644
index 0000000..4adda1e
--- /dev/null
+++ b/WebKit/chromium/src/WebMediaElement.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebMediaElement.h"
+
+#include "HTMLMediaElement.h"
+#include "MediaPlayer.h"
+#include "WebMediaPlayer.h"
+#include "WebMediaPlayerClientImpl.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebMediaPlayer* WebMediaElement::player() const
+{
+    return WebMediaPlayerClientImpl::fromMediaElement(this)->mediaPlayer();
+}
+
+WebMediaElement::WebMediaElement(const PassRefPtr<HTMLMediaElement>& elem)
+    : WebElement(elem)
+{
+}
+
+WebMediaElement& WebMediaElement::operator=(const PassRefPtr<HTMLMediaElement>& elem)
+{
+    m_private = elem;
+    return *this;
+}
+
+WebMediaElement::operator PassRefPtr<HTMLMediaElement>() const
+{
+    return static_cast<HTMLMediaElement*>(m_private.get());
+}
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index de9cd14..2b0c9a7 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -28,6 +28,7 @@
 #include "WebFrameImpl.h"
 #include "WebKit.h"
 #include "WebKitClient.h"
+#include "WebMediaElement.h"
 #include "WebMediaPlayer.h"
 #include "WebMimeRegistry.h"
 #include "WebRect.h"
@@ -79,6 +80,17 @@ void WebMediaPlayerClientImpl::registerSelf(MediaEngineRegistrar registrar)
     }
 }
 
+WebMediaPlayerClientImpl* WebMediaPlayerClientImpl::fromMediaElement(const WebMediaElement* element)
+{
+    PlatformMedia pm = element->constUnwrap<HTMLMediaElement>()->platformMedia();
+    return static_cast<WebMediaPlayerClientImpl*>(pm.media.chromiumMediaPlayer);
+}
+
+WebMediaPlayer* WebMediaPlayerClientImpl::mediaPlayer() const
+{
+    return m_webMediaPlayer.get();
+}
+
 // WebMediaPlayerClient --------------------------------------------------------
 
 void WebMediaPlayerClientImpl::networkStateChanged()
@@ -167,13 +179,21 @@ void WebMediaPlayerClientImpl::cancelLoad()
 }
 
 #if USE(ACCELERATED_COMPOSITING)
-WebCore::PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const
+PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const
 {
     ASSERT(m_supportsAcceleratedCompositing);
     return m_videoLayer.get();
 }
 #endif
 
+PlatformMedia WebMediaPlayerClientImpl::platformMedia() const
+{
+    PlatformMedia pm;
+    pm.type = PlatformMedia::ChromiumMediaPlayerType;
+    pm.media.chromiumMediaPlayer = const_cast<WebMediaPlayerClientImpl*>(this);
+    return pm;
+}
+
 void WebMediaPlayerClientImpl::play()
 {
     if (m_webMediaPlayer.get())
diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
index ff03b5b..0faac26 100644
--- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h
+++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h
@@ -39,6 +39,7 @@
 
 namespace WebKit {
 
+class WebMediaElement;
 class WebMediaPlayer;
 
 // This class serves as a bridge between WebCore::MediaPlayer and
@@ -50,6 +51,11 @@ public:
     static void setIsEnabled(bool);
     static void registerSelf(WebCore::MediaEngineRegistrar);
 
+    static WebMediaPlayerClientImpl* fromMediaElement(const WebMediaElement* element);
+
+    // Returns the encapsulated WebKit::WebMediaPlayer.
+    WebMediaPlayer* mediaPlayer() const;
+
     // WebMediaPlayerClient methods:
     virtual void networkStateChanged();
     virtual void readyStateChanged();
@@ -69,6 +75,7 @@ public:
 #if USE(ACCELERATED_COMPOSITING)
     virtual WebCore::PlatformLayer* platformLayer() const;
 #endif
+    virtual WebCore::PlatformMedia platformMedia() const;
     virtual void play();
     virtual void pause();
     virtual bool supportsFullscreen() const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list