13 #include <libavcodec/avcodec.h> 16 #define VIDEO_WIDTH_MIN 640 17 #define VIDEO_WIDTH_MAX 1920 18 #define VIDEO_HEIGHT_MIN 480 19 #define VIDEO_HEIGHT_MAX 1080 20 #define VIDEO_FRAMERATE_MIN 1 21 #define VIDEO_FRAMERATE_MAX 60 22 #define VIDEO_BITRATE_MIN 128000 23 #define VIDEO_BITRATE_MAX 25000000 24 #define VIDEO_SEGMENT_TARGET 2 // 2 second segments 25 #define VIDEO_GOPDURA_TARGET 1 // with IDR every second 26 #define VIDEO_SEGMENT_NUMBER 10 // 10 segments for a total of 20 buffered seconds 27 #define VIDEO_SEGMENT_MAX 20 28 #define VIDEO_TIMEBASE 90000 29 #define VIDEO_DRIFT_SHORT 60 // short term drift average 30 #define VIDEO_DRIFT_LONG (60*5) // long term drift average 31 #define VIDEO_H264_PROFILE FF_PROFILE_H264_MAIN 72 virtual bool Setup (
void);
73 virtual bool Start (
void) = 0;
74 virtual bool Stop (
void) = 0;
75 QByteArray GetSegment (
int Segment);
76 QByteArray GetInitSegment (
void);
79 virtual void TakeStills (uint Count);
80 virtual void StreamVideo (
bool Video) = 0;
83 void WritingStarted (
void);
84 void WritingStopped (
void);
85 void SegmentRemoved (
int Segment);
86 void InitSegmentReady(
void);
87 void SegmentReady (
int Segment);
88 void SetErrored (
bool Errored);
89 void StillReady (
const QString &File);
94 void TrackDrift (
void);
96 virtual void StartStill (
void) = 0;
97 virtual bool EnableStills (uint Count);
98 void SaveStill (
void);
99 void SaveStillBuffer (quint32 Length, uint8_t* Data);
100 void ClearStillsBuffers (
void);
135 virtual bool CanHandle (
const QString &Type,
const TorcCameraParams &Params) = 0;
137 virtual QString GetCameraName (
void) = 0;
147 #endif // TORCCAMERA_H
TorcAverage< double > m_shortAverage
TorcCameraParams m_params
~TorcCameraParams()=default
QReadWriteLock m_ringBufferLock
TorcAverage< double > m_longAverage
AVPacket * m_bufferedPacket
bool IsCompatible(const TorcCameraParams &Other) const
static TorcCameraFactory * gTorcCameraFactory
TorcCameraParams & operator=(const TorcCameraParams &Other)
TorcCameraFactory * nextTorcCameraFactory
bool operator==(const TorcCameraParams &Other) const
QList< QPair< quint32, uint8_t * > > m_stillsBuffers
TorcCameraParams Combine(const TorcCameraParams &Add)
TorcSegmentedRingBuffer * m_ringBuffer