summaryrefslogtreecommitdiffstats
path: root/src/multimediawidgets/qvideowidget.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-01-12 14:22:08 +0100
committerLars Knoll <lars.knoll@qt.io>2021-01-22 07:02:55 +0000
commit98148969b112f82d2b49e77950ea5f6d8b37b8b2 (patch)
tree48fffe0533a647bb53bec7e6e33dee1b95fcd849 /src/multimediawidgets/qvideowidget.cpp
parentb947bcabfef5f0df32a4e09b55eaa581281b4edd (diff)
Get rid of plugins for MM backends
There's no need for having those in plugins and we can further remove abstractions and simplify our code if the code is directly compiled into Qt Multimedia. Change-Id: I5267a6a776375d99be8f0de4207f0288d963e620 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimediawidgets/qvideowidget.cpp')
-rw-r--r--src/multimediawidgets/qvideowidget.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/multimediawidgets/qvideowidget.cpp b/src/multimediawidgets/qvideowidget.cpp
index 742dff6d3..2edbd6af6 100644
--- a/src/multimediawidgets/qvideowidget.cpp
+++ b/src/multimediawidgets/qvideowidget.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <private/qtmultimediaglobal_p.h>
#include "qvideowidget_p.h"
#include "qpaintervideosurface_p.h"
@@ -57,6 +58,11 @@
#include <qwindow.h>
#include <private/qhighdpiscaling_p.h>
+#if QT_CONFIG(gstreamer)
+#include <private/qgstreamervideowidget_p.h>
+#elif QT_CONFIG(avfoundation)
+#include <private/avfvideowidgetcontrol_p.h>
+#endif
#ifdef Q_OS_WIN
#include <QtCore/qt_windows.h>
#endif
@@ -491,17 +497,24 @@ void QVideoWidgetPrivate::clearService()
bool QVideoWidgetPrivate::createWidgetBackend()
{
- if (QObject *control = service->requestControl(QVideoWidgetControl_iid)) {
- if (QVideoWidgetControl *widgetControl = qobject_cast<QVideoWidgetControl *>(control)) {
- widgetBackend = new QVideoWidgetControlBackend(service, widgetControl, q_func());
-
- setCurrentControl(widgetBackend);
+ QVideoWidgetControl *widgetControl = nullptr;
+#if QT_CONFIG(gstreamer)
+// widgetControl = new QGstreamerVideoWidgetControl(q_ptr);
+ // 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 (!widgetControl->videoSink()) {
+// delete widgetControl;
+// widgetControl = nullptr;
+// }
+ // ### need to set the widget as the video output on the service currently
+#elif QT_CONFIG(avfoundation)
+// widgetControl = new AVFVideoWidgetControl(q_ptr);
+ // #####m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
+#endif
+ if (widgetControl)
+ setCurrentControl(widgetBackend);
- return true;
- }
- service->releaseControl(control);
- }
- return false;
+ return widgetControl != nullptr;
}
bool QVideoWidgetPrivate::createWindowBackend()