-
Notifications
You must be signed in to change notification settings - Fork 17
/
AviWriter.h
55 lines (40 loc) · 1.2 KB
/
AviWriter.h
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
55
//
// AVI File Writer
//
#ifndef __AVIFILEWRITER_INCLUDED__
#define __AVIFILEWRITER_INCLUDED__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <vfw.h>
class CAVIWriter
{
public:
CAVIWriter();
virtual ~CAVIWriter();
bool Open( const char* fname );
void Close();
bool IsAviRecord() { return m_pAviFile?true:false; }
bool SelectVideoFormat( HWND hWnd );
void SetVideoFormat( BITMAPINFOHEADER* bih );
void SetAudioFormat( const DWORD rate, const WORD bits, const INT channels );
void SetFrameRate( const DWORD scale, const DWORD rate );
bool WriteVideo( const char* video );
bool WriteAudio( const char* audio, const int length );
bool WriteFrame( const char* video, const char* audio, const int length );
protected:
private:
LONG m_FrameNumber;
LONG m_SampleNumber;
DWORD m_FrameRate;
PAVIFILE m_pAviFile;
PAVISTREAM m_pVideoStream;
PAVISTREAM m_pVideoStreamCompress;
PAVISTREAM m_pAudioStream;
AVISTREAMINFO m_VideoStreamInfo;
AVISTREAMINFO m_AudioStreamInfo;
AVICOMPRESSOPTIONS m_VideoOption;
COMPVARS m_Compvers;
BITMAPINFOHEADER* m_pVideoFormat;
WAVEFORMATEX m_AudioFormat;
};
#endif // !__AVIFILEWRITER_INCLUDED__