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.
45 lines
1.5 KiB
45 lines
1.5 KiB
#ifndef __LAPSED_VIDEO_RECORDER_HEADER__
|
|
#define __LAPSED_VIDEO_RECORDER_HEADER__
|
|
#include <queue>
|
|
#include "video/videoAVLIBDestination.h"
|
|
#include "../../components/base/basicEventHandler.h"
|
|
#include "../../components/base/basicMutex.h"
|
|
#include "../../components/base/basicEventHeap.h"
|
|
|
|
typedef struct S_FRAME_QUEUE_ITEM{
|
|
long long TS;
|
|
cv::Mat *FRAME;
|
|
} FRAME_QUEUE_ITEM;
|
|
|
|
typedef queue<FRAME_QUEUE_ITEM *> FRAME_QUEUE;
|
|
|
|
class lapsedVideoRecorder : public basicMediaDestination, public basicEventHandler {
|
|
private:
|
|
bool m_bLapseByTime;
|
|
bool m_bOutputIsStarted;
|
|
FRAME_QUEUE m_vTimeLapse;
|
|
uint32_t m_nTimeLapse;
|
|
uint32_t m_nTimeToSave;
|
|
uint32_t m_nFrameLapse;
|
|
uint32_t m_nFrameToSave;
|
|
uint32_t m_nCurrentFrame;
|
|
basicMutex m_mProtecor;
|
|
CSTR m_pCurrentOutput;
|
|
videoAVLIBDestination * m_pRealOutput;
|
|
public:
|
|
lapsedVideoRecorder();
|
|
~lapsedVideoRecorder();
|
|
virtual void pushFrame( cv::Mat *Frame );
|
|
virtual void dispatchEvent( basicEvent *Evt );
|
|
void setTargetOutput( CSTR FileName );
|
|
void setTimeLapse( uint32_t milliseconds );
|
|
void setFrameLapse( uint32_t frames );
|
|
bool beginOutput( CSTR FileName );
|
|
bool continueOutput( void );
|
|
bool finishOutput( void );
|
|
bool getRecordStatus( void ){ return m_bOutputIsStarted; };
|
|
uint32_t getCurrentFrame( void ){ return m_nCurrentFrame; };
|
|
CSTR getOutputName( void ){ return m_pCurrentOutput; };
|
|
};
|
|
|
|
#endif
|