14 changed files with 126 additions and 70 deletions
@ -0,0 +1,39 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#include "CustomVideoManager.h" |
||||||
|
#include "MultiVehicleManager.h" |
||||||
|
#include "CustomCameraManager.h" |
||||||
|
#include "CustomCameraControl.h" |
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
CustomVideoManager::CustomVideoManager(QGCApplication* app, QGCToolbox* toolbox) |
||||||
|
: VideoManager(app, toolbox) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void |
||||||
|
CustomVideoManager::_updateSettings() |
||||||
|
{ |
||||||
|
if(!_videoSettings || !_videoReceiver) |
||||||
|
return; |
||||||
|
//-- Check encoding
|
||||||
|
if(_activeVehicle && _activeVehicle->dynamicCameras()) { |
||||||
|
CustomCameraControl* pCamera = dynamic_cast<CustomCameraControl*>(_activeVehicle->dynamicCameras()->currentCameraInstance()); |
||||||
|
if(pCamera) { |
||||||
|
Fact *fact = pCamera->videoEncoding(); |
||||||
|
if (fact) { |
||||||
|
_videoReceiver->setVideoDecoder(static_cast<VideoReceiver::VideoEncoding>(fact->rawValue().toInt())); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
VideoManager::_updateSettings(); |
||||||
|
} |
||||||
|
|
@ -0,0 +1,28 @@ |
|||||||
|
/****************************************************************************
|
||||||
|
* |
||||||
|
* (c) 2009-2019 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
|
||||||
|
* |
||||||
|
* QGroundControl is licensed according to the terms in the file |
||||||
|
* COPYING.md in the root of the source code directory. |
||||||
|
* |
||||||
|
****************************************************************************/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <QObject> |
||||||
|
#include <QTimer> |
||||||
|
#include <QTime> |
||||||
|
#include <QUrl> |
||||||
|
|
||||||
|
#include "VideoManager.h" |
||||||
|
|
||||||
|
class CustomVideoManager : public VideoManager |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
public: |
||||||
|
CustomVideoManager (QGCApplication* app, QGCToolbox* toolbox); |
||||||
|
|
||||||
|
protected: |
||||||
|
void _updateSettings (); |
||||||
|
|
||||||
|
}; |
Loading…
Reference in new issue