Commit 17a591ac authored by Matej Frančeškin's avatar Matej Frančeškin Committed by Andrew Voznytsa

Fix video start/stop/restart on error

parent 42c15ee2
...@@ -20,10 +20,10 @@ CustomVideoManager::CustomVideoManager(QGCApplication* app, QGCToolbox* toolbox) ...@@ -20,10 +20,10 @@ CustomVideoManager::CustomVideoManager(QGCApplication* app, QGCToolbox* toolbox)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
CustomVideoManager::_updateSettings() CustomVideoManager::_updateSettings(unsigned id)
{ {
if(!_videoSettings || !_videoReceiver) if(!_videoSettings || !_videoReceiver)
return; return;
VideoManager::_updateSettings(); VideoManager::_updateSettings(id);
} }
...@@ -23,6 +23,6 @@ public: ...@@ -23,6 +23,6 @@ public:
CustomVideoManager (QGCApplication* app, QGCToolbox* toolbox); CustomVideoManager (QGCApplication* app, QGCToolbox* toolbox);
protected: protected:
void _updateSettings (); void _updateSettings (unsigned id);
}; };
This diff is collapsed.
...@@ -88,8 +88,8 @@ public: ...@@ -88,8 +88,8 @@ public:
// FIXME: AV: they should be removed after finishing multiple video stream support // FIXME: AV: they should be removed after finishing multiple video stream support
// new arcitecture does not assume direct access to video receiver from QML side, even if it works for now // new arcitecture does not assume direct access to video receiver from QML side, even if it works for now
virtual VideoReceiver* videoReceiver () { return _videoReceiver; } virtual VideoReceiver* videoReceiver () { return _videoReceiver[0]; }
virtual VideoReceiver* thermalVideoReceiver () { return _thermalVideoReceiver; } virtual VideoReceiver* thermalVideoReceiver () { return _videoReceiver[1]; }
#if defined(QGC_DISABLE_UVC) #if defined(QGC_DISABLE_UVC)
virtual bool uvcEnabled () { return false; } virtual bool uvcEnabled () { return false; }
...@@ -142,11 +142,11 @@ protected: ...@@ -142,11 +142,11 @@ protected:
friend class FinishVideoInitialization; friend class FinishVideoInitialization;
void _initVideo (); void _initVideo ();
bool _updateSettings (); bool _updateSettings (unsigned id);
bool _updateVideoUri (const QString& uri); bool _updateVideoUri (unsigned id, const QString& uri);
bool _updateThermalVideoUri (const QString& uri);
void _cleanupOldVideos (); void _cleanupOldVideos ();
void _restartVideo (); void _restartAllVideos ();
void _restartVideo (unsigned id);
void _startReceiver (unsigned id); void _startReceiver (unsigned id);
void _stopReceiver (unsigned id); void _stopReceiver (unsigned id);
...@@ -155,18 +155,15 @@ protected: ...@@ -155,18 +155,15 @@ protected:
QString _imageFile; QString _imageFile;
SubtitleWriter _subtitleWriter; SubtitleWriter _subtitleWriter;
bool _isTaisync = false; bool _isTaisync = false;
VideoReceiver* _videoReceiver = nullptr; VideoReceiver* _videoReceiver[2] = { nullptr, nullptr };
void* _videoSink[2] = { nullptr, nullptr };
QString _videoUri[2];
bool _videoStarted[2] = { false, false };
QAtomicInteger<bool> _streaming = false; QAtomicInteger<bool> _streaming = false;
QAtomicInteger<bool> _decoding = false; QAtomicInteger<bool> _decoding = false;
QAtomicInteger<bool> _recording = false; QAtomicInteger<bool> _recording = false;
QAtomicInteger<quint32> _videoSize = 0; QAtomicInteger<quint32> _videoSize = 0;
VideoReceiver* _thermalVideoReceiver = nullptr;
bool _enableVideoRestart = false;
void* _videoSink = nullptr;
void* _thermalVideoSink = nullptr;
VideoSettings* _videoSettings = nullptr; VideoSettings* _videoSettings = nullptr;
QString _videoUri;
QString _thermalVideoUri;
QString _videoSourceID; QString _videoSourceID;
bool _fullScreen = false; bool _fullScreen = false;
Vehicle* _activeVehicle = nullptr; Vehicle* _activeVehicle = nullptr;
......
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