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>
This commit is contained in:
@@ -124,8 +124,8 @@ CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *pa
|
||||
#else
|
||||
m_videoWindow = new QGstreamerVideoWindow(this);
|
||||
#endif
|
||||
// If the GStreamer sink element is not available (xvimagesink), don't provide
|
||||
// the video window control since it won't work anyway.
|
||||
// If the GStreamer video sink is not available, don't provide the video window control since
|
||||
// it won't work anyway.
|
||||
if (!m_videoWindow->videoSink()) {
|
||||
delete m_videoWindow;
|
||||
m_videoWindow = 0;
|
||||
@@ -133,9 +133,8 @@ CameraBinService::CameraBinService(GstElementFactory *sourceFactory, QObject *pa
|
||||
#if defined(HAVE_WIDGETS)
|
||||
m_videoWidgetControl = new QGstreamerVideoWidgetControl(this);
|
||||
|
||||
// If the GStreamer sink element is not available (xvimagesink or ximagesink), don't provide
|
||||
// the video widget control since it won't work anyway.
|
||||
// QVideoWidget will fall back to QVideoRendererControl in that case.
|
||||
// If the GStreamer video sink is not available, don't provide the video widget control since
|
||||
// it won't work anyway. QVideoWidget will fall back to QVideoRendererControl in that case.
|
||||
if (!m_videoWidgetControl->videoSink()) {
|
||||
delete m_videoWidgetControl;
|
||||
m_videoWidgetControl = 0;
|
||||
|
||||
@@ -102,8 +102,8 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje
|
||||
m_videoRenderer = new QGstreamerVideoRenderer(this);
|
||||
|
||||
m_videoWindow = new QGstreamerVideoWindow(this);
|
||||
// If the GStreamer sink element is not available (xvimagesink), don't provide
|
||||
// the video window control since it won't work anyway.
|
||||
// If the GStreamer video sink is not available, don't provide the video window control since
|
||||
// it won't work anyway.
|
||||
if (!m_videoWindow->videoSink()) {
|
||||
delete m_videoWindow;
|
||||
m_videoWindow = 0;
|
||||
@@ -112,9 +112,8 @@ QGstreamerCaptureService::QGstreamerCaptureService(const QString &service, QObje
|
||||
#if defined(HAVE_WIDGETS)
|
||||
m_videoWidgetControl = new QGstreamerVideoWidgetControl(this);
|
||||
|
||||
// If the GStreamer sink element is not available (xvimagesink or ximagesink), don't provide
|
||||
// the video widget control since it won't work anyway.
|
||||
// QVideoWidget will fall back to QVideoRendererControl in that case.
|
||||
// If the GStreamer video sink is not available, don't provide the video widget control since
|
||||
// it won't work anyway. QVideoWidget will fall back to QVideoRendererControl in that case.
|
||||
if (!m_videoWidgetControl->videoSink()) {
|
||||
delete m_videoWidgetControl;
|
||||
m_videoWidgetControl = 0;
|
||||
|
||||
@@ -99,8 +99,8 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent):
|
||||
#else
|
||||
m_videoWindow = new QGstreamerVideoWindow(this);
|
||||
#endif
|
||||
// If the GStreamer sink element is not available (xvimagesink), don't provide
|
||||
// the video window control since it won't work anyway.
|
||||
// If the GStreamer video sink is not available, don't provide the video window control since
|
||||
// it won't work anyway.
|
||||
if (!m_videoWindow->videoSink()) {
|
||||
delete m_videoWindow;
|
||||
m_videoWindow = 0;
|
||||
@@ -109,8 +109,8 @@ QGstreamerPlayerService::QGstreamerPlayerService(QObject *parent):
|
||||
#if defined(HAVE_WIDGETS)
|
||||
m_videoWidget = new QGstreamerVideoWidgetControl(this);
|
||||
|
||||
// If the GStreamer sink element is not available (xvimagesink or ximagesink), don't provide
|
||||
// the video widget control since it won't work anyway.
|
||||
// If the GStreamer video sink is not available, don't provide the video widget control since
|
||||
// it won't work anyway.
|
||||
// QVideoWidget will fall back to QVideoRendererControl in that case.
|
||||
if (!m_videoWidget->videoSink()) {
|
||||
delete m_videoWidget;
|
||||
|
||||
Reference in New Issue
Block a user