Merge remote-tracking branch 'origin/5.4' into 5.5
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Tue, 24 Feb 2015 16:38:46 +0000 (17:38 +0100)
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Tue, 24 Feb 2015 16:38:46 +0000 (17:38 +0100)
Conflicts:
qtmultimedia.pro
src/gsttools/qgstreamervideowidget.cpp
src/plugins/gstreamer/camerabin/camerabinservice.cpp

Change-Id: I883f20dc17924ab42514a1aa00d16675a0f13d99

1  2 
qtmultimedia.pro
src/gsttools/qgstreamervideowidget.cpp
src/plugins/gstreamer/camerabin/camerabinservice.cpp
src/plugins/gstreamer/camerabin/camerabinservice.h
src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.cpp
src/plugins/gstreamer/mediacapture/qgstreamercaptureservice.h
src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.cpp
src/plugins/gstreamer/mediaplayer/qgstreamerplayerservice.h

@@@ -15,18 -15,9 +15,18 @@@ win32 
  } else:qnx {
      qtCompileTest(mmrenderer)
  } else {
-     qtCompileTest(alsa)
-     qtCompileTest(pulseaudio)
+     contains(QT_CONFIG, alsa):qtCompileTest(alsa)
+     contains(QT_CONFIG, pulseaudio):qtCompileTest(pulseaudio)
 -    qtCompileTest(gstreamer) {
 +
 +    isEmpty(GST_VERSION) {
 +        contains(QT_CONFIG, gstreamer-0.10) {
 +            GST_VERSION = 0.10
 +        } else: contains(QT_CONFIG, gstreamer-1.0) {
 +            GST_VERSION = 1.0
 +        }
 +    }
 +    cache(GST_VERSION, set)
 +    !isEmpty(GST_VERSION):qtCompileTest(gstreamer) {
          qtCompileTest(gstreamer_photography)
          qtCompileTest(gstreamer_encodingprofiles)
          qtCompileTest(gstreamer_appsrc)
@@@ -124,8 -121,23 +124,22 @@@ CameraBinService::CameraBinService(GstE
  #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);
@@@ -82,13 -82,11 +83,13 @@@ private
      QMediaControl *m_videoOutput;
  
      QGstreamerVideoRenderer *m_videoRenderer;
-     QMediaControl *m_videoWindow;
+     QGstreamerVideoWindow *m_videoWindow;
  #if defined(HAVE_WIDGETS)
-     QMediaControl *m_videoWidgetControl;
+     QGstreamerVideoWidgetControl *m_videoWidgetControl;
  #endif
      QGstreamerImageCaptureControl *m_imageCaptureControl;
 +
 +    QGstreamerAudioProbeControl *m_audioProbeControl;
  };
  
  QT_END_NAMESPACE
@@@ -50,10 -50,9 +50,11 @@@ class QGstreamerPlayerSession
  class QGstreamerMetaDataProvider;
  class QGstreamerStreamsControl;
  class QGstreamerVideoRenderer;
+ class QGstreamerVideoWindow;
  class QGstreamerVideoWidgetControl;
  class QGStreamerAvailabilityControl;
 +class QGstreamerAudioProbeControl;
 +class QGstreamerVideoProbeControl;
  
  class QGstreamerPlayerService : public QMediaService
  {
@@@ -72,14 -71,11 +73,14 @@@ private
      QGstreamerStreamsControl *m_streamsControl;
      QGStreamerAvailabilityControl *m_availabilityControl;
  
 +    QGstreamerAudioProbeControl *m_audioProbeControl;
 +    QGstreamerVideoProbeControl *m_videoProbeControl;
 +
      QMediaControl *m_videoOutput;
      QMediaControl *m_videoRenderer;
-     QMediaControl *m_videoWindow;
+     QGstreamerVideoWindow *m_videoWindow;
  #if defined(HAVE_WIDGETS)
-     QMediaControl *m_videoWidget;
+     QGstreamerVideoWidgetControl *m_videoWidget;
  #endif
  
      void increaseVideoRef();