Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cAVIFileIndex.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cAVIFileIndex_H
7 #define _INC_cAVIFileIndex_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../UID/cFourCC.h"
15 
16 #if defined(_WIN32) && ! defined(UNDER_CE)
17 #include <vfw.h> // COMPVARS, MainAVIHeader, etc
18 #else
19 #include "../WinAPI/WinTypes.h"
20 #define AVI_HEADERSIZE 2048
21 #define AVIF_MUSTUSEINDEX 0x00000020
22 #define AVIF_ISINTERLEAVED 0x00000100
23 #define AVIF_800 0x00000800 // no idea.
24 #define AVIF_WASCAPTUREFILE 0x00010000
25 #define AVIF_COPYRIGHTED 0x00020000
27 {
28  DWORD dwMicroSecPerFrame; // frame display rate (or 0L)
29  DWORD dwMaxBytesPerSec; // max. transfer rate
30  DWORD dwPaddingGranularity; // pad to multiples of this
31  // size; normally 2K.
32  DWORD dwFlags; // the ever-present flags AVIF_HASINDEX
33  DWORD dwTotalFrames; // # frames in file
35  DWORD dwStreams;
37 
38  DWORD dwWidth;
39  DWORD dwHeight;
40 
41  DWORD dwReserved[4];
42 };
44 {
47  DWORD dwFlags; // Contains AVITF_* flags
48  WORD wPriority;
49  WORD wLanguage;
51  DWORD dwScale;
52  DWORD dwRate; // dwRate / dwScale == samples/second
53  DWORD dwStart;
54  DWORD dwLength; // In units above...
56  DWORD dwQuality; // AV_QUALITY_t
57  DWORD dwSampleSize;
58  RECT rcFrame;
59 };
61 {
63 #define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame.
64  UINT32 dwFlags;
65  UINT32 dwChunkOffset; // Position of chunk
66  UINT32 dwChunkLength; // Length of chunk
67 };
68 #endif
69 
70 #ifdef GRAY_DLL // force implementation/instantiate for DLL/SO.
71 namespace Gray
72 {
73  template class GRAYLIB_LINK cQueueRead<AVIINDEXENTRY>;
74  template class GRAYLIB_LINK cQueueRW<AVIINDEXENTRY>;
75 }
76 #endif
77 
78 namespace GrayLib
79 {
80  typedef UINT32 RIFF_SIZE_t;
81 
83  {
87 
88  public:
89  static const FOURCC k_fccVideoB = MAKEFOURCC('0', '0', 'd', 'b'); // not compressed.
90  static const FOURCC k_fccVideoC = MAKEFOURCC('0', '0', 'd', 'c'); // compressed.
91  static const FOURCC k_fccAudio = MAKEFOURCC('0', '1', 'w', 'b');
92 
93  private:
94  ITERATE_t m_nFramesTotal;
96 
97  public:
98  cAVIFileIndex();
99  ~cAVIFileIndex();
100 
101  void AddFrame(const AVIINDEXENTRY& indexentry);
102  const AVIINDEXENTRY* FindFrame(RIFF_SIZE_t dwChunkOffset) const;
103  HRESULT FlushIndexChunk(cStreamOutput* pSink);
104 
105  ITERATE_t get_FramesTotal() const noexcept
106  {
107  return m_nFramesTotal;
108  }
109  size_t get_ChunkSize() const noexcept
110  {
112  return(m_nFramesTotal * sizeof(AVIINDEXENTRY)); // m_nFramesTotal * 16 bytes
113  }
114  };
115 };
116 
117 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
UINT32 FOURCC
32 bit code. Also defined in _MMSYSTEM_H
Definition: cFourCC.h:19
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: cFourCC.h:24
Definition: cAVIFileIndex.h:83
ITERATE_t get_FramesTotal() const noexcept
Definition: cAVIFileIndex.h:105
size_t get_ChunkSize() const noexcept
Definition: cAVIFileIndex.h:109
Definition: cStream.h:126
Definition: cMesh.h:22
UINT32 RIFF_SIZE_t
32 bit Size limit for any chunk
Definition: cRIFFFormat.h:17
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
int ITERATE_t
like size_t but signed
Definition: Index.h:28
Definition: cAVIFileIndex.h:61
UINT32 dwChunkLength
Definition: cAVIFileIndex.h:66
UINT32 dwChunkOffset
Definition: cAVIFileIndex.h:65
FOURCC ckid
Definition: cAVIFileIndex.h:62
UINT32 dwFlags
Definition: cAVIFileIndex.h:64
Definition: cAVIFileIndex.h:44
DWORD dwInitialFrames
Definition: cAVIFileIndex.h:50
DWORD dwStart
Definition: cAVIFileIndex.h:53
DWORD dwQuality
Definition: cAVIFileIndex.h:56
WORD wLanguage
Definition: cAVIFileIndex.h:49
DWORD dwSampleSize
Definition: cAVIFileIndex.h:57
FOURCC fccHandler
Definition: cAVIFileIndex.h:46
DWORD dwScale
Definition: cAVIFileIndex.h:51
FOURCC fccType
Definition: cAVIFileIndex.h:45
RECT rcFrame
Definition: cAVIFileIndex.h:58
DWORD dwFlags
Definition: cAVIFileIndex.h:47
DWORD dwLength
Definition: cAVIFileIndex.h:54
DWORD dwSuggestedBufferSize
Definition: cAVIFileIndex.h:55
DWORD dwRate
Definition: cAVIFileIndex.h:52
WORD wPriority
Definition: cAVIFileIndex.h:48
Definition: cAVIFileIndex.h:27
DWORD dwTotalFrames
Definition: cAVIFileIndex.h:33
DWORD dwStreams
Definition: cAVIFileIndex.h:35
DWORD dwPaddingGranularity
Definition: cAVIFileIndex.h:30
DWORD dwMaxBytesPerSec
Definition: cAVIFileIndex.h:29
DWORD dwSuggestedBufferSize
Definition: cAVIFileIndex.h:36
DWORD dwHeight
Definition: cAVIFileIndex.h:39
DWORD dwWidth
Definition: cAVIFileIndex.h:38
DWORD dwReserved[4]
Definition: cAVIFileIndex.h:41
DWORD dwMicroSecPerFrame
Definition: cAVIFileIndex.h:28
DWORD dwInitialFrames
Definition: cAVIFileIndex.h:34
DWORD dwFlags
Definition: cAVIFileIndex.h:32