xine-lib: xine-lib-1.2.12/src/libw32dll/libwin32.h Source File

xine-lib 1.2.12

libwin32.h
Go to the documentation of this file.
1#ifndef __LIBWIN32_H
2#define __LIBWIN32_H
3
4#ifndef NOAVIFILE_HEADERS
5#error this header file should not be used without -DNOAVIFILE_HEADERS
6#endif
7
8// this file is only included when NOAVIFILE_HEADERS are defined
9// serves mainly for mplayer
10
11#define VFW_E_NOT_RUNNING 0x80040226
12
13#include <inttypes.h>
14
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 "wine/com.h"
20
21 typedef uint32_t fourcc_t;
22
23/*
24typedef struct _FatalError
25{
26 FatalError();
27 void PrintAll() {}
28}FatalError;
29*/
30
31 typedef struct _CodecInfo
32{
33 char* dll;
34 GUID* guid;
35}CodecInfo;
36
37
38 typedef struct _CImage // public your_libvo_mem
39{
40 char* ptr;
41
42 /*char* (*Data)();
43 {
44 return 0;
45 // pointer to memory block
46 }*/
47 /*int (*Supported)(fourcc_t csp, int bits);
48 {
49 return true;
50 // if you support such surface
51 }*/
52}CImage;
53
54
55#if 0
56struct BitmapInfo : public BITMAPINFOHEADER
57{
58 void SetBits(int b) { return; /*fixme*/ }
59 void SetSpace(int b) { return; /*fixme*/ }
60};
61#endif
62
63 typedef struct _IAudioDecoder
64{
65 WAVEFORMATEX in_fmt;
66 CodecInfo record;
67 /*(*IAudioDecoder)( CodecInfo * r, const WAVEFORMATEX* w);
68 {
69 memcpy(&this->record,r,sizeof(CodecInfo));
70 in_fmt = *w;
71 }*/
72}IAudioDecoder;
73
74/*
75struct IAudioEncoder
76{
77 IAudioEncoder(const CodecInfo&, WAVEFORMATEX*) {}
78 // you do not need this one...
79};
80*/
81
82 enum CAPS
83 {
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,
93 };
94 enum DecodingMode
95 {
96 DIRECT = 0,
97 REALTIME,
98 REALTIME_QUALITY_AUTO,
99 };
100 enum DecodingState
101 {
102 STOP = 0,
103 START,
104 };
105
106 typedef struct _BitmapInfo
107{
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;
121
122 typedef struct _IVideoDecoder
123{
124 int VBUFSIZE;
125 int QMARKHI;
126 int QMARKLO;
127 int DMARKHI;
128 int DMARKLO;
129
130 /*
131 IVideoDecoder(CodecInfo& info, const BITMAPINFOHEADER& format) : record(info)
132 {
133 // implement init part
134 }
135 virtual ~IVideoDecoder();
136 void Stop()
137 {
138 }
139 void Start()
140 {
141 }
142 */
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;
150
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;
155
156/*
157struct IRtConfig
158{
159};
160*/
161
162// might be minimalized to contain just those which are needed by DS_VideoDecoder
163
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 */
169
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')
177
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')
204
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')
210
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')
222
223#define fccMJPG mmioFOURCC('M', 'J', 'P', 'G')
224#define fccmjpg mmioFOURCC('m', 'j', 'p', 'g')
225
226#define fccHFYU mmioFOURCC('H', 'F', 'Y', 'U')
227
228#define fcccvid mmioFOURCC('c', 'v', 'i', 'd')
229#define fccdvsd mmioFOURCC('d', 'v', 's', 'd')
230
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
236
237/* Asus codecs */
238#define fccASV1 mmioFOURCC('A', 'S', 'V', '1')
239#define fccASV2 mmioFOURCC('A', 'S', 'V', '2')
240
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')
245
246
247#define fccMSZH mmioFOURCC('M', 'S', 'Z', 'H')
248
249#define fccZLIB mmioFOURCC('Z', 'L', 'I', 'B')
250
251#define fccTM20 mmioFOURCC('T', 'M', '2', '0')
252
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 */
262
263#endif
CAPS
CAPS
Definition: libwin32.h:83
CAP_YV12
@ CAP_YV12
Definition: libwin32.h:86
CAP_UYVY
@ CAP_UYVY
Definition: libwin32.h:88
CAP_YVU9
@ CAP_YVU9
Definition: libwin32.h:91
CAP_YUY2
@ CAP_YUY2
Definition: libwin32.h:85
CAP_NONE
@ CAP_NONE
Definition: libwin32.h:84
CAP_IYUV
@ CAP_IYUV
Definition: libwin32.h:87
CAP_YVYU
@ CAP_YVYU
Definition: libwin32.h:89
CAP_IF09
@ CAP_IF09
Definition: libwin32.h:92
CAP_I420
@ CAP_I420
Definition: libwin32.h:90
DecodingMode
DecodingMode
Definition: libwin32.h:95
DIRECT
@ DIRECT
Definition: libwin32.h:96
REALTIME_QUALITY_AUTO
@ REALTIME_QUALITY_AUTO
Definition: libwin32.h:98
REALTIME
@ REALTIME
Definition: libwin32.h:97
BitmapInfo
struct _BitmapInfo BitmapInfo
DecodingState
DecodingState
Definition: libwin32.h:101
START
@ START
Definition: libwin32.h:103
STOP
@ STOP
Definition: libwin32.h:102
fourcc_t
uint32_t fourcc_t
Definition: libwin32.h:21
CodecInfo
struct _CodecInfo CodecInfo
IVideoDecoder
struct _IVideoDecoder IVideoDecoder
CImage
struct _CImage CImage
IAudioDecoder
struct _IAudioDecoder IAudioDecoder
_BitmapInfo
Definition: libwin32.h:107
_BitmapInfo::biWidth
long biWidth
Definition: libwin32.h:109
_BitmapInfo::biHeight
long biHeight
Definition: libwin32.h:110
_BitmapInfo::biCompression
long biCompression
Definition: libwin32.h:113
_BitmapInfo::biBitCount
short biBitCount
Definition: libwin32.h:112
_BitmapInfo::biClrUsed
long biClrUsed
Definition: libwin32.h:117
_BitmapInfo::biSizeImage
long biSizeImage
Definition: libwin32.h:114
_BitmapInfo::biSize
long biSize
Definition: libwin32.h:108
_BitmapInfo::biYPelsPerMeter
long biYPelsPerMeter
Definition: libwin32.h:116
_BitmapInfo::biClrImportant
long biClrImportant
Definition: libwin32.h:118
_BitmapInfo::colors
int colors[3]
Definition: libwin32.h:119
_BitmapInfo::biXPelsPerMeter
long biXPelsPerMeter
Definition: libwin32.h:115
_BitmapInfo::biPlanes
short biPlanes
Definition: libwin32.h:111
_CImage
Definition: libwin32.h:39
_CImage::ptr
char * ptr
Definition: libwin32.h:40
_CodecInfo
Definition: libwin32.h:32
_CodecInfo::guid
GUID * guid
Definition: libwin32.h:34
_CodecInfo::dll
char * dll
Definition: libwin32.h:33
_IAudioDecoder
Definition: libwin32.h:64
_IAudioDecoder::in_fmt
WAVEFORMATEX in_fmt
Definition: libwin32.h:65
_IAudioDecoder::record
CodecInfo record
Definition: libwin32.h:66
_IVideoDecoder
Definition: libwin32.h:123
_IVideoDecoder::record
const CodecInfo record
Definition: libwin32.h:143
_IVideoDecoder::DMARKLO
int DMARKLO
Definition: libwin32.h:128
_IVideoDecoder::m_fQuality
float m_fQuality
Definition: libwin32.h:148
_IVideoDecoder::m_State
int m_State
Definition: libwin32.h:145
_IVideoDecoder::DMARKHI
int DMARKHI
Definition: libwin32.h:127
_IVideoDecoder::m_bh
BITMAPINFOHEADER * m_bh
Definition: libwin32.h:151
_IVideoDecoder::QMARKLO
int QMARKLO
Definition: libwin32.h:126
_IVideoDecoder::VBUFSIZE
int VBUFSIZE
Definition: libwin32.h:124
_IVideoDecoder::m_iDecpos
int m_iDecpos
Definition: libwin32.h:146
_IVideoDecoder::m_obh
BitmapInfo m_obh
Definition: libwin32.h:153
_IVideoDecoder::m_Mode
int m_Mode
Definition: libwin32.h:144
_IVideoDecoder::m_iPlaypos
int m_iPlaypos
Definition: libwin32.h:147
_IVideoDecoder::m_bCapable16b
int m_bCapable16b
Definition: libwin32.h:149
_IVideoDecoder::QMARKHI
int QMARKHI
Definition: libwin32.h:125
_IVideoDecoder::m_decoder
BitmapInfo m_decoder
Definition: libwin32.h:152