diff options
author | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-04-29 06:46:55 (GMT) |
---|---|---|
committer | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2010-04-29 06:46:55 (GMT) |
commit | fcabd4c7901cc33e2a4bf437f661dba36cb400b4 (patch) | |
tree | e933c398b16ba6ee0d9addf31d249eb98fbe1ec3 /src/plugins | |
parent | 872ffd81772ff39d173da90184a5124242909707 (diff) | |
download | Qt-fcabd4c7901cc33e2a4bf437f661dba36cb400b4.zip Qt-fcabd4c7901cc33e2a4bf437f661dba36cb400b4.tar.gz Qt-fcabd4c7901cc33e2a4bf437f661dba36cb400b4.tar.bz2 |
Gstreamer media backend: fixed embedded qt build
XVideo is not available on framebuffer, so widget and window
video outputs are disabled, only the renderer video
output is supported.
Reviewed-by: Justin McPherson
Diffstat (limited to 'src/plugins')
5 files changed, 62 insertions, 21 deletions
diff --git a/src/plugins/mediaservices/gstreamer/gstreamer.pro b/src/plugins/mediaservices/gstreamer/gstreamer.pro index 0273139..6af9c3f 100644 --- a/src/plugins/mediaservices/gstreamer/gstreamer.pro +++ b/src/plugins/mediaservices/gstreamer/gstreamer.pro @@ -9,39 +9,48 @@ unix:contains(QT_CONFIG, alsa) { } QMAKE_CXXFLAGS += $$QT_CFLAGS_GSTREAMER -LIBS += -lXv $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 -lgstaudio-0.10 +LIBS += $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 -lgstaudio-0.10 # Input HEADERS += \ qgstreamermessage.h \ qgstreamerbushelper.h \ qgstreamervideooutputcontrol.h \ - qgstreamervideorendererinterface.h \ - qgstreamervideowidget.h \ + qgstreamervideorendererinterface.h \ qgstreamerserviceplugin.h \ qgstreamervideoinputdevicecontrol.h \ - qgstreamervideooverlay.h \ qgstreamervideorenderer.h \ qgstvideobuffer.h \ - qvideosurfacegstsink.h \ - qx11videosurface.h \ - qgstxvimagebuffer.h + qvideosurfacegstsink.h SOURCES += \ qgstreamermessage.cpp \ qgstreamerbushelper.cpp \ qgstreamervideooutputcontrol.cpp \ - qgstreamervideorendererinterface.cpp \ - qgstreamervideowidget.cpp \ + qgstreamervideorendererinterface.cpp \ qgstreamerserviceplugin.cpp \ qgstreamervideoinputdevicecontrol.cpp \ - qgstreamervideooverlay.cpp \ qgstreamervideorenderer.cpp \ qgstvideobuffer.cpp \ - qvideosurfacegstsink.cpp \ - qx11videosurface.cpp \ - qgstxvimagebuffer.cpp + qvideosurfacegstsink.cpp + + +x11 { + LIBS += -lXv + + HEADERS += \ + qgstreamervideooverlay.h \ + qgstreamervideowidget.h \ + qx11videosurface.h \ + qgstxvimagebuffer.h + + SOURCES += \ + qgstreamervideooverlay.cpp \ + qgstreamervideowidget.cpp \ + qx11videosurface.cpp \ + qgstxvimagebuffer.cpp +} include(mediaplayer/mediaplayer.pri) diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.cpp index d5d7bd0..3228722 100644 --- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.cpp +++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayerservice.cpp @@ -63,7 +63,10 @@ QT_BEGIN_NAMESPACE QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent): - QMediaService(parent) + QMediaService(parent), + m_videoRenderer(0), + m_videoWindow(0), + m_videoWidget(0) { m_session = new QGstreamerPlayerSession(this); m_control = new QGstreamerPlayerControl(m_session, this); @@ -74,13 +77,22 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent): connect(m_videoOutput, SIGNAL(outputChanged(QVideoOutputControl::Output)), this, SLOT(videoOutputChanged(QVideoOutputControl::Output))); m_videoRenderer = new QGstreamerVideoRenderer(this); + +#ifdef Q_WS_X11 m_videoWindow = new QGstreamerVideoOverlay(this); m_videoWidget = new QGstreamerVideoWidgetControl(this); +#endif + + QList<QVideoOutputControl::Output> outputs; + + if (m_videoRenderer) + outputs << QVideoOutputControl::RendererOutput; + if (m_videoWidget) + outputs << QVideoOutputControl::WidgetOutput; + if (m_videoWindow) + outputs << QVideoOutputControl::WindowOutput; - m_videoOutput->setAvailableOutputs(QList<QVideoOutputControl::Output>() - << QVideoOutputControl::RendererOutput - << QVideoOutputControl::WindowOutput - << QVideoOutputControl::WidgetOutput); + m_videoOutput->setAvailableOutputs(outputs); } QGstreamerPlayerService::~QGstreamerPlayerService() diff --git a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp index 76d87ce..596e39d 100644 --- a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp +++ b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp @@ -44,12 +44,16 @@ #include <QtCore/qdebug.h> #include <QMap> #include <QThread> + +#include "qgstvideobuffer.h" + +#ifdef Q_WS_X11 #include <QtGui/qx11info_x11.h> +#include "qgstxvimagebuffer.h" +#endif #include "qvideosurfacegstsink.h" -#include "qgstvideobuffer.h" -#include "qgstxvimagebuffer.h" @@ -131,11 +135,13 @@ GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer) QGstVideoBuffer *videoBuffer = 0; +#ifdef Q_WS_X11 if (G_TYPE_CHECK_INSTANCE_TYPE(buffer, QGstXvImageBuffer::get_type())) { QGstXvImageBuffer *xvBuffer = reinterpret_cast<QGstXvImageBuffer *>(buffer); QVariant handle = QVariant::fromValue(xvBuffer->xvImage); videoBuffer = new QGstVideoBuffer(buffer, m_bytesPerLine, XvHandleType, handle); } else +#endif videoBuffer = new QGstVideoBuffer(buffer, m_bytesPerLine); m_frame = QVideoFrame( @@ -387,7 +393,9 @@ void QVideoSurfaceGstSink::instance_init(GTypeInstance *instance, gpointer g_cla Q_UNUSED(g_class); sink->delegate = 0; +#ifdef Q_WS_X11 sink->pool = new QGstXvImageBufferPool(); +#endif sink->lastRequestedCaps = 0; sink->lastBufferCaps = 0; sink->lastSurfaceFormat = new QVideoSurfaceFormat; @@ -396,8 +404,11 @@ void QVideoSurfaceGstSink::instance_init(GTypeInstance *instance, gpointer g_cla void QVideoSurfaceGstSink::finalize(GObject *object) { VO_SINK(object); +#ifdef Q_WS_X11 delete sink->pool; sink->pool = 0; +#endif + delete sink->lastSurfaceFormat; sink->lastSurfaceFormat = 0; @@ -588,6 +599,8 @@ GstFlowReturn QVideoSurfaceGstSink::buffer_alloc( *buffer = 0; +#ifdef Q_WS_X11 + if (sink->lastRequestedCaps && gst_caps_is_equal(sink->lastRequestedCaps, caps)) { //qDebug() << "reusing last caps"; *buffer = GST_BUFFER(sink->pool->takeBuffer(*sink->lastSurfaceFormat, sink->lastBufferCaps)); @@ -649,6 +662,7 @@ GstFlowReturn QVideoSurfaceGstSink::buffer_alloc( *buffer = GST_BUFFER(sink->pool->takeBuffer(surfaceFormat, intersection)); +#endif return GST_FLOW_OK; } diff --git a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.h b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.h index f59a43c..75fa854 100644 --- a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.h +++ b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.h @@ -59,8 +59,10 @@ QT_BEGIN_NAMESPACE class QAbstractVideoSurface; +#ifdef Q_WS_X11 class QGstXvImageBuffer; class QGstXvImageBufferPool; +#endif class QVideoSurfaceGstDelegate : public QObject @@ -137,7 +139,11 @@ private: private: QVideoSurfaceGstDelegate *delegate; + +#ifdef Q_WS_X11 QGstXvImageBufferPool *pool; +#endif + GstCaps *lastRequestedCaps; GstCaps *lastBufferCaps; QVideoSurfaceFormat *lastSurfaceFormat; diff --git a/src/plugins/mediaservices/mediaservices.pro b/src/plugins/mediaservices/mediaservices.pro index fdc1cd9..27f05bc 100644 --- a/src/plugins/mediaservices/mediaservices.pro +++ b/src/plugins/mediaservices/mediaservices.pro @@ -5,7 +5,7 @@ contains(QT_CONFIG, media-backend) { mac: SUBDIRS += qt7 - unix:!mac:!symbian:contains(QT_CONFIG, xvideo):contains(QT_CONFIG, gstreamer) { + unix:!mac:!symbian:contains(QT_CONFIG, gstreamer) { SUBDIRS += gstreamer } |