[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hausmann at webkit.org
hausmann at webkit.org
Wed Dec 22 15:58:09 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit cadd1c34d901979ad1512c3efac997de839cea35
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 17 10:54:59 2010 +0000
[Qt] Add support for use GStreamer with the Qt build
Reviewed by Kenneth Christiansen, Tor Arne Vestbø.
JavaScriptCore:
Enable the build/inclusion of the wtf/QObject convenience classes.
* JavaScriptCore.pri:
* wtf/wtf.pri:
WebCore:
Make it possible to use gstreamer with the Qt build via the USE_GSTREAMER macro. The
integration is rather basic at this point, allowing for software based rendering
only at the moment. AC integration and fullscreen playback is still missing.
* WebCore.pro: Added a bunch of gstreamer files to the build and guard it as a
build option with the USE_GSTREAMER macro.
* platform/graphics/MediaPlayer.cpp:
(WebCore::installedMediaEngines): Don't use the generic media player registration
when using GStreamer. These #ifdefs should be removed, but the gstreamer folks want
to be able to build with gstreamer _and_ another backend simultaenously.
* platform/graphics/gstreamer/ImageGStreamer.h:
* platform/graphics/gstreamer/ImageGStreamerQt.cpp: Added.
(ImageGStreamer::createImage):
(ImageGStreamer::ImageGStreamer):
(ImageGStreamer::~ImageGStreamer):
* platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Added.
* platform/graphics/gstreamer/PlatformVideoWindowQt.cpp: Added.
(FullScreenVideoWindow::FullScreenVideoWindow):
(FullScreenVideoWindow::keyPressEvent):
(FullScreenVideoWindow::event):
(PlatformVideoWindow::PlatformVideoWindow):
(PlatformVideoWindow::~PlatformVideoWindow):
(PlatformVideoWindow::prepareForOverlay):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 512ae90..cb6c07c 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-17 Alexis Menard <alexis.menard at nokia.com>, Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Kenneth Christiansen, Tor Arne Vestbø.
+
+ [Qt] Add support for use GStreamer with the Qt build
+
+ Enable the build/inclusion of the wtf/QObject convenience classes.
+
+ * JavaScriptCore.pri:
+ * wtf/wtf.pri:
+
2010-11-17 Peter Varga <pvarga at inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri
index 847576d..0590b94 100644
--- a/JavaScriptCore/JavaScriptCore.pri
+++ b/JavaScriptCore/JavaScriptCore.pri
@@ -42,6 +42,7 @@ INCLUDEPATH = \
$$PWD/profiler \
$$PWD/runtime \
$$PWD/wtf \
+ $$PWD/wtf/gobject \
$$PWD/wtf/symbian \
$$PWD/wtf/unicode \
$$PWD/yarr \
diff --git a/JavaScriptCore/wtf/wtf.pri b/JavaScriptCore/wtf/wtf.pri
index 83e71d8..1780334 100644
--- a/JavaScriptCore/wtf/wtf.pri
+++ b/JavaScriptCore/wtf/wtf.pri
@@ -8,6 +8,8 @@ SOURCES += \
wtf/dtoa.cpp \
wtf/DecimalNumber.cpp \
wtf/FastMalloc.cpp \
+ wtf/gobject/GOwnPtr.cpp \
+ wtf/gobject/GRefPtr.cpp \
wtf/HashTable.cpp \
wtf/MD5.cpp \
wtf/MainThread.cpp \
@@ -31,6 +33,12 @@ SOURCES += \
wtf/unicode/icu/CollatorICU.cpp \
wtf/unicode/UTF8.cpp
+contains(DEFINES, USE_GSTREAMER=1) {
+ DEFINES += ENABLE_GLIB_SUPPORT=1
+ PKGCONFIG += glib-2.0 gio-2.0
+ CONFIG += link_pkgconfig
+}
+
!contains(DEFINES, USE_SYSTEM_MALLOC) {
SOURCES += wtf/TCSystemAlloc.cpp
}
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 90add47..d7865c2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-11-17 Alexis Menard <alexis.menard at nokia.com>, Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Kenneth Christiansen, Tor Arne Vestbø.
+
+ [Qt] Add support for use GStreamer with the Qt build
+
+ Make it possible to use gstreamer with the Qt build via the USE_GSTREAMER macro. The
+ integration is rather basic at this point, allowing for software based rendering
+ only at the moment. AC integration and fullscreen playback is still missing.
+
+ * WebCore.pro: Added a bunch of gstreamer files to the build and guard it as a
+ build option with the USE_GSTREAMER macro.
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::installedMediaEngines): Don't use the generic media player registration
+ when using GStreamer. These #ifdefs should be removed, but the gstreamer folks want
+ to be able to build with gstreamer _and_ another backend simultaenously.
+ * platform/graphics/gstreamer/ImageGStreamer.h:
+ * platform/graphics/gstreamer/ImageGStreamerQt.cpp: Added.
+ (ImageGStreamer::createImage):
+ (ImageGStreamer::ImageGStreamer):
+ (ImageGStreamer::~ImageGStreamer):
+ * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Added.
+ * platform/graphics/gstreamer/PlatformVideoWindowQt.cpp: Added.
+ (FullScreenVideoWindow::FullScreenVideoWindow):
+ (FullScreenVideoWindow::keyPressEvent):
+ (FullScreenVideoWindow::event):
+ (PlatformVideoWindow::PlatformVideoWindow):
+ (PlatformVideoWindow::~PlatformVideoWindow):
+ (PlatformVideoWindow::prepareForOverlay):
+
2010-11-17 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 3b0b395..3d0626a 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -3155,31 +3155,58 @@ contains(DEFINES, ENABLE_VIDEO=1) {
bindings/js/JSAudioConstructor.cpp
}
- contains(MOBILITY_CONFIG, multimedia) {
- HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
- SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
-
- CONFIG *= mobility
- MOBILITY += multimedia
- DEFINES += WTF_USE_QT_MULTIMEDIA
- } else:contains(QT_CONFIG, phonon) {
- HEADERS += \
- platform/graphics/qt/MediaPlayerPrivatePhonon.h
-
- SOURCES += \
- platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
-
- # Add phonon manually to prevent it from coming first in
- # the include paths, as Phonon's path.h conflicts with
- # WebCore's Path.h on case-insensitive filesystems.
- qtAddLibrary(phonon)
- INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon
- INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon
- mac {
- INCLUDEPATH -= $$QMAKE_LIBDIR_QT/phonon.framework/Headers
- INCLUDEPATH += $$QMAKE_LIBDIR_QT/phonon.framework/Headers
- }
+ contains(DEFINES, USE_GSTREAMER=1) {
+ HEADERS += \
+ platform/graphics/gstreamer/DataSourceGStreamer.h \
+ platform/graphics/gstreamer/GOwnPtrGStreamer.h \
+ platform/graphics/gstreamer/GStreamerGWorld.h \
+ platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h \
+ platform/graphics/gstreamer/VideoSinkGStreamer.h \
+ platform/graphics/gstreamer/WebKitWebSourceGStreamer.h \
+ platform/graphics/gstreamer/PlatformVideoWindow.h \
+ platform/graphics/gstreamer/PlatformVideoWindowPrivate.h \
+ platform/graphics/gstreamer/ImageGStreamer.h
+ SOURCES += \
+ platform/graphics/gstreamer/DataSourceGStreamer.cpp \
+ platform/graphics/gstreamer/GOwnPtrGStreamer.cpp \
+ platform/graphics/gstreamer/GStreamerGWorld.cpp \
+ platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp \
+ platform/graphics/gstreamer/VideoSinkGStreamer.cpp \
+ platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp \
+ platform/graphics/gstreamer/PlatformVideoWindowQt.cpp \
+ platform/graphics/gstreamer/ImageGStreamerQt.cpp
+
+ DEFINES += WTF_USE_GSTREAMER=1
+ DEFINES += ENABLE_GLIB_SUPPORT=1
+
+ INCLUDEPATH += $$PWD/platform/graphics/gstreamer
+
+ PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
+ } else:contains(MOBILITY_CONFIG, multimedia) {
+ HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
+ SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
+
+ CONFIG *= mobility
+ MOBILITY += multimedia
+ DEFINES += WTF_USE_QT_MULTIMEDIA
+ } else:contains(QT_CONFIG, phonon) {
+ HEADERS += \
+ platform/graphics/qt/MediaPlayerPrivatePhonon.h
+
+ SOURCES += \
+ platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+
+ # Add phonon manually to prevent it from coming first in
+ # the include paths, as Phonon's path.h conflicts with
+ # WebCore's Path.h on case-insensitive filesystems.
+ qtAddLibrary(phonon)
+ INCLUDEPATH -= $$QMAKE_INCDIR_QT/phonon
+ INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon
+ mac {
+ INCLUDEPATH -= $$QMAKE_LIBDIR_QT/phonon.framework/Headers
+ INCLUDEPATH += $$QMAKE_LIBDIR_QT/phonon.framework/Headers
}
+ }
}
contains(DEFINES, ENABLE_XPATH=1) {
diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp
index 57f55f9..e87c53c 100644
--- a/WebCore/platform/graphics/MediaPlayer.cpp
+++ b/WebCore/platform/graphics/MediaPlayer.cpp
@@ -55,10 +55,10 @@
#include "MediaPlayerPrivateQuickTimeVisualContext.h"
#define PlatformMediaEngineClassName MediaPlayerPrivateQuickTimeVisualContext
#elif PLATFORM(QT)
-#if USE(QT_MULTIMEDIA)
+#if USE(QT_MULTIMEDIA) && !USE(GSTREAMER)
#include "MediaPlayerPrivateQt.h"
#define PlatformMediaEngineClassName MediaPlayerPrivateQt
-#else
+#elif !USE(GSTREAMER)
#include "MediaPlayerPrivatePhonon.h"
#define PlatformMediaEngineClassName MediaPlayerPrivatePhonon
#endif
@@ -175,7 +175,7 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines()
MediaPlayerPrivateGStreamer::registerMediaEngine(addMediaEngine);
#endif
-#if !PLATFORM(GTK) && !PLATFORM(EFL)
+#if !PLATFORM(GTK) && !PLATFORM(EFL) && !(PLATFORM(QT) && USE(GSTREAMER))
PlatformMediaEngineClassName::registerMediaEngine(addMediaEngine);
#endif
}
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
index cf2b9d6..6e53cfc 100644
--- a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h
@@ -52,6 +52,10 @@ class ImageGStreamer : public RefCounted<ImageGStreamer> {
ImageGStreamer(GstBuffer*&, IntSize, cairo_format_t&);
#endif
+#if PLATFORM(QT)
+ ImageGStreamer(GstBuffer*&, IntSize, QImage::Format);
+#endif
+
#if PLATFORM(MAC)
ImageGStreamer(GstBuffer*&, IntSize);
#endif
diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp b/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp
new file mode 100644
index 0000000..cf46f02
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/ImageGStreamerQt.cpp
@@ -0,0 +1,67 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ 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 "ImageGStreamer.h"
+
+#if USE(GSTREAMER)
+#include "GOwnPtr.h"
+
+using namespace std;
+using namespace WebCore;
+
+PassRefPtr<ImageGStreamer> ImageGStreamer::createImage(GstBuffer* buffer)
+{
+ int width = 0, height = 0;
+ GstCaps* caps = gst_buffer_get_caps(buffer);
+ GstVideoFormat format;
+ if (!gst_video_format_parse_caps(caps, &format, &width, &height)) {
+ gst_caps_unref(caps);
+ return 0;
+ }
+
+ gst_caps_unref(caps);
+
+ QImage::Format imageFormat;
+ if (format == GST_VIDEO_FORMAT_RGB)
+ imageFormat = QImage::Format_RGB888;
+ else
+ imageFormat = QImage::Format_RGB32;
+
+ return adoptRef(new ImageGStreamer(buffer, IntSize(width, height), imageFormat));
+}
+
+ImageGStreamer::ImageGStreamer(GstBuffer*& buffer, IntSize size, QImage::Format imageFormat)
+ : m_image(0)
+{
+ QPixmap* surface = new QPixmap;
+ QImage image(GST_BUFFER_DATA(buffer), size.width(), size.height(), imageFormat);
+ surface->convertFromImage(image);
+ m_image = BitmapImage::create(surface);
+}
+
+ImageGStreamer::~ImageGStreamer()
+{
+ if (m_image)
+ m_image.clear();
+
+ m_image = 0;
+}
+#endif // USE(GSTREAMER)
+
diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
new file mode 100644
index 0000000..0ae4587
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowPrivate.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ 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 PlatformVideoWindowPrivate_h
+#define PlatformVideoWindowPrivate_h
+
+#include <QWidget>
+
+class QKeyEvent;
+
+namespace WebCore {
+
+class FullScreenVideoWindow: public QWidget {
+Q_OBJECT
+public:
+ FullScreenVideoWindow();
+signals:
+ void closed();
+protected:
+ void keyPressEvent(QKeyEvent* ev);
+ bool event(QEvent* ev);
+};
+
+
+} // namespace WebCore
+
+
+#endif // PlatformVideoWindowPrivate_h
diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
new file mode 100644
index 0000000..872d055
--- /dev/null
+++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowQt.cpp
@@ -0,0 +1,82 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ 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 "PlatformVideoWindow.h"
+
+#include "PlatformVideoWindowPrivate.h"
+
+#include <QApplication>
+#include <QDesktopWidget>
+#include <QKeyEvent>
+#include <QPalette>
+using namespace WebCore;
+
+FullScreenVideoWindow::FullScreenVideoWindow()
+ : QWidget(0, Qt::Window)
+{
+ setAttribute(Qt::WA_NativeWindow);
+ // Setting these values ensures smooth resizing since it
+ // will prevent the system from clearing the background.
+ setAttribute(Qt::WA_NoSystemBackground, true);
+ setAttribute(Qt::WA_PaintOnScreen, true);
+}
+
+void FullScreenVideoWindow::keyPressEvent(QKeyEvent* ev)
+{
+ if (ev->key() == Qt::Key_Escape) {
+ close();
+ emit closed();
+ }
+}
+
+bool FullScreenVideoWindow::event(QEvent* ev)
+{
+ switch (ev->type()) {
+ case QEvent::MouseButtonDblClick:
+ close();
+ ev->accept();
+ return true;
+ default:
+ return QWidget::event(ev);
+ }
+}
+
+
+PlatformVideoWindow::PlatformVideoWindow()
+{
+ m_window = new FullScreenVideoWindow();
+ m_window->setWindowFlags(m_window->windowFlags() | Qt::FramelessWindowHint);
+ QPalette p;
+ p.setColor(QPalette::Base, Qt::black);
+ p.setColor(QPalette::Window, Qt::black);
+ m_window->setPalette(p);
+ m_window->showFullScreen();
+ m_videoWindowId = m_window->winId();
+}
+
+PlatformVideoWindow::~PlatformVideoWindow()
+{
+ delete m_window;
+ m_videoWindowId = 0;
+}
+
+void PlatformVideoWindow::prepareForOverlay(GstMessage*)
+{
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list