Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cAVIFileWriter.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cAVIFileWriter_H
7 #define _INC_cAVIFileWriter_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "cAVIFileIndex.h"
13 #include "../AV/cAVSink.h"
14 #include "../File/cRIFF.h"
15 #include "GrayCore/include/cFile.h"
16 
17 namespace GrayLib
18 {
20  {
25 
26  public:
27  static const int k_SuggestedBufferSec = 4;
28 
31 
33  UINT32 m_nVideoFrames;
35  UINT32 m_nAudioFrames;
36 
40 
43 
44  public:
45  cAVIFileWriter(cStreamOutput* pOut, bool bWriteOptional = false);
46  virtual ~cAVIFileWriter();
47 
48  HRESULT OnHeaderAudio(const cAVHeaderStream& head, const cWaveFormatEx* pForm, size_t nSizeForm);
49  HRESULT OnHeaderVideo(const cAVHeaderStream& head, const cSurfaceBitmapInfo* pForm, size_t nSizeForm);
50 
51  // cAVSink
52  virtual HRESULT OnHeaderOpen(const cAVHeader& head) override;
53  virtual HRESULT OnHeaderStream(const cAVHeaderStream& head, const void* pForm, size_t nSizeForm) override;
54  virtual HRESULT OnHeaderClose() override;
55  virtual HRESULT OnFrame(const cAVHeaderFrame& head, const void* pData, size_t nSizeData) override;
56  virtual HRESULT OnClose() override;
57 
58  };
59 };
60 #endif // _INC_CAVIFile_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cAVSink.h:80
Definition: cAVSink.h:60
Definition: cAVSink.h:44
Definition: cAVIFileIndex.h:83
Definition: cAVIFileWriter.h:20
MainAVIHeader m_avimh
Build this up to patch at the end.
Definition: cAVIFileWriter.h:39
cAVIFileIndex m_Index
index all the frames we get. Video + Audio. write this last.
Definition: cAVIFileWriter.h:42
UINT32 m_nAudioFrames
Patch this on file close.
Definition: cAVIFileWriter.h:35
bool m_bVideoCompressed
Definition: cAVIFileWriter.h:30
STREAM_POS_t m_nAudioHeader
Offset to the audio header. for patch on close.
Definition: cAVIFileWriter.h:34
RIFF_SIZE_t m_nMoviChunkSize
Total m_nDataSize of the FOURCC_movi chunk in the file as we build it.
Definition: cAVIFileWriter.h:41
STREAM_POS_t m_nVideoHeader
Offset to the video header. for patch on close.
Definition: cAVIFileWriter.h:32
cRIFFHeadX m_headRIFF
Definition: cAVIFileWriter.h:37
cRIFFHeadX m_headLIST
'movi' or 'hdrl'
Definition: cAVIFileWriter.h:38
bool m_bWriteOptional
write the optional parts. 'JUNK'+'strn'
Definition: cAVIFileWriter.h:29
UINT32 m_nVideoFrames
Patch this on file close.
Definition: cAVIFileWriter.h:33
Definition: cAVSink.h:130
Definition: cRIFFFormat.h:99
Definition: cRIFFFormat.h:143
Definition: cSurfaceInfo.h:308
Definition: cWaveFormat.h:73
Definition: cStream.h:126
Definition: cMesh.h:22
UINT32 RIFF_SIZE_t
32 bit Size limit for any chunk
Definition: cRIFFFormat.h:17
ULONG_PTR STREAM_POS_t
NOT same as FILE_SIZE_t in 32 bit. Why not ?
Definition: cOSHandle.h:54
Definition: cAVIFileIndex.h:27