forked from jnohlgard/python-v4l2capture
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmfvideooutfile.h
More file actions
55 lines (43 loc) · 1.24 KB
/
mfvideooutfile.h
File metadata and controls
55 lines (43 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef MFVIDEOOUT_H
#define MFVIDEOOUT_H
#include <vector>
#include <string>
#include <Mfidl.h>
#include <Mfreadwrite.h>
#include "base.h"
class MfVideoOutFile : public Base_Video_Out
{
public:
MfVideoOutFile(const char *devName);
virtual ~MfVideoOutFile();
void OpenFile();
void CloseFile();
void SendFrame(const char *imgIn, unsigned imgLen, const char *pxFmt, int width, int height,
unsigned long tv_sec = 0,
unsigned long tv_usec = 0);
void Stop();
int WaitForStop();
virtual void SetOutputSize(int width, int height);
virtual void SetOutputPxFmt(const char *fmt);
virtual void SetFrameRate(unsigned int frameRateIn);
virtual void SetVideoCodec(const char *codec, unsigned int bitrate);
void MfVideoOutFile::CopyFromBufferToOutFile(int lastFrame = 0);
void Run();
protected:
IMFSinkWriter *pSinkWriter;
DWORD streamIndex;
LONGLONG rtStart;
UINT64 rtDuration;
std::string pxFmt;
std::string videoCodec;
std::wstring fina;
int outputWidth, outputHeight;
UINT32 bitRate, frameRateFps;
FILETIME startVideoTime;
std::vector<class FrameMetaData> outBufferMeta;
std::vector<std::string> outBuffer;
LONGLONG prevFrameDuration;
IMFByteStream *pIByteStream;
};
void *MfVideoOut_File_Worker_thread(void *arg);
#endif //MFVIDEOOUT_H