Commit a70cf24b authored by philn@webkit.org's avatar philn@webkit.org

2010-05-18 Philippe Normand <pnormand@igalia.com>

        Reviewed by Eric Carlson.

        [GStreamer] PlatformMedia support
        https://bugs.webkit.org/show_bug.cgi?id=39300

        Basic support for PlatformMedia in the gst player. The
        PlatformMedia object contains a GStreamerGWorld object. That
        object is empty for now. XOverlay features will be added later
        on for easy review sake.

        * GNUmakefile.am:
        * platform/graphics/MediaPlayer.h:
        (WebCore::PlatformMedia::):
        * platform/graphics/gstreamer/GStreamerGWorld.cpp: Added.
        (WebCore::GStreamerGWorld::createGWorld):
        (WebCore::GStreamerGWorld::GStreamerGWorld):
        (WebCore::GStreamerGWorld::~GStreamerGWorld):
        * platform/graphics/gstreamer/GStreamerGWorld.h: Added.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::platformMedia):
        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8b587648
2010-05-18 Philippe Normand <pnormand@igalia.com>
Reviewed by Eric Carlson.
[GStreamer] PlatformMedia support
https://bugs.webkit.org/show_bug.cgi?id=39300
Basic support for PlatformMedia in the gst player. The
PlatformMedia object contains a GStreamerGWorld object. That
object is empty for now. XOverlay features will be added later
on for easy review sake.
* GNUmakefile.am:
* platform/graphics/MediaPlayer.h:
(WebCore::PlatformMedia::):
* platform/graphics/gstreamer/GStreamerGWorld.cpp: Added.
(WebCore::GStreamerGWorld::createGWorld):
(WebCore::GStreamerGWorld::GStreamerGWorld):
(WebCore::GStreamerGWorld::~GStreamerGWorld):
* platform/graphics/gstreamer/GStreamerGWorld.h: Added.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::platformMedia):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2010-05-20 Kwang Yul Seo <skyul@company100.net>
Reviewed by Eric Seidel.
......@@ -2607,6 +2607,8 @@ webcoregtk_sources += \
WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h \
WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.cpp \
WebCore/platform/graphics/gstreamer/GOwnPtrGStreamer.h \
WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp \
WebCore/platform/graphics/gstreamer/GStreamerGWorld.h \
WebCore/platform/graphics/gstreamer/ImageGStreamer.h \
WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp \
WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
......
......@@ -54,6 +54,8 @@ class QTMovieVisualContext;
namespace WebCore {
class GStreamerGWorld;
// Structure that will hold every native
// types supported by the current media player.
// We have to do that has multiple media players
......@@ -63,13 +65,15 @@ struct PlatformMedia {
None,
QTMovieType,
QTMovieGWorldType,
QTMovieVisualContextType
QTMovieVisualContextType,
GStreamerGWorldType,
} type;
union {
QTMovie* qtMovie;
QTMovieGWorld* qtMovieGWorld;
QTMovieVisualContext* qtMovieVisualContext;
GStreamerGWorld* gstreamerGWorld;
} media;
};
......
/*
* Copyright (C) 2010 Igalia S.L
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "GStreamerGWorld.h"
#include "MediaPlayerPrivateGStreamer.h"
using namespace std;
namespace WebCore {
PassRefPtr<GStreamerGWorld> GStreamerGWorld::createGWorld(MediaPlayerPrivateGStreamer* player)
{
return adoptRef(new GStreamerGWorld(player));
}
GStreamerGWorld::GStreamerGWorld(MediaPlayerPrivateGStreamer* player)
: m_player(player)
{
}
GStreamerGWorld::~GStreamerGWorld()
{
}
}
/*
* Copyright (C) 2010 Igalia S.L
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef GStreamerGWorld_h
#define GStreamerGWorld_h
#if ENABLE(VIDEO)
#include "RefCounted.h"
#include "RefPtr.h"
#include <glib.h>
namespace WebCore {
class MediaPlayerPrivateGStreamer;
class GStreamerGWorld : public RefCounted<GStreamerGWorld> {
public:
static PassRefPtr<GStreamerGWorld> createGWorld(MediaPlayerPrivateGStreamer*);
~GStreamerGWorld();
private:
GStreamerGWorld(MediaPlayerPrivateGStreamer*);
MediaPlayerPrivateGStreamer* m_player;
};
}
#endif
#endif
......@@ -34,6 +34,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "GOwnPtrGStreamer.h"
#include "GStreamerGWorld.h"
#include "GraphicsContext.h"
#include "GraphicsTypes.h"
#include "ImageGStreamer.h"
......@@ -1348,6 +1349,15 @@ bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
return true;
}
PlatformMedia MediaPlayerPrivateGStreamer::platformMedia() const
{
PlatformMedia p;
p.type = PlatformMedia::GStreamerGWorldType;
p.media.gstreamerGWorld = m_gstGWorld.get();
return p;
}
void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload)
{
ASSERT(m_playBin);
......@@ -1372,6 +1382,8 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin()
ASSERT(!m_playBin);
m_playBin = gst_element_factory_make("playbin2", "play");
m_gstGWorld = GStreamerGWorld::createGWorld(this);
GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_playBin));
gst_bus_add_signal_watch(bus);
g_signal_connect(bus, "message", G_CALLBACK(mediaPlayerPrivateMessageCallback), this);
......
......@@ -43,6 +43,7 @@ class GraphicsContext;
class IntSize;
class IntRect;
class String;
class GStreamerGWorld;
gboolean mediaPlayerPrivateMessageCallback(GstBus* bus, GstMessage* message, gpointer data);
void mediaPlayerPrivateVolumeChangedCallback(GObject* element, GParamSpec* pspec, gpointer data);
......@@ -116,6 +117,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
bool hasSingleSecurityOrigin() const;
bool supportsFullscreen() const;
PlatformMedia platformMedia() const;
GstElement* pipeline() const { return m_playBin; }
bool pipelineReset() const { return m_resetPipeline; }
......@@ -172,6 +174,7 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
MediaPlayer::Preload m_preload;
bool m_delayingLoad;
bool m_mediaDurationKnown;
RefPtr<GStreamerGWorld> m_gstGWorld;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment