summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gstreamer/camerabin')
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.cpp14
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinservice.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.cpp b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
index 969955f8a..e4aa594d5 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.cpp
@@ -121,9 +121,23 @@ 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 (!m_videoWindow->videoSink()) {
+ delete m_videoWindow;
+ m_videoWindow = 0;
+ }
#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 (!m_videoWidgetControl->videoSink()) {
+ delete m_videoWidgetControl;
+ m_videoWidgetControl = 0;
+ }
#endif
m_audioInputSelector = new QGstreamerAudioInputSelector(this);
diff --git a/src/plugins/gstreamer/camerabin/camerabinservice.h b/src/plugins/gstreamer/camerabin/camerabinservice.h
index cadae6e88..a38e36034 100644
--- a/src/plugins/gstreamer/camerabin/camerabinservice.h
+++ b/src/plugins/gstreamer/camerabin/camerabinservice.h
@@ -48,6 +48,7 @@ class CameraBinControl;
class QGstreamerMessage;
class QGstreamerBusHelper;
class QGstreamerVideoRenderer;
+class QGstreamerVideoWindow;
class QGstreamerVideoWidgetControl;
class QGstreamerElementFactory;
class CameraBinMetaData;
@@ -79,7 +80,7 @@ private:
QMediaControl *m_videoOutput;
QMediaControl *m_videoRenderer;
- QMediaControl *m_videoWindow;
+ QGstreamerVideoWindow *m_videoWindow;
#if defined(HAVE_WIDGETS)
QGstreamerVideoWidgetControl *m_videoWidgetControl;
#endif