convert some printfs to mp_msg
[mplayer/glamo.git] / loader / dshow / libwin32.h
blob09db8855de505b5b9a972f90c5d53b46474a948b
1 #ifndef __LIBWIN32_H
2 #define __LIBWIN32_H
4 #ifndef NOAVIFILE_HEADERS
5 #error this header file should not be used without -DNOAVIFILE_HEADERS
6 #endif
8 // this file is only included when NOAVIFILE_HEADERS are defined
9 // serves mainly for mplayer
11 #define VFW_E_NOT_RUNNING 0x80040226
13 #include <inttypes.h>
15 //#define FATAL(a) // you don't need exception - if you want - just fill more code
16 #include "wine/mmreg.h"
17 #include "wine/winreg.h"
18 #include "wine/vfw.h"
19 #include "com.h"
21 typedef uint32_t fourcc_t;
24 typedef struct _FatalError
26 FatalError();
27 void PrintAll() {}
28 }FatalError;
31 typedef struct _CodecInfo
33 char* dll;
34 GUID* guid;
35 }CodecInfo;
38 typedef struct _CImage // public your_libvo_mem
40 char* ptr;
42 /*char* (*Data)();
44 return 0;
45 // pointer to memory block
46 }*/
47 /*int (*Supported)(fourcc_t csp, int bits);
49 return true;
50 // if you support such surface
51 }*/
52 }CImage;
55 #if 0
56 struct BitmapInfo : public BITMAPINFOHEADER
58 void SetBits(int b) { return; /*fixme*/ }
59 void SetSpace(int b) { return; /*fixme*/ }
61 #endif
63 typedef struct _IAudioDecoder
65 WAVEFORMATEX in_fmt;
66 CodecInfo record;
67 /*(*IAudioDecoder)( CodecInfo * r, const WAVEFORMATEX* w);
69 memcpy(&this->record,r,sizeof(CodecInfo));
70 in_fmt = *w;
71 }*/
72 }IAudioDecoder;
75 struct IAudioEncoder
77 IAudioEncoder(const CodecInfo&, WAVEFORMATEX*) {}
78 // you do not need this one...
82 enum CAPS
84 CAP_NONE = 0,
85 CAP_YUY2 = 1,
86 CAP_YV12 = 2,
87 CAP_IYUV = 4,
88 CAP_UYVY = 8,
89 CAP_YVYU = 16,
90 CAP_I420 = 32,
91 CAP_YVU9 = 64,
92 CAP_IF09 = 128,
94 enum DecodingMode
96 DIRECT = 0,
97 REALTIME,
98 REALTIME_QUALITY_AUTO,
100 enum DecodingState
102 STOP = 0,
103 START,
106 typedef struct _BitmapInfo
108 long biSize;
109 long biWidth;
110 long biHeight;
111 short biPlanes;
112 short biBitCount;
113 long biCompression;
114 long biSizeImage;
115 long biXPelsPerMeter;
116 long biYPelsPerMeter;
117 long biClrUsed;
118 long biClrImportant;
119 int colors[3];
120 } BitmapInfo;
122 typedef struct _IVideoDecoder
124 int VBUFSIZE;
125 int QMARKHI;
126 int QMARKLO;
127 int DMARKHI;
128 int DMARKLO;
131 IVideoDecoder(CodecInfo& info, const BITMAPINFOHEADER& format) : record(info)
133 // implement init part
135 virtual ~IVideoDecoder();
136 void Stop()
139 void Start()
143 const CodecInfo record;
144 int m_Mode; // should we do precaching (or even change Quality on the fly)
145 int m_State;
146 int m_iDecpos;
147 int m_iPlaypos;
148 float m_fQuality; // quality for the progress bar 0..1(best)
149 int m_bCapable16b;
151 BITMAPINFOHEADER* m_bh; // format of input data (might be larger - e.g. huffyuv)
152 BitmapInfo m_decoder; // format of decoder output
153 BitmapInfo m_obh; // format of returned frames
154 }IVideoDecoder;
157 struct IRtConfig
162 // might be minimalized to contain just those which are needed by DS_VideoDecoder
164 #ifndef mmioFOURCC
165 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
166 ( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) | \
167 ( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) )
168 #endif /* mmioFOURCC */
170 /* OpenDivX */
171 #define fccMP4S mmioFOURCC('M', 'P', '4', 'S')
172 #define fccmp4s mmioFOURCC('m', 'p', '4', 's')
173 #define fccDIVX mmioFOURCC('D', 'I', 'V', 'X')
174 #define fccdivx mmioFOURCC('d', 'i', 'v', 'x')
175 #define fccDIV1 mmioFOURCC('D', 'I', 'V', '1')
176 #define fccdiv1 mmioFOURCC('d', 'i', 'v', '1')
178 /* DivX codecs */
179 #define fccDIV2 mmioFOURCC('D', 'I', 'V', '2')
180 #define fccdiv2 mmioFOURCC('d', 'i', 'v', '2')
181 #define fccDIV3 mmioFOURCC('D', 'I', 'V', '3')
182 #define fccdiv3 mmioFOURCC('d', 'i', 'v', '3')
183 #define fccDIV4 mmioFOURCC('D', 'I', 'V', '4')
184 #define fccdiv4 mmioFOURCC('d', 'i', 'v', '4')
185 #define fccDIV5 mmioFOURCC('D', 'I', 'V', '5')
186 #define fccdiv5 mmioFOURCC('d', 'i', 'v', '5')
187 #define fccDIV6 mmioFOURCC('D', 'I', 'V', '6')
188 #define fccdiv6 mmioFOURCC('d', 'i', 'v', '6')
189 #define fccMP41 mmioFOURCC('M', 'P', '4', '1')
190 #define fccmp41 mmioFOURCC('m', 'p', '4', '1')
191 #define fccMP43 mmioFOURCC('M', 'P', '4', '3')
192 #define fccmp43 mmioFOURCC('m', 'p', '4', '3')
193 /* old ms mpeg-4 codecs */
194 #define fccMP42 mmioFOURCC('M', 'P', '4', '2')
195 #define fccmp42 mmioFOURCC('m', 'p', '4', '2')
196 #define fccMPG4 mmioFOURCC('M', 'P', 'G', '4')
197 #define fccmpg4 mmioFOURCC('m', 'p', 'g', '4')
198 /* Windows media codecs */
199 #define fccWMV1 mmioFOURCC('W', 'M', 'V', '1')
200 #define fccwmv1 mmioFOURCC('w', 'm', 'v', '1')
201 #define fccWMV2 mmioFOURCC('W', 'M', 'V', '2')
202 #define fccwmv2 mmioFOURCC('w', 'm', 'v', '2')
203 #define fccMWV1 mmioFOURCC('M', 'W', 'V', '1')
205 /* Angel codecs */
206 #define fccAP41 mmioFOURCC('A', 'P', '4', '1')
207 #define fccap41 mmioFOURCC('a', 'p', '4', '1')
208 #define fccAP42 mmioFOURCC('A', 'P', '4', '2')
209 #define fccap42 mmioFOURCC('a', 'p', '4', '2')
211 /* other codecs */
212 #define fccIV31 mmioFOURCC('I', 'V', '3', '1')
213 #define fcciv31 mmioFOURCC('i', 'v', '3', '1')
214 #define fccIV32 mmioFOURCC('I', 'V', '3', '2')
215 #define fcciv32 mmioFOURCC('i', 'v', '3', '2')
216 #define fccIV41 mmioFOURCC('I', 'V', '4', '1')
217 #define fcciv41 mmioFOURCC('i', 'v', '4', '1')
218 #define fccIV50 mmioFOURCC('I', 'V', '5', '0')
219 #define fcciv50 mmioFOURCC('i', 'v', '5', '0')
220 #define fccI263 mmioFOURCC('I', '2', '6', '3')
221 #define fcci263 mmioFOURCC('i', '2', '6', '3')
223 #define fccMJPG mmioFOURCC('M', 'J', 'P', 'G')
224 #define fccmjpg mmioFOURCC('m', 'j', 'p', 'g')
226 #define fccHFYU mmioFOURCC('H', 'F', 'Y', 'U')
228 #define fcccvid mmioFOURCC('c', 'v', 'i', 'd')
229 #define fccdvsd mmioFOURCC('d', 'v', 's', 'd')
231 /* Ati codecs */
232 #define fccVCR2 mmioFOURCC('V', 'C', 'R', '2')
233 #define fccVCR1 mmioFOURCC('V', 'C', 'R', '1')
234 #define fccVYUY mmioFOURCC('V', 'Y', 'U', 'Y')
235 #define fccIYU9 mmioFOURCC('I', 'Y', 'U', '9') // it was defined as fccYVU9
237 /* Asus codecs */
238 #define fccASV1 mmioFOURCC('A', 'S', 'V', '1')
239 #define fccASV2 mmioFOURCC('A', 'S', 'V', '2')
241 /* Microsoft video */
242 #define fcccram mmioFOURCC('c', 'r', 'a', 'm')
243 #define fccCRAM mmioFOURCC('C', 'R', 'A', 'M')
244 #define fccMSVC mmioFOURCC('M', 'S', 'V', 'C')
247 #define fccMSZH mmioFOURCC('M', 'S', 'Z', 'H')
249 #define fccZLIB mmioFOURCC('Z', 'L', 'I', 'B')
251 #define fccTM20 mmioFOURCC('T', 'M', '2', '0')
253 #define fccYUV mmioFOURCC('Y', 'U', 'V', ' ')
254 #define fccYUY2 mmioFOURCC('Y', 'U', 'Y', '2')
255 #define fccYV12 mmioFOURCC('Y', 'V', '1', '2')/* Planar mode: Y + V + U (3 planes) */
256 #define fccI420 mmioFOURCC('I', '4', '2', '0')
257 #define fccIYUV mmioFOURCC('I', 'Y', 'U', 'V')/* Planar mode: Y + U + V (3 planes) */
258 #define fccUYVY mmioFOURCC('U', 'Y', 'V', 'Y')/* Packed mode: U0+Y0+V0+Y1 (1 plane) */
259 #define fccYVYU mmioFOURCC('Y', 'V', 'Y', 'U')/* Packed mode: Y0+V0+Y1+U0 (1 plane) */
260 #define fccYVU9 mmioFOURCC('Y', 'V', 'U', '9')/* Planar 4:1:0 */
261 #define fccIF09 mmioFOURCC('I', 'F', '0', '9')/* Planar 4:1:0 + delta */
263 #endif