diff options
author | Jonas Rabbe <jonas.rabbe@nokia.com> | 2011-11-08 12:38:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-14 07:59:19 +0100 |
commit | 956526a9fb769acc66b376be0b051c0108a06f21 (patch) | |
tree | af4fd6da5f8d54483c1d944fa15c5bb366fbd7a8 /src/gsttools/qvideosurfacegstsink.cpp | |
parent | 34cdc41a935766a7d773cb7e2bdb7ce27711dd9d (diff) |
Changed QVideoSurfaceGstSink to take pools from plugins
Change-Id: Iec743efc52513e2000276b9a18d1d9639c270699
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/gsttools/qvideosurfacegstsink.cpp')
-rw-r--r-- | src/gsttools/qvideosurfacegstsink.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index d4bb20837..545c37ead 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -46,6 +46,7 @@ #include <QDebug> #include <QThread> +#include <private/qmediapluginloader_p.h> #include "qgstvideobuffer_p.h" #if defined(Q_WS_X11) && !defined(QT_NO_XVIDEO) @@ -57,6 +58,10 @@ //#define DEBUG_VIDEO_SURFACE_SINK +Q_GLOBAL_STATIC_WITH_ARGS(QMediaPluginLoader, bufferPoolLoader, + (QGstBufferPoolInterface_iid, QLatin1String("video"), Qt::CaseInsensitive)) + + QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate( QAbstractVideoSurface *surface) : m_surface(surface) @@ -66,6 +71,12 @@ QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate( , m_startCanceled(false) { if (m_surface) { + foreach (QObject *instance, bufferPoolLoader()->instances(QGstBufferPoolPluginKey)) { + QGstBufferPoolInterface* plugin = qobject_cast<QGstBufferPoolInterface*>(instance); + if (plugin) { + m_pools.append(plugin); + } + } #if defined(Q_WS_X11) && !defined(QT_NO_XVIDEO) m_pools.append(new QGstXvImageBufferPool()); #endif @@ -258,8 +269,8 @@ void QVideoSurfaceGstDelegate::queuedRender() void QVideoSurfaceGstDelegate::updateSupportedFormats() { - QAbstractGstBufferPool *newPool = 0; - foreach (QAbstractGstBufferPool *pool, m_pools) { + QGstBufferPoolInterface *newPool = 0; + foreach (QGstBufferPoolInterface *pool, m_pools) { if (!m_surface->supportedPixelFormats(pool->handleType()).isEmpty()) { newPool = pool; break; @@ -669,7 +680,7 @@ GstFlowReturn QVideoSurfaceGstSink::buffer_alloc( return GST_FLOW_OK; QMutexLocker poolLock(sink->delegate->poolMutex()); - QAbstractGstBufferPool *pool = sink->delegate->pool(); + QGstBufferPoolInterface *pool = sink->delegate->pool(); if (!pool) return GST_FLOW_OK; |