Fixed some issues found by winapi_check.
[wine.git] / dlls / avifil32 / avifile.c
blob502727c9ba95869ab4fa7f6bb24190b92e91466f
1 /*
2 * Copyright 1999 Marcus Meissner
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <string.h>
20 #include <stdio.h>
21 #include <assert.h>
23 #include "winbase.h"
24 #include "winnls.h"
25 #include "mmsystem.h"
26 #include "winerror.h"
27 #include "vfw.h"
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(avifile);
32 static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj);
33 static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface);
34 static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface);
35 static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size);
36 static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam);
37 static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi);
38 static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size);
39 static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size);
40 static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile*iface);
41 static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam);
43 struct ICOM_VTABLE(IAVIFile) iavift = {
44 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
45 IAVIFile_fnQueryInterface,
46 IAVIFile_fnAddRef,
47 IAVIFile_fnRelease,
48 IAVIFile_fnInfo,
49 IAVIFile_fnGetStream,
50 IAVIFile_fnCreateStream,
51 IAVIFile_fnWriteData,
52 IAVIFile_fnReadData,
53 IAVIFile_fnEndRecord,
54 IAVIFile_fnDeleteStream
57 static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
58 static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface);
59 static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface);
60 static HRESULT WINAPI IAVIStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2);
61 static HRESULT WINAPI IAVIStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size);
62 static LONG WINAPI IAVIStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags);
63 static HRESULT WINAPI IAVIStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize);
64 static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize);
65 static HRESULT WINAPI IAVIStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
66 static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
67 static HRESULT WINAPI IAVIStream_fnDelete(IAVIStream*iface,LONG start,LONG samples);
68 static HRESULT WINAPI IAVIStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread);
69 static HRESULT WINAPI IAVIStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size);
70 static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen);
72 struct ICOM_VTABLE(IAVIStream) iavist = {
73 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
74 IAVIStream_fnQueryInterface,
75 IAVIStream_fnAddRef,
76 IAVIStream_fnRelease,
77 IAVIStream_fnCreate,
78 IAVIStream_fnInfo,
79 IAVIStream_fnFindSample,
80 IAVIStream_fnReadFormat,
81 IAVIStream_fnSetFormat,
82 IAVIStream_fnRead,
83 IAVIStream_fnWrite,
84 IAVIStream_fnDelete,
85 IAVIStream_fnReadData,
86 IAVIStream_fnWriteData,
87 IAVIStream_fnSetInfo
90 typedef struct IAVIStreamImpl {
91 /* IUnknown stuff */
92 ICOM_VFIELD(IAVIStream);
93 DWORD ref;
94 /* IAVIStream stuff */
95 LPVOID lpInputFormat;
96 DWORD inputformatsize;
97 BOOL iscompressing;
98 DWORD curframe;
100 /* Compressor stuff */
101 HIC hic;
102 LPVOID lpCompressFormat;
103 ICINFO icinfo;
104 DWORD compbufsize;
105 LPVOID compbuffer;
107 DWORD decompbufsize;
108 LPVOID decompbuffer;
109 LPVOID decompformat;
110 AVICOMPRESSOPTIONS aco;
112 LPVOID lpPrev; /* pointer to decompressed frame later */
113 LPVOID lpPrevFormat; /* pointer to decompressed info later */
114 } IAVIStreamImpl;
116 /***********************************************************************
117 * AVIFileInit (AVIFIL32.@)
118 * AVIFileInit (AVIFILE.100)
120 void WINAPI
121 AVIFileInit(void) {
122 FIXME("(),stub!\n");
125 typedef struct IAVIFileImpl {
126 /* IUnknown stuff */
127 ICOM_VFIELD(IAVIFile);
128 DWORD ref;
129 /* IAVIFile stuff... */
130 } IAVIFileImpl;
132 static HRESULT WINAPI IAVIFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj) {
133 ICOM_THIS(IAVIFileImpl,iface);
135 TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj);
136 if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
137 !memcmp(&IID_IAVIFile,refiid,sizeof(IID_IAVIFile))
139 *obj = iface;
140 return S_OK;
142 return OLE_E_ENUM_NOMORE;
145 static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile* iface) {
146 ICOM_THIS(IAVIFileImpl,iface);
148 FIXME("(%p)->AddRef()\n",iface);
149 return ++(This->ref);
152 static ULONG WINAPI IAVIFile_fnRelease(IAVIFile* iface) {
153 ICOM_THIS(IAVIFileImpl,iface);
155 FIXME("(%p)->Release()\n",iface);
156 if (!--(This->ref)) {
157 HeapFree(GetProcessHeap(),0,iface);
158 return 0;
160 return This->ref;
163 static HRESULT WINAPI IAVIFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size) {
164 FIXME("(%p)->Info(%p,%ld)\n",iface,afi,size);
166 /* FIXME: fill out struct? */
167 return E_FAIL;
170 static HRESULT WINAPI IAVIFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam) {
171 FIXME("(%p)->GetStream(%p,0x%08lx,%ld)\n",iface,avis,fccType,lParam);
172 /* FIXME: create interface etc. */
173 return E_FAIL;
176 static HRESULT WINAPI IAVIFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi) {
177 ICOM_THIS(IAVIStreamImpl,iface);
178 char fcc[5];
179 IAVIStreamImpl *istream;
181 FIXME("(%p,%p,%p)\n",This,avis,asi);
182 istream = (IAVIStreamImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IAVIStreamImpl));
183 istream->ref = 1;
184 ICOM_VTBL(istream) = &iavist;
185 fcc[4]='\0';
186 memcpy(fcc,(char*)&(asi->fccType),4);
187 FIXME("\tfccType '%s'\n",fcc);
188 memcpy(fcc,(char*)&(asi->fccHandler),4);
189 FIXME("\tfccHandler '%s'\n",fcc);
190 FIXME("\tdwFlags 0x%08lx\n",asi->dwFlags);
191 FIXME("\tdwCaps 0x%08lx\n",asi->dwCaps);
192 FIXME("\tname %s\n",debugstr_w(asi->szName));
194 istream->curframe = 0;
195 *avis = (PAVISTREAM)istream;
196 return S_OK;
199 static HRESULT WINAPI IAVIFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size) {
200 FIXME("(%p)->WriteData(0x%08lx,%p,%ld)\n",iface,ckid,lpData,size);
201 /* FIXME: write data to file */
202 return E_FAIL;
205 static HRESULT WINAPI IAVIFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size) {
206 FIXME("(%p)->ReadData(0x%08lx,%p,%p)\n",iface,ckid,lpData,size);
207 /* FIXME: read at most size bytes from file */
208 return E_FAIL;
211 static HRESULT WINAPI IAVIFile_fnEndRecord(IAVIFile*iface) {
212 FIXME("(%p)->EndRecord()\n",iface);
213 /* FIXME: end record? */
214 return E_FAIL;
217 static HRESULT WINAPI IAVIFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam) {
218 FIXME("(%p)->DeleteStream(0x%08lx,%ld)\n",iface,fccType,lParam);
219 /* FIXME: delete stream? */
220 return E_FAIL;
223 /***********************************************************************
224 * AVIFileOpenA (AVIFIL32.@)
225 * AVIFileOpen (AVIFILE.102)
227 HRESULT WINAPI AVIFileOpenA(
228 PAVIFILE * ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler
230 IAVIFileImpl *iavi;
232 FIXME("(%p,%s,0x%08lx,%s),stub!\n",ppfile,szFile,(DWORD)uMode,debugstr_guid(lpHandler));
233 iavi = (IAVIFileImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IAVIFileImpl));
234 iavi->ref = 1;
235 ICOM_VTBL(iavi) = &iavift;
236 *ppfile = (LPVOID)iavi;
237 return S_OK;
240 static HRESULT WINAPI IAVIStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj) {
241 ICOM_THIS(IAVIStreamImpl,iface);
243 TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(refiid),obj);
244 if ( !memcmp(&IID_IUnknown,refiid,sizeof(IID_IUnknown)) ||
245 !memcmp(&IID_IAVIStream,refiid,sizeof(IID_IAVIStream))
247 *obj = This;
248 return S_OK;
250 /* can return IGetFrame interface too */
251 return OLE_E_ENUM_NOMORE;
254 static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream*iface) {
255 ICOM_THIS(IAVIStreamImpl,iface);
257 FIXME("(%p)->AddRef()\n",iface);
258 return ++(This->ref);
261 static ULONG WINAPI IAVIStream_fnRelease(IAVIStream* iface) {
262 ICOM_THIS(IAVIStreamImpl,iface);
264 FIXME("(%p)->Release()\n",iface);
265 if (!--(This->ref)) {
266 HeapFree(GetProcessHeap(),0,This);
267 return 0;
269 return This->ref;
272 static HRESULT WINAPI IAVIStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2) {
273 FIXME("(%p)->Create(0x%08lx,0x%08lx)\n",iface,lParam1,lParam2);
274 return E_FAIL;
277 static HRESULT WINAPI IAVIStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size) {
278 FIXME("(%p)->Info(%p,%ld)\n",iface,psi,size);
279 return E_FAIL;
282 static LONG WINAPI IAVIStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags) {
283 FIXME("(%p)->FindSample(%ld,0x%08lx)\n",iface,pos,flags);
284 return E_FAIL;
287 static HRESULT WINAPI IAVIStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize) {
288 FIXME("(%p)->ReadFormat(%ld,%p,%p)\n",iface,pos,format,formatsize);
289 return E_FAIL;
292 /***********************************************************************
293 * IAVIStream::SetFormat
295 static HRESULT WINAPI IAVIStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize) {
296 IAVIStreamImpl *as = (IAVIStreamImpl*)iface;
298 FIXME("(%p)->SetFormat(%ld,%p,%ld)\n",iface,pos,format,formatsize);
299 if (as->lpInputFormat) HeapFree(GetProcessHeap(),0,as->lpInputFormat);
300 as->inputformatsize = formatsize;
301 as->lpInputFormat = HeapAlloc(GetProcessHeap(),0,formatsize);
302 memcpy(as->lpInputFormat,format,formatsize);
303 if (as->iscompressing) {
304 int xsize;
305 /* Set up the Compressor part */
306 xsize = ICCompressGetFormatSize(as->hic,as->lpInputFormat);
307 as->lpCompressFormat = HeapAlloc(GetProcessHeap(),0,xsize);
308 ICCompressGetFormat(as->hic,as->lpInputFormat,as->lpCompressFormat);
309 ICCompressBegin(as->hic,as->lpInputFormat,as->lpCompressFormat);
310 as->compbufsize = ICCompressGetSize(as->hic,as->lpInputFormat,as->lpCompressFormat);
311 as->compbuffer = HeapAlloc(GetProcessHeap(),0,as->compbufsize);
313 /* Set up the Decompressor part (for prev frames?) */
314 xsize=ICDecompressGetFormatSize(as->hic,as->lpCompressFormat);
315 as->decompformat = HeapAlloc(GetProcessHeap(),0,xsize);
316 ICDecompressGetFormat(as->hic,as->lpCompressFormat,as->decompformat);
317 as->decompbufsize=((LPBITMAPINFOHEADER)as->decompbuffer)->biSizeImage;
318 as->decompbuffer = HeapReAlloc(GetProcessHeap(),0,as->decompbuffer,as->decompbufsize);
319 memset(as->decompbuffer,0xff,as->decompbufsize);
320 assert(HeapValidate(GetProcessHeap(),0,NULL));
322 ICDecompressGetFormat(as->hic,as->lpCompressFormat,as->decompformat);
323 ICDecompressBegin(as->hic,as->lpCompressFormat,as->decompformat);
324 as->lpPrev = as->lpPrevFormat = NULL;
326 return S_OK;
329 static HRESULT WINAPI IAVIStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread) {
330 FIXME("(%p)->Read(%ld,%ld,%p,%ld,%p,%p)\n",iface,start,samples,buffer,buffersize,bytesread,samplesread);
331 return E_FAIL;
334 static HRESULT WINAPI IAVIStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten) {
335 IAVIStreamImpl *as = (IAVIStreamImpl*)iface;
336 DWORD ckid,xflags;
338 FIXME("(%p)->Write(%ld,%ld,%p,%ld,0x%08lx,%p,%p)\n",iface,start,samples,buffer,buffersize,flags,sampwritten,byteswritten);
340 ICCompress(
341 as->hic,flags,
342 as->lpCompressFormat,
343 as->compbuffer,
344 as->lpInputFormat,buffer,
345 &ckid,&xflags,
346 as->curframe,0xffffff/*framesize*/,as->aco.dwQuality,
347 as->lpPrevFormat,as->lpPrev
349 ICDecompress(
350 as->hic,
351 flags, /* FIXME: check */
352 as->lpCompressFormat,
353 as->compbuffer,
354 as->decompformat,
355 as->decompbuffer
357 /* We now have a prev format for the next compress ... */
358 as->lpPrevFormat = as->decompformat;
359 as->lpPrev = as->decompbuffer;
360 return S_OK;
363 static HRESULT WINAPI IAVIStream_fnDelete(IAVIStream*iface,LONG start,LONG samples) {
364 FIXME("(%p)->Delete(%ld,%ld)\n",iface,start,samples);
365 return E_FAIL;
367 static HRESULT WINAPI IAVIStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread) {
368 FIXME("(%p)->ReadData(0x%08lx,%p,%p)\n",iface,fcc,lp,lpread);
369 return E_FAIL;
372 static HRESULT WINAPI IAVIStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size) {
373 FIXME("(%p)->WriteData(0x%08lx,%p,%ld)\n",iface,fcc,lp,size);
374 return E_FAIL;
377 static HRESULT WINAPI IAVIStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen) {
378 FIXME("(%p)->SetInfo(%p,%ld)\n",iface,info,infolen);
379 return E_FAIL;
382 /***********************************************************************
383 * AVIFileCreateStreamA (AVIFIL32.@)
385 HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE iface,PAVISTREAM *ppavi,AVISTREAMINFOA * psi) {
386 AVISTREAMINFOW psiw;
388 /* Only the szName at the end is different */
389 memcpy(&psiw,psi,sizeof(*psi)-sizeof(psi->szName));
390 MultiByteToWideChar( CP_ACP, 0, psi->szName, -1,
391 psiw.szName, sizeof(psiw.szName) / sizeof(WCHAR) );
392 return IAVIFile_CreateStream(iface,ppavi,&psiw);
395 /***********************************************************************
396 * AVIFileCreateStreamW (AVIFIL32.@)
398 HRESULT WINAPI AVIFileCreateStreamW(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi) {
399 return IAVIFile_CreateStream(iface,avis,asi);
403 /***********************************************************************
404 * AVIFileGetStream (AVIFIL32.@)
405 * AVIFileGetStream (AVIFILE.143)
407 HRESULT WINAPI AVIFileGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam) {
408 return IAVIFile_GetStream(iface,avis,fccType,lParam);
411 /***********************************************************************
412 * AVIFileInfoA (AVIFIL32.@)
414 HRESULT WINAPI AVIFileInfoA(PAVIFILE iface,LPAVIFILEINFOA afi,LONG size) {
415 AVIFILEINFOW afiw;
416 HRESULT hres;
418 if (size < sizeof(AVIFILEINFOA))
419 return AVIERR_BADSIZE;
420 hres = IAVIFile_Info(iface,&afiw,sizeof(afiw));
421 memcpy(afi,&afiw,sizeof(*afi)-sizeof(afi->szFileType));
422 WideCharToMultiByte( CP_ACP, 0, afiw.szFileType, -1,
423 afi->szFileType, sizeof(afi->szFileType), NULL, NULL );
424 afi->szFileType[sizeof(afi->szFileType)-1] = 0;
425 return hres;
428 /***********************************************************************
429 * AVIStreamInfoW (AVIFIL32.@)
431 HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG
432 size) {
433 return IAVIFile_Info(iface,asi,size);
436 /***********************************************************************
437 * AVIStreamInfoA (AVIFIL32.@)
439 HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG
440 size) {
441 AVISTREAMINFOW asiw;
442 HRESULT hres;
444 if (size<sizeof(AVISTREAMINFOA))
445 return AVIERR_BADSIZE;
446 hres = IAVIFile_Info(iface,&asiw,sizeof(asiw));
447 memcpy(asi,&asiw,sizeof(asiw)-sizeof(asiw.szName));
448 WideCharToMultiByte( CP_ACP, 0, asiw.szName, -1,
449 asi->szName, sizeof(asi->szName), NULL, NULL );
450 asi->szName[sizeof(asi->szName)-1] = 0;
451 return hres;
454 /***********************************************************************
455 * AVIFileInfoW (AVIFIL32.@)
457 HRESULT WINAPI AVIFileInfoW(PAVIFILE iface,LPAVIFILEINFOW afi,LONG size) {
458 return IAVIFile_Info(iface,afi,size);
461 /***********************************************************************
462 * AVIMakeCompressedStream (AVIFIL32.@)
464 HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM *ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *aco,CLSID *pclsidHandler) {
465 char fcc[5];
466 IAVIStreamImpl *as;
467 FIXME("(%p,%p,%p,%p)\n",ppsCompressed,ppsSource,aco,pclsidHandler);
468 fcc[4]='\0';
469 memcpy(fcc,&(aco->fccType),4);
470 FIXME("\tfccType: '%s'\n",fcc);
471 memcpy(fcc,&(aco->fccHandler),4);
472 FIXME("\tfccHandler: '%s'\n",fcc);
473 FIXME("\tdwFlags: 0x%08lx\n",aco->dwFlags);
475 /* we just create a duplicate for now */
476 IAVIStream_AddRef(ppsSource);
477 *ppsCompressed = ppsSource;
478 as = (IAVIStreamImpl*)ppsSource;
480 /* this is where the fun begins. Open a compressor and prepare it. */
481 as->hic = ICOpen(aco->fccType,aco->fccHandler,ICMODE_COMPRESS);
483 /* May happen. for instance if the codec is not able to compress */
484 if (!as->hic)
485 return AVIERR_UNSUPPORTED;
487 ICGetInfo(as->hic,&(as->icinfo),sizeof(ICINFO));
488 FIXME("Opened compressor: %s %s\n",debugstr_w(as->icinfo.szName),debugstr_w(as->icinfo.szDescription));
489 as->iscompressing = TRUE;
490 memcpy(&(as->aco),aco,sizeof(*aco));
491 if (as->icinfo.dwFlags & VIDCF_COMPRESSFRAMES) {
492 ICCOMPRESSFRAMES icf;
494 /* now what to fill in there ... Hmm */
495 memset(&icf,0,sizeof(icf));
496 icf.lDataRate = aco->dwBytesPerSecond;
497 icf.lQuality = aco->dwQuality;
498 icf.lKeyRate = aco->dwKeyFrameEvery;
500 icf.GetData = (void *)0xdead4242;
501 icf.PutData = (void *)0xdead4243;
502 ICSendMessage(as->hic,ICM_COMPRESS_FRAMES_INFO,(LPARAM)&icf,sizeof(icf));
504 return S_OK;
507 /***********************************************************************
508 * AVIStreamSetFormat (AVIFIL32.@)
510 HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize) {
511 return IAVIStream_SetFormat(iface,pos,format,formatsize);
514 /***********************************************************************
515 * AVIStreamReadFormat (AVIFIL32.@)
517 HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize) {
518 return IAVIStream_ReadFormat(iface,pos,format,formatsize);
521 /***********************************************************************
522 * AVIStreamWrite (AVIFIL32.@)
524 HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten) {
525 return IAVIStream_Write(iface,start,samples,buffer,buffersize,flags,sampwritten,byteswritten);
528 /***********************************************************************
529 * AVIStreamRead (AVIFIL32.@)
531 HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread) {
532 return IAVIStream_Read(iface,start,samples,buffer,buffersize,bytesread,samplesread);
535 /***********************************************************************
536 * AVIStreamWriteData (AVIFIL32.@)
538 HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size) {
539 return IAVIStream_WriteData(iface,fcc,lp,size);
542 /***********************************************************************
543 * AVIStreamReadData (AVIFIL32.@)
545 HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread) {
546 return IAVIStream_ReadData(iface,fcc,lp,lpread);
549 /***********************************************************************
550 * AVIStreamStart (AVIFIL32.@)
552 LONG WINAPI AVIStreamStart(PAVISTREAM iface) {
553 AVISTREAMINFOW si;
555 IAVIStream_Info(iface,&si,sizeof(si));
556 return si.dwStart;
559 /***********************************************************************
560 * AVIStreamLength (AVIFIL32.@)
562 LONG WINAPI AVIStreamLength(PAVISTREAM iface) {
563 AVISTREAMINFOW si;
564 HRESULT ret;
566 ret = IAVIStream_Info(iface,&si,sizeof(si));
567 if (ret) /* error */
568 return 1;
569 return si.dwLength;
572 /***********************************************************************
573 * AVIStreamRelease (AVIFIL32.@)
575 ULONG WINAPI AVIStreamRelease(PAVISTREAM iface) {
576 return IAVIStream_Release(iface);
579 /***********************************************************************
580 * AVIStreamGetFrameOpen (AVIFIL32.@)
582 PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM iface,LPBITMAPINFOHEADER bmi) {
583 FIXME("(%p)->(%p),stub!\n",iface,bmi);
584 return NULL;
587 /***********************************************************************
588 * AVIStreamGetFrame (AVIFIL32.@)
590 LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos) {
591 return IGetFrame_GetFrame(pg,pos);
594 /***********************************************************************
595 * AVIStreamGetFrameClose (AVIFIL32.@)
597 HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg) {
598 if (pg) IGetFrame_Release(pg);
599 return 0;
602 /***********************************************************************
603 * AVIFileRelease (AVIFIL32.@)
604 * AVIFileRelease (AVIFILE.141)
606 ULONG WINAPI AVIFileRelease(PAVIFILE iface) {
607 return IAVIFile_Release(iface);
610 /***********************************************************************
611 * AVIFileExit (AVIFIL32.@)
612 * AVIFileExit (AVIFILE.101)
614 void WINAPI AVIFileExit(void) {
615 FIXME("(), stub.\n");