diff --git a/src/VideoManager/VideoManager.cc b/src/VideoManager/VideoManager.cc index 01e61211b793de2bef945cf7d2cc382d69b59f58..b38188b00e6eb840a838fc2aa88ef32923e2af6c 100644 --- a/src/VideoManager/VideoManager.cc +++ b/src/VideoManager/VideoManager.cc @@ -71,7 +71,7 @@ VideoManager::~VideoManager() } #if defined(QGC_GST_STREAMING) if (_videoSink[i] != nullptr) { - GStreamer::releaseVideoSink(_videoSink[i]); + qgcApp()->toolbox()->corePlugin()->releaseVideoSink(_videoSink[i]); _videoSink[i] = nullptr; } #endif diff --git a/src/api/QGCCorePlugin.cc b/src/api/QGCCorePlugin.cc index 9c994b18d2b855f58364259a7e64744bec153695..d40477744b1e1ee0c06b84773521d994c7659440 100644 --- a/src/api/QGCCorePlugin.cc +++ b/src/api/QGCCorePlugin.cc @@ -485,6 +485,15 @@ void* QGCCorePlugin::createVideoSink(QObject* parent, QQuickItem* widget) #endif } +void QGCCorePlugin::releaseVideoSink(void* sink) +{ +#if defined(QGC_GST_STREAMING) + GStreamer::releaseVideoSink(sink); +#else + Q_UNUSED(sink) +#endif +} + bool QGCCorePlugin::guidedActionsControllerLogging() const { return GuidedActionsControllerLog().isDebugEnabled(); diff --git a/src/api/QGCCorePlugin.h b/src/api/QGCCorePlugin.h index 772862bdf97efb6f0c1dc298da433d6a481a0125..83e7b3595f5f234c9192c84314bc9e2f130620d0 100644 --- a/src/api/QGCCorePlugin.h +++ b/src/api/QGCCorePlugin.h @@ -119,6 +119,8 @@ public: virtual VideoReceiver* createVideoReceiver(QObject* parent); /// Allows the plugin to override the creation of VideoSink. virtual void* createVideoSink(QObject* parent, QQuickItem* widget); + /// Allows the plugin to override the release of VideoSink. + virtual void releaseVideoSink(void* sink); /// Allows the plugin to see all mavlink traffic to a vehicle /// @return true: Allow vehicle to continue processing, false: Vehicle should not process message