Commit 95699d00 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4631 from DonLakeFlyer/VideoSourceSignal

Handle videoSource changes correctly
parents 418631ac 141b4285
...@@ -56,6 +56,7 @@ VideoManager::setToolbox(QGCToolbox *toolbox) ...@@ -56,6 +56,7 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
_videoSettings = toolbox->settingsManager()->videoSettings(); _videoSettings = toolbox->settingsManager()->videoSettings();
QString videoSource = _videoSettings->videoSource()->rawValue().toString(); QString videoSource = _videoSettings->videoSource()->rawValue().toString();
connect(_videoSettings->videoSource(), &Fact::rawValueChanged, this, &VideoManager::_videoSourceChanged);
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
#ifndef QGC_DISABLE_UVC #ifndef QGC_DISABLE_UVC
...@@ -91,6 +92,12 @@ VideoManager::setToolbox(QGCToolbox *toolbox) ...@@ -91,6 +92,12 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
#endif #endif
} }
void VideoManager::_videoSourceChanged(void)
{
emit hasVideoChanged();
emit isGStreamerChanged();
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool bool
VideoManager::hasVideo() VideoManager::hasVideo()
......
...@@ -67,11 +67,13 @@ signals: ...@@ -67,11 +67,13 @@ signals:
void isGStreamerChanged (); void isGStreamerChanged ();
void videoSourceIDChanged (); void videoSourceIDChanged ();
private slots:
void _videoSourceChanged(void);
private: private:
void _updateTimer (); void _updateTimer ();
void _updateVideo (); void _updateVideo ();
private:
VideoSurface* _videoSurface; VideoSurface* _videoSurface;
VideoReceiver* _videoReceiver; VideoReceiver* _videoReceiver;
bool _videoRunning; bool _videoRunning;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment