diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-03-20 19:20:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-21 19:16:09 +0100 |
commit | 023c6ebcb9d990042f0e9a750fd6238d22001022 (patch) | |
tree | b98e068ccbdae0a587179d657541cc857c9daf0c /src/gsttools/qgstutils.cpp | |
parent | 60ba0afbde0ef53a12afb6c755ca6fd64aabf5da (diff) | |
download | qtmultimedia-023c6ebcb9d990042f0e9a750fd6238d22001022.tar.gz |
GStreamer: fix memory leaks.
Many GStreamer objects were not properly managed or never released.
Change-Id: I38b3854e8b9e2264b5b647f331d3bb16b886e2d6
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/gsttools/qgstutils.cpp')
-rw-r--r-- | src/gsttools/qgstutils.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gsttools/qgstutils.cpp b/src/gsttools/qgstutils.cpp index e93b46753..41bd005bd 100644 --- a/src/gsttools/qgstutils.cpp +++ b/src/gsttools/qgstutils.cpp @@ -401,4 +401,22 @@ QMultimedia::SupportEstimate QGstUtils::hasSupport(const QString &mimeType, return QMultimedia::MaybeSupported; } +void qt_gst_object_ref_sink(gpointer object) +{ +#if (GST_VERSION_MAJOR >= 0) && (GST_VERSION_MINOR >= 10) && (GST_VERSION_MICRO >= 24) + gst_object_ref_sink(object); +#else + g_return_if_fail (GST_IS_OBJECT(object)); + + GST_OBJECT_LOCK(object); + if (G_LIKELY(GST_OBJECT_IS_FLOATING(object))) { + GST_OBJECT_FLAG_UNSET(object, GST_OBJECT_FLOATING); + GST_OBJECT_UNLOCK(object); + } else { + GST_OBJECT_UNLOCK(object); + gst_object_ref(object); + } +#endif +} + QT_END_NAMESPACE |