You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
4.8 KiB
142 lines
4.8 KiB
//----------------------------------------------------------------------------
|
|
// Dr.Frucht Systems Ltd.
|
|
// Copyright © 2000-2017. All Rights Reserved.
|
|
// Version 2.0 6/11/2019
|
|
// Last modification: 6/11/2019
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: rgooseIPCamera.h
|
|
// AUTHOR: gagua
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of rgooseIPCamera.h
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
#ifndef __ARGUS_CAMERA_HEADER__
|
|
#define __ARGUS_CAMERA_HEADER__
|
|
|
|
#include <vector>
|
|
#include <queue>
|
|
#include "../components/base/basicThread.h"
|
|
#include "../components/base/basicMutex.h"
|
|
#include "../data/protocol/protocolPTZ.h"
|
|
#include "../data/media/video/videoAVLIBSource.h"
|
|
#include "../components/base/basicEventHeap.h"
|
|
#include "rgooseDBConnector.h"
|
|
|
|
//https://www.ebay.com/itm/Professional-Rolling-Makeup-Case-Bulb-Mirror-Cosmetic-Artist-Dressing-Train-Case/233264525474
|
|
|
|
//ffmpeg -i input.mp4 -af loudnorm=I=-23:LRA=7:tp=-2:print_format=json -f null -
|
|
//ffmpeg -i input.mp4 -af loudnorm=I=-23:LRA=7:tp=-2:measured_I=-30:measured_LRA=1.1:measured_tp=-11 04:measured_thresh=-40.21:offset=-0.47 -ar 48k -y output.mp4
|
|
|
|
#define CAM_CTRL_PROTO_VISCA 1
|
|
#define CAM_CTRL_PROTO_PELCO 2
|
|
#define CAM_CTRL_PROTO_ONVIF 3
|
|
#define CAM_CTRL_PROTO_PSIA 4
|
|
#define CAM_CTRL_PROTO_T28181 5
|
|
|
|
#define UART_TYPE_HARDWARE 1
|
|
#define UART_TYPE_SOL 2
|
|
|
|
#define ARGUS_CAM_PCMD_MOVE_MASK 0x7F
|
|
#define ARGUS_CAM_PCMD_CMD_MASK 0x80
|
|
#define ARGUS_CAM_PCMD_STOP 1
|
|
|
|
|
|
typedef struct S_CAM_PTZ_CMD{
|
|
uint8_t CMD;
|
|
float PAN;
|
|
float TILT;
|
|
float ZOOM;
|
|
}CAM_PTZ_CMD;
|
|
|
|
typedef enum E_CAM_PTZ_CMD{
|
|
PTZ_STOP = 0,
|
|
PTZ_MOVE = 1,
|
|
PTZ_ABSOLUTE = 2,
|
|
PTZ_RELOAD_CAMERA = 3,
|
|
PTZ_CAPTURE_ONLY = 4
|
|
}PTZ_CMD;
|
|
|
|
typedef std::queue<CAM_PTZ_CMD *> CAM_PTZ_CMD_QUEUE;
|
|
|
|
typedef enum E_CAM_WORKING_STATE{
|
|
CAM_WS_INIT = 0,
|
|
CAM_WS_WHITE_BALLANCE = 1,
|
|
CAM_WS_BACKLIGHT = 2,
|
|
CAM_WS_AUTO_FOCUS = 3,
|
|
CAM_WS_INIT_GO_HOME = 4,
|
|
CAM_WS_AUTOMATED_MOVE = 10,
|
|
CAM_WS_STOP_MOVE = 11,
|
|
CAM_WS_READY = 128,
|
|
CAM_WS_END = 255
|
|
}CAM_WORK_STATE;
|
|
|
|
typedef struct S_CAM_TASK{
|
|
bool isDone;
|
|
uint32_t source_evt_id;
|
|
bool movemet_needed;
|
|
CAM_PTZ_CMD * CMD;
|
|
} CAM_TASK;
|
|
|
|
typedef std::queue<CAM_TASK *> CAM_TASK_QUEUE;
|
|
|
|
class ARGUS_Camera: public basicThread {
|
|
private:
|
|
basicLogCollection * m_pLog;
|
|
basicPosition * m_pPosition;
|
|
argusDBC * m_pDBC;
|
|
time_t m_tTimeTSeconds;
|
|
|
|
uint8_t m_bState;
|
|
bool m_bBusy;
|
|
|
|
|
|
float m_fMaxRange;
|
|
float m_fMinHFov;
|
|
float m_fMaxHFov;
|
|
float m_fMinVFov;
|
|
float m_fMaxVFov;
|
|
|
|
protocolPTZ * m_pProtocol;
|
|
basicTransport * m_pTransport;
|
|
|
|
CAM_TASK_QUEUE m_qCAM_TASK;
|
|
//basicMutex m_mQPROTECTOR;
|
|
|
|
videoAVLIBSource * m_pSource;
|
|
uint32_t m_nRelativeMoveCounter;
|
|
uint8_t m_bRelativeMoveMatrix;
|
|
float m_fSpeedRise;
|
|
float m_fRM_Pan;
|
|
float m_fRM_Tilt;
|
|
float m_fRM_Zoom;
|
|
|
|
/* Methotds Sutable to Control Camera */
|
|
bool relativeMove( float PanSPD, float TiltSPD, float ZoomSPD );
|
|
bool relativeStop();
|
|
bool absoluteMove( uint32_t RefID, float PanPOS, float TiltPOS, float ZoomPOS );
|
|
|
|
protected:
|
|
DBC_CAM_DATA m_sCamData;
|
|
MEDIA_SOURCE_DESC m_sMediaSource;
|
|
basicEventHeap * m_pBEH;
|
|
bool m_bSourceConnected;
|
|
bool inTheFOV( float lat, float lon, float alt );
|
|
bool lookAtWGS84( uint32_t TargetRefID, float lat, float lon, float alt );
|
|
bool makeSnap( uint32_t TargetRefID );
|
|
void setBusy( bool Status );
|
|
bool connectToStream( uint32_t id );
|
|
bool disconnectFromStream( void );
|
|
bool validateStream( void );
|
|
virtual void m_fThreadProc( void );
|
|
public:
|
|
ARGUS_Camera();
|
|
~ARGUS_Camera();
|
|
bool create( uint32_t CameraID );
|
|
|
|
};
|
|
|
|
typedef std::vector<ARGUS_Camera *> vectorARGUS_Cameras;
|
|
|
|
#endif
|