Commit 61d84d68 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

avifil32: Reorder some code to avoid forward declarations for the IAVIStreamVtbl methods.

parent a45ae7ba
......@@ -38,38 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(avifile);
/***********************************************************************/
static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
static ULONG WINAPI ICMStream_fnAddRef(IAVIStream*iface);
static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface);
static HRESULT WINAPI ICMStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2);
static HRESULT WINAPI ICMStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size);
static LONG WINAPI ICMStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags);
static HRESULT WINAPI ICMStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize);
static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize);
static HRESULT WINAPI ICMStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
static HRESULT WINAPI ICMStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
static HRESULT WINAPI ICMStream_fnDelete(IAVIStream*iface,LONG start,LONG samples);
static HRESULT WINAPI ICMStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread);
static HRESULT WINAPI ICMStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size);
static HRESULT WINAPI ICMStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen);
static const struct IAVIStreamVtbl iicmst = {
ICMStream_fnQueryInterface,
ICMStream_fnAddRef,
ICMStream_fnRelease,
ICMStream_fnCreate,
ICMStream_fnInfo,
ICMStream_fnFindSample,
ICMStream_fnReadFormat,
ICMStream_fnSetFormat,
ICMStream_fnRead,
ICMStream_fnWrite,
ICMStream_fnDelete,
ICMStream_fnReadData,
ICMStream_fnWriteData,
ICMStream_fnSetInfo
};
typedef struct _IAVIStreamImpl {
/* IUnknown stuff */
IAVIStream IAVIStream_iface;
......@@ -120,29 +88,6 @@ static inline void AVIFILE_Reset(IAVIStreamImpl *This)
This->dwUnusedBytes = 0;
}
HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
{
IAVIStreamImpl *pstream;
HRESULT hr;
assert(riid != NULL && ppv != NULL);
*ppv = NULL;
pstream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIStreamImpl));
if (pstream == NULL)
return AVIERR_MEMORY;
pstream->IAVIStream_iface.lpVtbl = &iicmst;
AVIFILE_Reset(pstream);
hr = IAVIStream_QueryInterface(&pstream->IAVIStream_iface, riid, ppv);
if (FAILED(hr))
HeapFree(GetProcessHeap(), 0, pstream);
return hr;
}
static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream *iface,
REFIID refiid, LPVOID *obj)
{
......@@ -762,6 +707,46 @@ static HRESULT WINAPI ICMStream_fnSetInfo(IAVIStream *iface,
return E_FAIL;
}
static const struct IAVIStreamVtbl iicmst = {
ICMStream_fnQueryInterface,
ICMStream_fnAddRef,
ICMStream_fnRelease,
ICMStream_fnCreate,
ICMStream_fnInfo,
ICMStream_fnFindSample,
ICMStream_fnReadFormat,
ICMStream_fnSetFormat,
ICMStream_fnRead,
ICMStream_fnWrite,
ICMStream_fnDelete,
ICMStream_fnReadData,
ICMStream_fnWriteData,
ICMStream_fnSetInfo
};
HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
{
IAVIStreamImpl *pstream;
HRESULT hr;
assert(riid != NULL && ppv != NULL);
*ppv = NULL;
pstream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAVIStreamImpl));
if (pstream == NULL)
return AVIERR_MEMORY;
pstream->IAVIStream_iface.lpVtbl = &iicmst;
AVIFILE_Reset(pstream);
hr = IAVIStream_QueryInterface(&pstream->IAVIStream_iface, riid, ppv);
if (FAILED(hr))
HeapFree(GetProcessHeap(), 0, pstream);
return hr;
}
/***********************************************************************/
static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment