diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-07-23 15:13:24 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-08-18 13:16:50 +0000 |
commit | cd3d5405225a328a0b2fa377823059723395a2ea (patch) | |
tree | da97a803a0e0e2cf13094caa068db91cb68b257d /src/multimedia/gsttools_headers/qgstreamervideowidget_p.h | |
parent | 13e40d522f6992d7fff38581e4b0005129669bde (diff) |
GStreamer: refactored widget and window control.
Instead of always using xvimagesink as GStreamer backend for the
widget and window control (works only with X11), we now try to
pick a video sink that fits the current configuration.
It first tries a set of known video sinks that can work with
the Qt platform plugin in use. If none is available, it
dynamically picks a video sink available on the system that can be
used with our backend.
Even if the video sink is now picked in a smarter way, xcb is still
the only supported platform plugin. The reason is that it's the
only Unix plugin which can provide a valid native window handle.
Additional work is needed to support other plugins like wayland
or directfb.
Change-Id: I3843dea363d6a0b85a6cc1f2952783b743e48ac6
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/multimedia/gsttools_headers/qgstreamervideowidget_p.h')
-rw-r--r-- | src/multimedia/gsttools_headers/qgstreamervideowidget_p.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h b/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h index 32a143c07..4526a8ac9 100644 --- a/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h +++ b/src/multimedia/gsttools_headers/qgstreamervideowidget_p.h @@ -38,6 +38,7 @@ #include "qgstreamervideorendererinterface_p.h" #include <private/qgstreamerbushelper_p.h> +#include <private/qgstreamervideooverlay_p.h> QT_BEGIN_NAMESPACE @@ -52,13 +53,15 @@ class QGstreamerVideoWidgetControl Q_OBJECT Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter) public: - QGstreamerVideoWidgetControl(QObject *parent = 0); + explicit QGstreamerVideoWidgetControl(QObject *parent = 0, const QByteArray &elementName = QByteArray()); virtual ~QGstreamerVideoWidgetControl(); GstElement *videoSink(); QWidget *videoWidget(); + void stopRenderer(); + Qt::AspectRatioMode aspectRatioMode() const; void setAspectRatioMode(Qt::AspectRatioMode mode); @@ -77,27 +80,27 @@ public: int saturation() const; void setSaturation(int saturation); - void setOverlay(); - bool eventFilter(QObject *object, QEvent *event); - bool processSyncMessage(const QGstreamerMessage &message); - bool processBusMessage(const QGstreamerMessage &message); - -public slots: - void updateNativeVideoSize(); signals: void sinkChanged(); void readyChanged(bool); +private Q_SLOTS: + void onOverlayActiveChanged(); + void onNativeVideoSizeChanged(); + private: void createVideoWidget(); - void windowExposed(); + void updateWidgetAttributes(); + + bool processSyncMessage(const QGstreamerMessage &message); + bool processBusMessage(const QGstreamerMessage &message); - GstElement *m_videoSink; + QGstreamerVideoOverlay m_videoOverlay; QGstreamerVideoWidget *m_widget; + bool m_stopped; WId m_windowId; - Qt::AspectRatioMode m_aspectRatioMode; bool m_fullScreen; }; |