summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2024-03-05 08:14:02 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-05 14:18:23 +0000
commitf17aff8edeb52e4169a24596d2bdde4881d1a52d (patch)
tree9cbe3a7decca3acb547cbbc36698e6a51c276ebf
parent6e803f71decbb73e8cbd0707b576d9d5f6b58b37 (diff)
GStreamer: small API improvements
`syncChildrenState` can be used to sync the state of all children of a bin. Pick-to: 6.6 6.5 Change-Id: Ie5bba41346c9d9e88c9299e4c84c1b2a6f46233d Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 8f2c79f74e69aea4b6d8181b026594cf4ef7b57a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/multimedia/gstreamer/common/qgst_p.h2
-rw-r--r--src/plugins/multimedia/gstreamer/mediacapture/qgstreamercamera.cpp9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/multimedia/gstreamer/common/qgst_p.h b/src/plugins/multimedia/gstreamer/common/qgst_p.h
index f2f82a9b7..4da684d76 100644
--- a/src/plugins/multimedia/gstreamer/common/qgst_p.h
+++ b/src/plugins/multimedia/gstreamer/common/qgst_p.h
@@ -700,6 +700,8 @@ public:
{
gst_element_add_pad(element(), gst_ghost_pad_new(name, pad.pad()));
}
+
+ bool syncChildrenState() { return gst_bin_sync_children_states(bin()); }
};
inline QGstStructure QGValue::toStructure() const
diff --git a/src/plugins/multimedia/gstreamer/mediacapture/qgstreamercamera.cpp b/src/plugins/multimedia/gstreamer/mediacapture/qgstreamercamera.cpp
index 9473ef019..c1aaab818 100644
--- a/src/plugins/multimedia/gstreamer/mediacapture/qgstreamercamera.cpp
+++ b/src/plugins/multimedia/gstreamer/mediacapture/qgstreamercamera.cpp
@@ -112,10 +112,11 @@ void QGstreamerCamera::setCamera(const QCameraDevice &camera)
qLinkGstElements(gstNewCamera, gstCapsFilter, gstNewDecode, gstVideoConvert);
// Start sending frames once pipeline is linked
- // FIXME: put camera to READY state before linking to decoder as in the NULL state it does not know its true caps
- gstCapsFilter.syncStateWithParent();
- gstNewDecode.syncStateWithParent();
- gstNewCamera.syncStateWithParent();
+ // FIXME: put camera to READY state before linking to decoder as in the NULL state it does not
+ // know its true caps
+
+ gstCameraBin.syncChildrenState();
+
gstCamera = gstNewCamera;
gstDecode = gstNewDecode;