From 57e8c211287a1f39244addc66578d985da6656a5 Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Sun, 15 Mar 2009 19:03:42 +0000 Subject: [PATCH] - Sync quartz with Wine head svn path=/trunk/; revision=40045 --- reactos/dll/directx/quartz/acmwrapper.c | 4 +- reactos/dll/directx/quartz/avidec.c | 2 +- reactos/dll/directx/quartz/avisplit.c | 57 +-- reactos/dll/directx/quartz/control.c | 10 +- reactos/dll/directx/quartz/dsoundrender.c | 62 ++- reactos/dll/directx/quartz/enumfilters.c | 4 +- reactos/dll/directx/quartz/enummedia.c | 6 +- reactos/dll/directx/quartz/enummoniker.c | 2 +- reactos/dll/directx/quartz/enumpins.c | 4 +- reactos/dll/directx/quartz/enumregfilters.c | 4 +- reactos/dll/directx/quartz/filesource.c | 36 +- reactos/dll/directx/quartz/filtergraph.c | 455 +++++++++--------- reactos/dll/directx/quartz/filtermapper.c | 24 +- reactos/dll/directx/quartz/main.c | 65 +-- reactos/dll/directx/quartz/memallocator.c | 72 +-- reactos/dll/directx/quartz/mpegsplit.c | 12 +- reactos/dll/directx/quartz/nullrenderer.c | 25 +- reactos/dll/directx/quartz/parser.c | 26 +- reactos/dll/directx/quartz/pin.c | 482 ++++++++++---------- reactos/dll/directx/quartz/pin.h | 14 - reactos/dll/directx/quartz/quartz_private.h | 34 -- reactos/dll/directx/quartz/regsvr.c | 3 +- reactos/dll/directx/quartz/systemclock.c | 6 +- reactos/dll/directx/quartz/transform.c | 24 +- reactos/dll/directx/quartz/videorenderer.c | 314 ++++++------- reactos/dll/directx/quartz/waveparser.c | 12 +- 26 files changed, 871 insertions(+), 888 deletions(-) diff --git a/reactos/dll/directx/quartz/acmwrapper.c b/reactos/dll/directx/quartz/acmwrapper.c index f395f823626..c275d833979 100644 --- a/reactos/dll/directx/quartz/acmwrapper.c +++ b/reactos/dll/directx/quartz/acmwrapper.c @@ -262,7 +262,7 @@ static HRESULT ACMWrapper_ConnectInput(InputPin *pin, const AM_MEDIA_TYPE * pmt) This->pWfOut = (WAVEFORMATEX*)outpmt->pbFormat; This->pWfOut->wFormatTag = WAVE_FORMAT_PCM; This->pWfOut->wBitsPerSample = 16; - This->pWfOut->nBlockAlign = 4; + This->pWfOut->nBlockAlign = This->pWfOut->wBitsPerSample * This->pWfOut->nChannels / 8; This->pWfOut->cbSize = 0; This->pWfOut->nAvgBytesPerSec = This->pWfOut->nChannels * This->pWfOut->nSamplesPerSec * (This->pWfOut->wBitsPerSample/8); @@ -331,7 +331,7 @@ HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = (LPVOID)This; + *ppv = This; This->lasttime_real = This->lasttime_sent = -1; return hr; diff --git a/reactos/dll/directx/quartz/avidec.c b/reactos/dll/directx/quartz/avidec.c index ae95cf5d4fd..68b1908d6e6 100644 --- a/reactos/dll/directx/quartz/avidec.c +++ b/reactos/dll/directx/quartz/avidec.c @@ -336,7 +336,7 @@ HRESULT AVIDec_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = (LPVOID)This; + *ppv = This; return hr; } diff --git a/reactos/dll/directx/quartz/avisplit.c b/reactos/dll/directx/quartz/avisplit.c index e93d1d10432..faa844b4848 100644 --- a/reactos/dll/directx/quartz/avisplit.c +++ b/reactos/dll/directx/quartz/avisplit.c @@ -359,8 +359,10 @@ static DWORD WINAPI AVISplitter_thread_reader(LPVOID data) AVISplitter_SendEndOfFile(This, streamnumber); } while (hr == S_OK); - FIXME("Thread %u terminated with hr %08x!\n", streamnumber, hr); - + if (hr != S_FALSE) + FIXME("Thread %u terminated with hr %08x!\n", streamnumber, hr); + else + TRACE("Thread %u terminated properly\n", streamnumber); return hr; } @@ -401,9 +403,9 @@ static HRESULT AVISplitter_done_process(LPVOID iface); */ static HRESULT AVISplitter_first_request(LPVOID iface) { - AVISplitterImpl *This = (AVISplitterImpl *)iface; + AVISplitterImpl *This = iface; HRESULT hr = S_OK; - int x; + DWORD x; IMediaSample *sample = NULL; BOOL have_sample = FALSE; @@ -447,10 +449,12 @@ static HRESULT AVISplitter_first_request(LPVOID iface) /* Could be an EOF instead */ have_sample = (hr == S_OK); - if (FAILED(hr)) - break; if (hr == S_FALSE) AVISplitter_SendEndOfFile(This, x); + + if (FAILED(hr) && hr != VFW_E_NOT_CONNECTED) + break; + hr = S_OK; } /* FIXME: Don't do this for each pin that sent an EOF */ @@ -470,7 +474,7 @@ static HRESULT AVISplitter_first_request(LPVOID iface) args->This = This; args->stream = x; This->streams[x].thread = CreateThread(NULL, 0, AVISplitter_thread_reader, args, 0, &tid); - FIXME("Created stream %u thread 0x%08x\n", x, tid); + TRACE("Created stream %u thread 0x%08x\n", x, tid); } if (FAILED(hr)) @@ -489,7 +493,7 @@ static HRESULT AVISplitter_done_process(LPVOID iface) { StreamData *stream = This->streams + x; - FIXME("Waiting for %u to terminate\n", x); + TRACE("Waiting for %u to terminate\n", x); /* Make the thread return first */ SetEvent(stream->packet_queued); assert(WaitForSingleObject(stream->thread, 100000) != WAIT_TIMEOUT); @@ -502,7 +506,7 @@ static HRESULT AVISplitter_done_process(LPVOID iface) ResetEvent(stream->packet_queued); } - FIXME("All threads are now terminated\n"); + TRACE("All threads are now terminated\n"); return S_OK; } @@ -517,7 +521,8 @@ static HRESULT AVISplitter_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt) static HRESULT AVISplitter_ProcessIndex(AVISplitterImpl *This, AVISTDINDEX **index, LONGLONG qwOffset, DWORD cb) { AVISTDINDEX *pIndex; - int x, rest; + DWORD x; + int rest; *index = NULL; if (cb < sizeof(AVISTDINDEX)) @@ -573,7 +578,7 @@ static HRESULT AVISplitter_ProcessOldIndex(AVISplitterImpl *This) ULONGLONG mov_pos = BYTES_FROM_MEDIATIME(This->CurrentChunkOffset) - sizeof(DWORD); AVIOLDINDEX *pAviOldIndex = This->oldindex; int relative = -1; - int x; + DWORD x; for (x = 0; x < pAviOldIndex->cb / sizeof(pAviOldIndex->aIndex[0]); ++x) { @@ -735,7 +740,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE pvi = (VIDEOINFOHEADER *)amt.pbFormat; pvi->AvgTimePerFrame = (LONGLONG)(10000000.0 / fSamplesPerSec); - CopyMemory(&pvi->bmiHeader, (const BYTE *)(pChunk + 1), pChunk->cb); + CopyMemory(&pvi->bmiHeader, pChunk + 1, pChunk->cb); if (pvi->bmiHeader.biCompression) amt.subtype.Data1 = pvi->bmiHeader.biCompression; } @@ -746,13 +751,13 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE amt.cbFormat = sizeof(WAVEFORMATEX); amt.pbFormat = CoTaskMemAlloc(amt.cbFormat); ZeroMemory(amt.pbFormat, amt.cbFormat); - CopyMemory(amt.pbFormat, (const BYTE *)(pChunk + 1), pChunk->cb); + CopyMemory(amt.pbFormat, pChunk + 1, pChunk->cb); } else { amt.cbFormat = pChunk->cb; amt.pbFormat = CoTaskMemAlloc(amt.cbFormat); - CopyMemory(amt.pbFormat, (const BYTE *)(pChunk + 1), amt.cbFormat); + CopyMemory(amt.pbFormat, pChunk + 1, amt.cbFormat); } break; case ckidSTREAMNAME: @@ -769,7 +774,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE case ckidAVISUPERINDEX: { const AVISUPERINDEX *pIndex = (const AVISUPERINDEX *)pChunk; - int x; + DWORD x; long rest = pIndex->cb - sizeof(AVISUPERINDEX) + sizeof(RIFFCHUNK) + sizeof(pIndex->aIndex[0]) * ANYSIZE_ARRAY; if (pIndex->cb < sizeof(AVISUPERINDEX) - sizeof(RIFFCHUNK)) @@ -884,7 +889,7 @@ static HRESULT AVISplitter_ProcessODML(AVISplitterImpl * This, const BYTE * pDat static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This) { - int x; + unsigned int x; if (This->oldindex) { @@ -908,7 +913,7 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This) FIXME("Stream id %s ignored\n", debugstr_an((char*)&This->oldindex->aIndex[n].dwChunkId, 4)); continue; } - if (This->streams[streamId].pos == ~0) + if (This->streams[streamId].pos == ~0U) This->streams[streamId].pos = n; if (This->streams[streamId].streamheader.dwSampleSize) @@ -941,7 +946,7 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This) for (x = 0; x < This->Parser.cStreams; ++x) { StreamData *stream = This->streams + x; - int y; + DWORD y; DWORD64 frames = 0; stream->seek = 1; @@ -954,7 +959,7 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This) { if (stream->streamheader.dwSampleSize) { - int z; + DWORD z; for (z = 0; z < stream->stdindex[y]->nEntriesInUse; ++z) { @@ -997,7 +1002,7 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin, BYTE * pBuffer; RIFFCHUNK * pCurrentChunk; LONGLONG total, avail; - int x; + ULONG x; DWORD indexes; AVISplitterImpl * pAviSplit = (AVISplitterImpl *)This->pin.pinInfo.pFilter; @@ -1076,7 +1081,7 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin, pos += sizeof(RIFFCHUNK) + list.cb; hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list); - while (list.fcc == ckidAVIPADDING || (list.fcc == FOURCC_LIST && list.fccListType == ckidINFO)) + while (list.fcc == ckidAVIPADDING || (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE)) { pos += sizeof(RIFFCHUNK) + list.cb; @@ -1188,10 +1193,10 @@ static HRESULT AVISplitter_InputPin_PreConnect(IPin * iface, IPin * pConnectPin, static HRESULT AVISplitter_Flush(LPVOID iface) { - AVISplitterImpl *This = (AVISplitterImpl*)iface; + AVISplitterImpl *This = iface; DWORD x; - ERR("(%p)->()\n", This); + TRACE("(%p)->()\n", This); for (x = 0; x < This->Parser.cStreams; ++x) { @@ -1211,7 +1216,7 @@ static HRESULT AVISplitter_Flush(LPVOID iface) static HRESULT AVISplitter_Disconnect(LPVOID iface) { AVISplitterImpl *This = iface; - int x; + ULONG x; /* TODO: Remove other memory that's allocated during connect */ CoTaskMemFree(This->oldindex); @@ -1219,7 +1224,7 @@ static HRESULT AVISplitter_Disconnect(LPVOID iface) for (x = 0; x < This->Parser.cStreams; ++x) { - int i; + DWORD i; StreamData *stream = &This->streams[x]; @@ -1428,7 +1433,7 @@ HRESULT AVISplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = (LPVOID)This; + *ppv = This; return hr; } diff --git a/reactos/dll/directx/quartz/control.c b/reactos/dll/directx/quartz/control.c index a2db24be786..d14e2219b43 100644 --- a/reactos/dll/directx/quartz/control.c +++ b/reactos/dll/directx/quartz/control.c @@ -103,7 +103,7 @@ static const IUnknownVtbl IInner_VTable = }; /* Generic functions for aggregation */ -static HRESULT WINAPI SeekOuter_QueryInterface(PassThruImpl *This, REFIID riid, LPVOID *ppv) +static HRESULT SeekOuter_QueryInterface(PassThruImpl *This, REFIID riid, LPVOID *ppv) { if (This->bAggregatable) This->bUnkOuterValid = TRUE; @@ -131,14 +131,14 @@ static HRESULT WINAPI SeekOuter_QueryInterface(PassThruImpl *This, REFIID riid, return IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv); } -static ULONG WINAPI SeekOuter_AddRef(PassThruImpl *This) +static ULONG SeekOuter_AddRef(PassThruImpl *This) { if (This->pUnkOuter && This->bUnkOuterValid) return IUnknown_AddRef(This->pUnkOuter); return IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl)); } -static ULONG WINAPI SeekOuter_Release(PassThruImpl *This) +static ULONG SeekOuter_Release(PassThruImpl *This) { if (This->pUnkOuter && This->bUnkOuterValid) return IUnknown_Release(This->pUnkOuter); @@ -591,9 +591,9 @@ HRESULT WINAPI MediaSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * p This->llCurrent = llNewCurrent; This->llStop = llNewStop; - if (dwCurrentFlags & AM_SEEKING_ReturnTime) + if (pCurrent && (dwCurrentFlags & AM_SEEKING_ReturnTime)) *pCurrent = llNewCurrent; - if (dwStopFlags & AM_SEEKING_ReturnTime) + if (pStop && (dwStopFlags & AM_SEEKING_ReturnTime)) *pStop = llNewStop; ForwardCmdSeek(This->crst, This->pUserData, fwd_setposition, &args); diff --git a/reactos/dll/directx/quartz/dsoundrender.c b/reactos/dll/directx/quartz/dsoundrender.c index aae7e68fa85..edb170da136 100644 --- a/reactos/dll/directx/quartz/dsoundrender.c +++ b/reactos/dll/directx/quartz/dsoundrender.c @@ -233,11 +233,12 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, const BYTE *d static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample) { - DSoundRenderImpl *This = (DSoundRenderImpl *)iface; + DSoundRenderImpl *This = iface; LPBYTE pbSrcStream = NULL; long cbSrcStream = 0; REFERENCE_TIME tStart, tStop; HRESULT hr; + AM_MEDIA_TYPE *amt; TRACE("%p %p\n", iface, pSample); @@ -259,6 +260,39 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample) return VFW_E_WRONG_STATE; } + if (IMediaSample_GetMediaType(pSample, &amt) == S_OK) + { + AM_MEDIA_TYPE *orig = &This->pInputPin->pin.mtCurrent; + WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat; + WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat; + + if (origfmt->wFormatTag == newfmt->wFormatTag && + origfmt->nChannels == newfmt->nChannels && + origfmt->nBlockAlign == newfmt->nBlockAlign && + origfmt->wBitsPerSample == newfmt->wBitsPerSample && + origfmt->cbSize == newfmt->cbSize) + { + if (origfmt->nSamplesPerSec != newfmt->nSamplesPerSec) + { + hr = IDirectSoundBuffer_SetFrequency(This->dsbuffer, + newfmt->nSamplesPerSec); + if (FAILED(hr)) + { + LeaveCriticalSection(&This->csFilter); + return VFW_E_TYPE_NOT_ACCEPTED; + } + FreeMediaType(orig); + CopyMediaType(orig, amt); + IMediaSample_SetMediaType(pSample, NULL); + } + } + else + { + LeaveCriticalSection(&This->csFilter); + return VFW_E_TYPE_NOT_ACCEPTED; + } + } + SetEvent(This->state_change); hr = IMediaSample_GetPointer(pSample, &pbSrcStream); @@ -404,7 +438,7 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv) return HRESULT_FROM_WIN32(GetLastError()); } - *ppv = (LPVOID)pDSoundRender; + *ppv = pDSoundRender; } else { @@ -426,17 +460,17 @@ static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter * iface, REFIID ri *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBasicAudio)) - *ppv = (LPVOID)&(This->IBasicAudio_vtbl); + *ppv = &This->IBasicAudio_vtbl; else if (IsEqualIID(riid, &IID_IReferenceClock)) - *ppv = (LPVOID)&(This->IReferenceClock_vtbl); + *ppv = &This->IReferenceClock_vtbl; else if (IsEqualIID(riid, &IID_IMediaSeeking)) *ppv = &This->mediaSeeking.lpVtbl; @@ -1073,10 +1107,10 @@ static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface, /*** IBasicAudio methods ***/ static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface, - long lVolume) { + LONG lVolume) { ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, lVolume); + TRACE("(%p/%p)->(%d)\n", This, iface, lVolume); if (lVolume > DSBVOLUME_MAX || lVolume < DSBVOLUME_MIN) return E_INVALIDARG; @@ -1091,7 +1125,7 @@ static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface, } static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface, - long *plVolume) { + LONG *plVolume) { ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, plVolume); @@ -1104,10 +1138,10 @@ static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface, } static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface, - long lBalance) { + LONG lBalance) { ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, lBalance); + TRACE("(%p/%p)->(%d)\n", This, iface, lBalance); if (lBalance < DSBPAN_LEFT || lBalance > DSBPAN_RIGHT) return E_INVALIDARG; @@ -1122,7 +1156,7 @@ static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface, } static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface, - long *plBalance) { + LONG *plBalance) { ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, plBalance); diff --git a/reactos/dll/directx/quartz/enumfilters.c b/reactos/dll/directx/quartz/enumfilters.c index 663451f83a5..ca6a98941bc 100644 --- a/reactos/dll/directx/quartz/enumfilters.c +++ b/reactos/dll/directx/quartz/enumfilters.c @@ -74,9 +74,9 @@ static HRESULT WINAPI IEnumFiltersImpl_QueryInterface(IEnumFilters * iface, REFI *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumFilters)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { diff --git a/reactos/dll/directx/quartz/enummedia.c b/reactos/dll/directx/quartz/enummedia.c index ed5edb3235d..60ff13a7b68 100644 --- a/reactos/dll/directx/quartz/enummedia.c +++ b/reactos/dll/directx/quartz/enummedia.c @@ -134,9 +134,9 @@ static HRESULT WINAPI IEnumMediaTypesImpl_QueryInterface(IEnumMediaTypes * iface *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumMediaTypes)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { @@ -168,7 +168,7 @@ static ULONG WINAPI IEnumMediaTypesImpl_Release(IEnumMediaTypes * iface) if (!refCount) { - int i; + ULONG i; for (i = 0; i < This->enumMediaDetails.cMediaTypes; i++) if (This->enumMediaDetails.pMediaTypes[i].pbFormat) CoTaskMemFree(This->enumMediaDetails.pMediaTypes[i].pbFormat); diff --git a/reactos/dll/directx/quartz/enummoniker.c b/reactos/dll/directx/quartz/enummoniker.c index 42ea361763e..0cc804a8b38 100644 --- a/reactos/dll/directx/quartz/enummoniker.c +++ b/reactos/dll/directx/quartz/enummoniker.c @@ -84,7 +84,7 @@ static HRESULT WINAPI EnumMonikerImpl_QueryInterface( if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumMoniker)) { - *ppvObj = (LPVOID)iface; + *ppvObj = iface; EnumMonikerImpl_AddRef(iface); return S_OK; } diff --git a/reactos/dll/directx/quartz/enumpins.c b/reactos/dll/directx/quartz/enumpins.c index 82dac9daaf7..8125ff42101 100644 --- a/reactos/dll/directx/quartz/enumpins.c +++ b/reactos/dll/directx/quartz/enumpins.c @@ -70,9 +70,9 @@ static HRESULT WINAPI IEnumPinsImpl_QueryInterface(IEnumPins * iface, REFIID rii *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumPins)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { diff --git a/reactos/dll/directx/quartz/enumregfilters.c b/reactos/dll/directx/quartz/enumregfilters.c index 93e4d61c81a..cadeba5e02f 100644 --- a/reactos/dll/directx/quartz/enumregfilters.c +++ b/reactos/dll/directx/quartz/enumregfilters.c @@ -97,9 +97,9 @@ static HRESULT WINAPI IEnumRegFiltersImpl_QueryInterface(IEnumRegFilters * iface *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IEnumRegFilters)) - *ppv = (LPVOID)iface; + *ppv = iface; if (*ppv) { diff --git a/reactos/dll/directx/quartz/filesource.c b/reactos/dll/directx/quartz/filesource.c index b076117d4f0..5f6350fb99f 100644 --- a/reactos/dll/directx/quartz/filesource.c +++ b/reactos/dll/directx/quartz/filesource.c @@ -168,12 +168,10 @@ static HRESULT process_pattern_string(LPCWSTR wszPatternString, IAsyncReader * p if (!(wszPatternString = strchrW(wszPatternString, ','))) hr = E_INVALIDARG; - wszPatternString++; /* skip ',' */ - if (hr == S_OK) { - for ( ; !isxdigitW(*wszPatternString) && (*wszPatternString != ','); wszPatternString++) - ; + wszPatternString++; /* skip ',' */ + while (!isxdigitW(*wszPatternString) && (*wszPatternString != ',')) wszPatternString++; for (strpos = 0; isxdigitW(*wszPatternString) && (strpos/2 < ulBytes); wszPatternString++, strpos++) { @@ -363,7 +361,7 @@ HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv) pAsyncRead->pszFileName = NULL; pAsyncRead->pmt = NULL; - *ppv = (LPVOID)pAsyncRead; + *ppv = pAsyncRead; TRACE("-- created at %p\n", pAsyncRead); @@ -381,15 +379,15 @@ static HRESULT WINAPI AsyncReader_QueryInterface(IBaseFilter * iface, REFIID rii *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IFileSourceFilter)) - *ppv = (LPVOID)(&This->lpVtblFSF); + *ppv = &This->lpVtblFSF; if (*ppv) { @@ -533,7 +531,7 @@ static HRESULT AsyncReader_GetPin(IBaseFilter *iface, ULONG pos, IPin **pin, DWO if (pos >= 1 || !This->pOutputPin) return S_FALSE; - *pin = (IPin *)This->pOutputPin; + *pin = This->pOutputPin; IPin_AddRef(*pin); return S_OK; } @@ -783,8 +781,8 @@ static inline FileAsyncReader *impl_from_IAsyncReader( IAsyncReader *iface ) static HRESULT AcceptProcAFR(LPVOID iface, const AM_MEDIA_TYPE *pmt) { - AsyncReader *This = (AsyncReader *)iface; - + AsyncReader *This = iface; + FIXME("(%p, %p)\n", iface, pmt); if (IsEqualGUID(&pmt->majortype, &This->pmt->majortype) && @@ -805,11 +803,11 @@ static HRESULT WINAPI FileAsyncReaderPin_QueryInterface(IPin * iface, REFIID rii *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IAsyncReader)) - *ppv = (LPVOID)&This->lpVtblAR; + *ppv = &This->lpVtblAR; if (*ppv) { @@ -1182,8 +1180,12 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw if (buffer >= This->samples) { if (buffer != This->samples) + { FIXME("Returned: %u (%08x)\n", buffer, GetLastError()); - hr = VFW_E_TIMEOUT; + hr = VFW_E_TIMEOUT; + } + else + hr = VFW_E_WRONG_STATE; buffer = ~0; } else diff --git a/reactos/dll/directx/quartz/filtergraph.c b/reactos/dll/directx/quartz/filtergraph.c index 9728c37e085..d978f721eb5 100644 --- a/reactos/dll/directx/quartz/filtergraph.c +++ b/reactos/dll/directx/quartz/filtergraph.c @@ -204,12 +204,13 @@ typedef struct _IFilterGraphImpl { LONGLONG start_time; LONGLONG position; LONGLONG stop_position; + LONG recursioncount; } IFilterGraphImpl; -static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This, - REFIID riid, LPVOID * ppv); -static ULONG WINAPI Filtergraph_AddRef(IFilterGraphImpl *This); -static ULONG WINAPI Filtergraph_Release(IFilterGraphImpl *This); +static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This, + REFIID riid, LPVOID * ppv); +static ULONG Filtergraph_AddRef(IFilterGraphImpl *This); +static ULONG Filtergraph_Release(IFilterGraphImpl *This); static HRESULT WINAPI FilterGraphInner_QueryInterface(IUnknown * iface, REFIID riid, @@ -584,7 +585,7 @@ static HRESULT WINAPI FilterGraph2_FindFilterByName(IFilterGraph2 *iface, /* Don't allow a circular connection to form, return VFW_E_CIRCULAR_GRAPH if this would be the case. * A circular connection will be formed if from the filter of the output pin, the input pin can be reached */ -static HRESULT WINAPI CheckCircularConnection(IFilterGraphImpl *This, IPin *out, IPin *in) +static HRESULT CheckCircularConnection(IFilterGraphImpl *This, IPin *out, IPin *in) { #if 1 HRESULT hr; @@ -744,6 +745,9 @@ static HRESULT WINAPI FilterGraph2_Disconnect(IFilterGraph2 *iface, IPin *ppin) TRACE("(%p/%p)->(%p)\n", This, iface, ppin); + if (!ppin) + return E_POINTER; + return IPin_Disconnect(ppin); } @@ -863,8 +867,8 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, { ICOM_THIS_MULTI(IFilterGraphImpl, IFilterGraph2_vtbl, iface); HRESULT hr; - AM_MEDIA_TYPE* mt; - IEnumMediaTypes* penummt; + AM_MEDIA_TYPE* mt = NULL; + IEnumMediaTypes* penummt = NULL; ULONG nbmt; IEnumPins* penumpins; IEnumMoniker* pEnumMoniker; @@ -895,9 +899,18 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, IBaseFilter_Release(PinInfo.pFilter); } + EnterCriticalSection(&This->cs); + ++This->recursioncount; + if (This->recursioncount >= 5) + { + WARN("Recursion count has reached %d\n", This->recursioncount); + hr = VFW_E_CANNOT_CONNECT; + goto out; + } + hr = IPin_QueryDirection(ppinOut, &dir); if (FAILED(hr)) - return hr; + goto out; if (dir == PINDIR_INPUT) { @@ -910,42 +923,44 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, hr = CheckCircularConnection(This, ppinOut, ppinIn); if (FAILED(hr)) - return hr; + goto out; /* Try direct connection first */ hr = IPin_Connect(ppinOut, ppinIn, NULL); - if (SUCCEEDED(hr)) { - return S_OK; - } + if (SUCCEEDED(hr)) + goto out; + TRACE("Direct connection failed, trying to render using extra filters\n"); hr = IPin_QueryPinInfo(ppinIn, &PinInfo); if (FAILED(hr)) - return hr; + goto out; hr = IBaseFilter_GetClassID(PinInfo.pFilter, &FilterCLSID); IBaseFilter_Release(PinInfo.pFilter); if (FAILED(hr)) - return hr; + goto out; /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream * filter to the minor mediatype of input pin of the renderer */ hr = IPin_EnumMediaTypes(ppinOut, &penummt); - if (FAILED(hr)) { + if (FAILED(hr)) + { WARN("EnumMediaTypes (%x)\n", hr); - return hr; + goto out; } hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt); if (FAILED(hr)) { WARN("IEnumMediaTypes_Next (%x)\n", hr); - return hr; + goto out; } if (!nbmt) { WARN("No media type found!\n"); - return S_OK; + hr = VFW_E_INVALIDMEDIATYPE; + goto out; } TRACE("MajorType %s\n", debugstr_guid(&mt->majortype)); TRACE("SubType %s\n", debugstr_guid(&mt->subtype)); @@ -956,7 +971,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, MERIT_UNLIKELY, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL); if (FAILED(hr)) { WARN("Unable to enum filters (%x)\n", hr); - return hr; + goto out; } hr = VFW_E_CANNOT_RENDER; @@ -1025,7 +1040,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb); if (SUCCEEDED(hr)) { - int i; + unsigned int i; if (nb == 0) { IPin_Disconnect(ppinfilter); IPin_Disconnect(ppinOut); @@ -1036,7 +1051,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, { LPWSTR pinname = NULL; - TRACE("Processing pin %d\n", i); + TRACE("Processing pin %u\n", i); hr = IPin_QueryId(ppins[i], &pinname); if (SUCCEEDED(hr)) @@ -1080,14 +1095,18 @@ error: } } - IEnumMediaTypes_Release(penummt); - DeleteMediaType(mt); - +out: + if (penummt) + IEnumMediaTypes_Release(penummt); + if (mt) + DeleteMediaType(mt); + --This->recursioncount; + LeaveCriticalSection(&This->cs); TRACE("--> %08x\n", hr); return SUCCEEDED(hr) ? S_OK : hr; } -static HRESULT WINAPI FilterGraph2_RenderRecurse(IFilterGraphImpl *This, IPin *ppinOut) +static HRESULT FilterGraph2_RenderRecurse(IFilterGraphImpl *This, IPin *ppinOut) { /* This pin has been connected now, try to call render on all pins that aren't connected */ IPin *to = NULL; @@ -1299,7 +1318,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) GUID clsid; IPin* ppinfilter; IBaseFilter* pfilter = NULL; - IEnumPins* penumpins; + IEnumPins* penumpins = NULL; ULONG pin; hr = GetFilterInfo(pMoniker, &clsid, &var); @@ -1329,45 +1348,66 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) WARN("Splitter Enumpins (%x)\n", hr); goto error; } - hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin); - IEnumPins_Release(penumpins); - if (FAILED(hr)) { - WARN("Next (%x)\n", hr); - goto error; + + while ((hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin)) == S_OK) + { + PIN_DIRECTION dir; + + if (pin == 0) { + WARN("No Pin\n"); + hr = E_FAIL; + goto error; + } + + hr = IPin_QueryDirection(ppinfilter, &dir); + if (FAILED(hr)) { + IPin_Release(ppinfilter); + WARN("QueryDirection failed (%x)\n", hr); + goto error; + } + if (dir != PINDIR_INPUT) { + IPin_Release(ppinfilter); + continue; /* Wrong direction */ + } + + /* Connect the pin to the "Renderer" */ + hr = IPin_Connect(ppinOut, ppinfilter, NULL); + IPin_Release(ppinfilter); + + if (FAILED(hr)) { + WARN("Unable to connect %s to renderer (%x)\n", debugstr_w(V_UNION(&var, bstrVal)), hr); + goto error; + } + TRACE("Connected, recursing %s\n", debugstr_w(V_UNION(&var, bstrVal))); + + VariantClear(&var); + + hr = FilterGraph2_RenderRecurse(This, ppinfilter); + if (FAILED(hr)) { + WARN("Unable to connect recursively (%x)\n", hr); + goto error; + } + IBaseFilter_Release(pfilter); + break; } - if (pin == 0) { - WARN("No Pin\n"); - hr = E_FAIL; - goto error; + if (SUCCEEDED(hr)) { + IEnumPins_Release(penumpins); + break; /* out of IEnumMoniker_Next loop */ } - /* Connect the pin to the "Renderer" */ - hr = IPin_Connect(ppinOut, ppinfilter, NULL); - IPin_Release(ppinfilter); - - if (FAILED(hr)) { - WARN("Unable to connect %s to renderer (%x)\n", debugstr_w(V_UNION(&var, bstrVal)), hr); - goto error; - } - TRACE("Connected, recursing %s\n", debugstr_w(V_UNION(&var, bstrVal))); - - VariantClear(&var); - - hr = FilterGraph2_RenderRecurse(This, ppinfilter); - if (FAILED(hr)) { - WARN("Unable to connect recursively (%x)\n", hr); - goto error; - } - IBaseFilter_Release(pfilter); - break; + /* IEnumPins_Next failed, all other failure case caught by goto error */ + WARN("IEnumPins_Next (%x)\n", hr); + /* goto error */ error: VariantClear(&var); + if (penumpins) + IEnumPins_Release(penumpins); if (pfilter) { IFilterGraph2_RemoveFilter(iface, pfilter); IBaseFilter_Release(pfilter); } - if (!FAILED(hr)) DebugBreak(); + if (SUCCEEDED(hr)) DebugBreak(); } IEnumMoniker_Release(pEnumMoniker); @@ -2091,7 +2131,7 @@ static ULONG WINAPI MediaSeeking_Release(IMediaSeeking *iface) { return Filtergraph_Release(This); } -typedef HRESULT WINAPI (*fnFoundSeek)(IFilterGraphImpl *This, IMediaSeeking*, DWORD_PTR arg); +typedef HRESULT (WINAPI *fnFoundSeek)(IFilterGraphImpl *This, IMediaSeeking*, DWORD_PTR arg); static HRESULT all_renderers_seek(IFilterGraphImpl *This, fnFoundSeek FoundSeek, DWORD_PTR arg) { BOOL allnotimpl = TRUE; @@ -2140,7 +2180,7 @@ static HRESULT all_renderers_seek(IFilterGraphImpl *This, fnFoundSeek FoundSeek, IMediaSeeking_Release(seek); if (hr_return != E_NOTIMPL) allnotimpl = FALSE; - if (hr_return == S_OK || (FAILED(hr) && hr != E_NOTIMPL && !FAILED(hr_return))) + if (hr_return == S_OK || (FAILED(hr) && hr != E_NOTIMPL && SUCCEEDED(hr_return))) hr_return = hr; } } @@ -2570,8 +2610,10 @@ static HRESULT WINAPI MediaPosition_get_Duration(IMediaPosition * iface, REFTIME } static HRESULT WINAPI MediaPosition_put_CurrentPosition(IMediaPosition * iface, REFTIME llTime){ - FIXME("(%p)->(%f) stub!\n", iface, llTime); - return E_NOTIMPL; + ICOM_THIS_MULTI(IFilterGraphImpl, IMediaPosition_vtbl, iface); + LONGLONG reftime = llTime; + + return IMediaSeeking_SetPositions((IMediaSeeking *)&This->IMediaSeeking_vtbl, &reftime, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); } static HRESULT WINAPI MediaPosition_get_CurrentPosition(IMediaPosition * iface, REFTIME *pllTime){ @@ -2675,7 +2717,7 @@ static HRESULT GetTargetInterface(IFilterGraphImpl* pGraph, REFIID riid, LPVOID* { pGraph->ItfCacheEntries[entry].riid = riid; pGraph->ItfCacheEntries[entry].filter = pGraph->ppFiltersInGraph[i]; - pGraph->ItfCacheEntries[entry].iface = (IUnknown*)*ppvObj; + pGraph->ItfCacheEntries[entry].iface = *ppvObj; if (entry >= pGraph->nItfCacheEntries) pGraph->nItfCacheEntries++; return S_OK; @@ -2810,12 +2852,12 @@ static HRESULT WINAPI BasicAudio_Invoke(IBasicAudio *iface, /*** IBasicAudio methods ***/ static HRESULT WINAPI BasicAudio_put_Volume(IBasicAudio *iface, - long lVolume) { + LONG lVolume) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface); IBasicAudio* pBasicAudio; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, lVolume); + TRACE("(%p/%p)->(%d)\n", This, iface, lVolume); EnterCriticalSection(&This->cs); @@ -2830,7 +2872,7 @@ static HRESULT WINAPI BasicAudio_put_Volume(IBasicAudio *iface, } static HRESULT WINAPI BasicAudio_get_Volume(IBasicAudio *iface, - long *plVolume) { + LONG *plVolume) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface); IBasicAudio* pBasicAudio; HRESULT hr; @@ -2850,12 +2892,12 @@ static HRESULT WINAPI BasicAudio_get_Volume(IBasicAudio *iface, } static HRESULT WINAPI BasicAudio_put_Balance(IBasicAudio *iface, - long lBalance) { + LONG lBalance) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface); IBasicAudio* pBasicAudio; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, lBalance); + TRACE("(%p/%p)->(%d)\n", This, iface, lBalance); EnterCriticalSection(&This->cs); @@ -2870,7 +2912,7 @@ static HRESULT WINAPI BasicAudio_put_Balance(IBasicAudio *iface, } static HRESULT WINAPI BasicAudio_get_Balance(IBasicAudio *iface, - long *plBalance) { + LONG *plBalance) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface); IBasicAudio* pBasicAudio; HRESULT hr; @@ -3047,7 +3089,7 @@ static HRESULT WINAPI BasicVideo_get_AvgTimePerFrame(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_BitRate(IBasicVideo2 *iface, - long *pBitRate) { + LONG *pBitRate) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3067,7 +3109,7 @@ static HRESULT WINAPI BasicVideo_get_BitRate(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_BitErrorRate(IBasicVideo2 *iface, - long *pBitErrorRate) { + LONG *pBitErrorRate) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3087,7 +3129,7 @@ static HRESULT WINAPI BasicVideo_get_BitErrorRate(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_VideoWidth(IBasicVideo2 *iface, - long *pVideoWidth) { + LONG *pVideoWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3107,7 +3149,7 @@ static HRESULT WINAPI BasicVideo_get_VideoWidth(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_VideoHeight(IBasicVideo2 *iface, - long *pVideoHeight) { + LONG *pVideoHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3127,12 +3169,12 @@ static HRESULT WINAPI BasicVideo_get_VideoHeight(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_SourceLeft(IBasicVideo2 *iface, - long SourceLeft) { + LONG SourceLeft) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceLeft); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft); EnterCriticalSection(&This->cs); @@ -3147,7 +3189,7 @@ static HRESULT WINAPI BasicVideo_put_SourceLeft(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_SourceLeft(IBasicVideo2 *iface, - long *pSourceLeft) { + LONG *pSourceLeft) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3167,12 +3209,12 @@ static HRESULT WINAPI BasicVideo_get_SourceLeft(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_SourceWidth(IBasicVideo2 *iface, - long SourceWidth) { + LONG SourceWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceWidth); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth); EnterCriticalSection(&This->cs); @@ -3187,7 +3229,7 @@ static HRESULT WINAPI BasicVideo_put_SourceWidth(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_SourceWidth(IBasicVideo2 *iface, - long *pSourceWidth) { + LONG *pSourceWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3207,12 +3249,12 @@ static HRESULT WINAPI BasicVideo_get_SourceWidth(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_SourceTop(IBasicVideo2 *iface, - long SourceTop) { + LONG SourceTop) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceTop); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop); EnterCriticalSection(&This->cs); @@ -3227,7 +3269,7 @@ static HRESULT WINAPI BasicVideo_put_SourceTop(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_SourceTop(IBasicVideo2 *iface, - long *pSourceTop) { + LONG *pSourceTop) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3247,12 +3289,12 @@ static HRESULT WINAPI BasicVideo_get_SourceTop(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_SourceHeight(IBasicVideo2 *iface, - long SourceHeight) { + LONG SourceHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceHeight); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight); EnterCriticalSection(&This->cs); @@ -3267,7 +3309,7 @@ static HRESULT WINAPI BasicVideo_put_SourceHeight(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_SourceHeight(IBasicVideo2 *iface, - long *pSourceHeight) { + LONG *pSourceHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3287,12 +3329,12 @@ static HRESULT WINAPI BasicVideo_get_SourceHeight(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_DestinationLeft(IBasicVideo2 *iface, - long DestinationLeft) { + LONG DestinationLeft) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationLeft); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft); EnterCriticalSection(&This->cs); @@ -3307,7 +3349,7 @@ static HRESULT WINAPI BasicVideo_put_DestinationLeft(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_DestinationLeft(IBasicVideo2 *iface, - long *pDestinationLeft) { + LONG *pDestinationLeft) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3327,12 +3369,12 @@ static HRESULT WINAPI BasicVideo_get_DestinationLeft(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_DestinationWidth(IBasicVideo2 *iface, - long DestinationWidth) { + LONG DestinationWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationWidth); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth); EnterCriticalSection(&This->cs); @@ -3347,7 +3389,7 @@ static HRESULT WINAPI BasicVideo_put_DestinationWidth(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_DestinationWidth(IBasicVideo2 *iface, - long *pDestinationWidth) { + LONG *pDestinationWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3367,12 +3409,12 @@ static HRESULT WINAPI BasicVideo_get_DestinationWidth(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_DestinationTop(IBasicVideo2 *iface, - long DestinationTop) { + LONG DestinationTop) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationTop); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop); EnterCriticalSection(&This->cs); @@ -3387,7 +3429,7 @@ static HRESULT WINAPI BasicVideo_put_DestinationTop(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_DestinationTop(IBasicVideo2 *iface, - long *pDestinationTop) { + LONG *pDestinationTop) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3407,12 +3449,12 @@ static HRESULT WINAPI BasicVideo_get_DestinationTop(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_put_DestinationHeight(IBasicVideo2 *iface, - long DestinationHeight) { + LONG DestinationHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationHeight); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight); EnterCriticalSection(&This->cs); @@ -3427,7 +3469,7 @@ static HRESULT WINAPI BasicVideo_put_DestinationHeight(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_get_DestinationHeight(IBasicVideo2 *iface, - long *pDestinationHeight) { + LONG *pDestinationHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3447,15 +3489,15 @@ static HRESULT WINAPI BasicVideo_get_DestinationHeight(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_SetSourcePosition(IBasicVideo2 *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); EnterCriticalSection(&This->cs); @@ -3470,10 +3512,10 @@ static HRESULT WINAPI BasicVideo_SetSourcePosition(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_GetSourcePosition(IBasicVideo2 *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3512,15 +3554,15 @@ static HRESULT WINAPI BasicVideo_SetDefaultSourcePosition(IBasicVideo2 *iface) { } static HRESULT WINAPI BasicVideo_SetDestinationPosition(IBasicVideo2 *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); EnterCriticalSection(&This->cs); @@ -3535,10 +3577,10 @@ static HRESULT WINAPI BasicVideo_SetDestinationPosition(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_GetDestinationPosition(IBasicVideo2 *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3577,8 +3619,8 @@ static HRESULT WINAPI BasicVideo_SetDefaultDestinationPosition(IBasicVideo2 *ifa } static HRESULT WINAPI BasicVideo_GetVideoSize(IBasicVideo2 *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3598,15 +3640,15 @@ static HRESULT WINAPI BasicVideo_GetVideoSize(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_GetVideoPaletteEntries(IBasicVideo2 *iface, - long StartIndex, - long Entries, - long *pRetrieved, - long *pPalette) { + LONG StartIndex, + LONG Entries, + LONG *pRetrieved, + LONG *pPalette) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; - TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This, iface, StartIndex, Entries, pRetrieved, pPalette); + TRACE("(%p/%p)->(%d, %d, %p, %p)\n", This, iface, StartIndex, Entries, pRetrieved, pPalette); EnterCriticalSection(&This->cs); @@ -3621,8 +3663,8 @@ static HRESULT WINAPI BasicVideo_GetVideoPaletteEntries(IBasicVideo2 *iface, } static HRESULT WINAPI BasicVideo_GetCurrentImage(IBasicVideo2 *iface, - long *pBufferSize, - long *pDIBImage) { + LONG *pBufferSize, + LONG *pDIBImage) { ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface); IBasicVideo* pBasicVideo; HRESULT hr; @@ -3907,12 +3949,12 @@ static HRESULT WINAPI VideoWindow_get_Caption(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_WindowStyle(IVideoWindow *iface, - long WindowStyle) { + LONG WindowStyle) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyle); + TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyle); EnterCriticalSection(&This->cs); @@ -3927,7 +3969,7 @@ static HRESULT WINAPI VideoWindow_put_WindowStyle(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_WindowStyle(IVideoWindow *iface, - long *WindowStyle) { + LONG *WindowStyle) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -3947,12 +3989,12 @@ static HRESULT WINAPI VideoWindow_get_WindowStyle(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_WindowStyleEx(IVideoWindow *iface, - long WindowStyleEx) { + LONG WindowStyleEx) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyleEx); + TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyleEx); EnterCriticalSection(&This->cs); @@ -3967,7 +4009,7 @@ static HRESULT WINAPI VideoWindow_put_WindowStyleEx(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_WindowStyleEx(IVideoWindow *iface, - long *WindowStyleEx) { + LONG *WindowStyleEx) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -3987,12 +4029,12 @@ static HRESULT WINAPI VideoWindow_get_WindowStyleEx(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_AutoShow(IVideoWindow *iface, - long AutoShow) { + LONG AutoShow) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, AutoShow); + TRACE("(%p/%p)->(%d)\n", This, iface, AutoShow); EnterCriticalSection(&This->cs); @@ -4007,7 +4049,7 @@ static HRESULT WINAPI VideoWindow_put_AutoShow(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_AutoShow(IVideoWindow *iface, - long *AutoShow) { + LONG *AutoShow) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4027,12 +4069,12 @@ static HRESULT WINAPI VideoWindow_get_AutoShow(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_WindowState(IVideoWindow *iface, - long WindowState) { + LONG WindowState) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, WindowState); + TRACE("(%p/%p)->(%d)\n", This, iface, WindowState); EnterCriticalSection(&This->cs); @@ -4047,7 +4089,7 @@ static HRESULT WINAPI VideoWindow_put_WindowState(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_WindowState(IVideoWindow *iface, - long *WindowState) { + LONG *WindowState) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4067,12 +4109,12 @@ static HRESULT WINAPI VideoWindow_get_WindowState(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_BackgroundPalette(IVideoWindow *iface, - long BackgroundPalette) { + LONG BackgroundPalette) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, BackgroundPalette); + TRACE("(%p/%p)->(%d)\n", This, iface, BackgroundPalette); EnterCriticalSection(&This->cs); @@ -4087,7 +4129,7 @@ static HRESULT WINAPI VideoWindow_put_BackgroundPalette(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_BackgroundPalette(IVideoWindow *iface, - long *pBackgroundPalette) { + LONG *pBackgroundPalette) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4107,12 +4149,12 @@ static HRESULT WINAPI VideoWindow_get_BackgroundPalette(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_Visible(IVideoWindow *iface, - long Visible) { + LONG Visible) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Visible); + TRACE("(%p/%p)->(%d)\n", This, iface, Visible); EnterCriticalSection(&This->cs); @@ -4127,7 +4169,7 @@ static HRESULT WINAPI VideoWindow_put_Visible(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_Visible(IVideoWindow *iface, - long *pVisible) { + LONG *pVisible) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4147,12 +4189,12 @@ static HRESULT WINAPI VideoWindow_get_Visible(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_Left(IVideoWindow *iface, - long Left) { + LONG Left) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Left); + TRACE("(%p/%p)->(%d)\n", This, iface, Left); EnterCriticalSection(&This->cs); @@ -4167,7 +4209,7 @@ static HRESULT WINAPI VideoWindow_put_Left(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_Left(IVideoWindow *iface, - long *pLeft) { + LONG *pLeft) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4187,12 +4229,12 @@ static HRESULT WINAPI VideoWindow_get_Left(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_Width(IVideoWindow *iface, - long Width) { + LONG Width) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Width); + TRACE("(%p/%p)->(%d)\n", This, iface, Width); EnterCriticalSection(&This->cs); @@ -4207,7 +4249,7 @@ static HRESULT WINAPI VideoWindow_put_Width(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_Width(IVideoWindow *iface, - long *pWidth) { + LONG *pWidth) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4227,12 +4269,12 @@ static HRESULT WINAPI VideoWindow_get_Width(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_Top(IVideoWindow *iface, - long Top) { + LONG Top) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Top); + TRACE("(%p/%p)->(%d)\n", This, iface, Top); EnterCriticalSection(&This->cs); @@ -4247,7 +4289,7 @@ static HRESULT WINAPI VideoWindow_put_Top(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_Top(IVideoWindow *iface, - long *pTop) { + LONG *pTop) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4267,12 +4309,12 @@ static HRESULT WINAPI VideoWindow_get_Top(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_Height(IVideoWindow *iface, - long Height) { + LONG Height) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Height); + TRACE("(%p/%p)->(%d)\n", This, iface, Height); EnterCriticalSection(&This->cs); @@ -4287,7 +4329,7 @@ static HRESULT WINAPI VideoWindow_put_Height(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_Height(IVideoWindow *iface, - long *pHeight) { + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4387,7 +4429,7 @@ static HRESULT WINAPI VideoWindow_get_MessageDrain(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_BorderColor(IVideoWindow *iface, - long *Color) { + LONG *Color) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4407,12 +4449,12 @@ static HRESULT WINAPI VideoWindow_get_BorderColor(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_BorderColor(IVideoWindow *iface, - long Color) { + LONG Color) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Color); + TRACE("(%p/%p)->(%d)\n", This, iface, Color); EnterCriticalSection(&This->cs); @@ -4427,7 +4469,7 @@ static HRESULT WINAPI VideoWindow_put_BorderColor(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface, - long *FullScreenMode) { + LONG *FullScreenMode) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4447,12 +4489,12 @@ static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface, - long FullScreenMode) { + LONG FullScreenMode) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, FullScreenMode); + TRACE("(%p/%p)->(%d)\n", This, iface, FullScreenMode); EnterCriticalSection(&This->cs); @@ -4467,12 +4509,12 @@ static HRESULT WINAPI VideoWindow_put_FullScreenMode(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_SetWindowForeground(IVideoWindow *iface, - long Focus) { + LONG Focus) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Focus); + TRACE("(%p/%p)->(%d)\n", This, iface, Focus); EnterCriticalSection(&This->cs); @@ -4488,14 +4530,14 @@ static HRESULT WINAPI VideoWindow_SetWindowForeground(IVideoWindow *iface, static HRESULT WINAPI VideoWindow_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, - long uMsg, + LONG uMsg, LONG_PTR wParam, LONG_PTR lParam) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam); + TRACE("(%p/%p)->(%08lx, %d, %08lx, %08lx)\n", This, iface, hwnd, uMsg, wParam, lParam); EnterCriticalSection(&This->cs); @@ -4510,15 +4552,15 @@ static HRESULT WINAPI VideoWindow_NotifyOwnerMessage(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_SetWindowPosition(IVideoWindow *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); EnterCriticalSection(&This->cs); @@ -4533,10 +4575,10 @@ static HRESULT WINAPI VideoWindow_SetWindowPosition(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_GetWindowPosition(IVideoWindow *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4556,8 +4598,8 @@ static HRESULT WINAPI VideoWindow_GetWindowPosition(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_GetMinIdealImageSize(IVideoWindow *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4577,8 +4619,8 @@ static HRESULT WINAPI VideoWindow_GetMinIdealImageSize(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_GetMaxIdealImageSize(IVideoWindow *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4598,10 +4640,10 @@ static HRESULT WINAPI VideoWindow_GetMaxIdealImageSize(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_GetRestorePosition(IVideoWindow *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4621,12 +4663,12 @@ static HRESULT WINAPI VideoWindow_GetRestorePosition(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_HideCursor(IVideoWindow *iface, - long HideCursor) { + LONG HideCursor) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, HideCursor); + TRACE("(%p/%p)->(%d)\n", This, iface, HideCursor); EnterCriticalSection(&This->cs); @@ -4641,7 +4683,7 @@ static HRESULT WINAPI VideoWindow_HideCursor(IVideoWindow *iface, } static HRESULT WINAPI VideoWindow_IsCursorHidden(IVideoWindow *iface, - long *CursorHidden) { + LONG *CursorHidden) { ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface); IVideoWindow* pVideoWindow; HRESULT hr; @@ -4802,14 +4844,14 @@ static HRESULT WINAPI MediaEvent_GetEventHandle(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, - long *lEventCode, + LONG *lEventCode, LONG_PTR *lParam1, LONG_PTR *lParam2, - long msTimeout) { + LONG msTimeout) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); Event evt; - TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout); + TRACE("(%p/%p)->(%p, %p, %p, %d)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout); if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout)) { @@ -4824,11 +4866,11 @@ static HRESULT WINAPI MediaEvent_GetEvent(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_WaitForCompletion(IMediaEventEx *iface, - long msTimeout, - long *pEvCode) { + LONG msTimeout, + LONG *pEvCode) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode); + TRACE("(%p/%p)->(%d, %p)\n", This, iface, msTimeout, pEvCode); if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0) { @@ -4841,10 +4883,10 @@ static HRESULT WINAPI MediaEvent_WaitForCompletion(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_CancelDefaultHandling(IMediaEventEx *iface, - long lEvCode) { + LONG lEvCode) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode); + TRACE("(%p/%p)->(%d)\n", This, iface, lEvCode); if (lEvCode == EC_COMPLETE) This->HandleEcComplete = FALSE; @@ -4859,10 +4901,10 @@ static HRESULT WINAPI MediaEvent_CancelDefaultHandling(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_RestoreDefaultHandling(IMediaEventEx *iface, - long lEvCode) { + LONG lEvCode) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode); + TRACE("(%p/%p)->(%d)\n", This, iface, lEvCode); if (lEvCode == EC_COMPLETE) This->HandleEcComplete = TRUE; @@ -4877,12 +4919,12 @@ static HRESULT WINAPI MediaEvent_RestoreDefaultHandling(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_FreeEventParams(IMediaEventEx *iface, - long lEvCode, + LONG lEvCode, LONG_PTR lParam1, LONG_PTR lParam2) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2); + TRACE("(%p/%p)->(%d, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2); return S_OK; } @@ -4890,11 +4932,11 @@ static HRESULT WINAPI MediaEvent_FreeEventParams(IMediaEventEx *iface, /*** IMediaEventEx methods ***/ static HRESULT WINAPI MediaEvent_SetNotifyWindow(IMediaEventEx *iface, OAHWND hwnd, - long lMsg, + LONG lMsg, LONG_PTR lInstanceData) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData); + TRACE("(%p/%p)->(%08lx, %d, %08lx)\n", This, iface, hwnd, lMsg, lInstanceData); This->notif.hWnd = (HWND)hwnd; This->notif.msg = lMsg; @@ -4904,10 +4946,10 @@ static HRESULT WINAPI MediaEvent_SetNotifyWindow(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_SetNotifyFlags(IMediaEventEx *iface, - long lNoNotifyFlags) { + LONG lNoNotifyFlags) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags); + TRACE("(%p/%p)->(%d)\n", This, iface, lNoNotifyFlags); if ((lNoNotifyFlags != 0) && (lNoNotifyFlags != 1)) return E_INVALIDARG; @@ -4918,7 +4960,7 @@ static HRESULT WINAPI MediaEvent_SetNotifyFlags(IMediaEventEx *iface, } static HRESULT WINAPI MediaEvent_GetNotifyFlags(IMediaEventEx *iface, - long *lplNoNotifyFlags) { + LONG *lplNoNotifyFlags) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags); @@ -5113,12 +5155,12 @@ static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface) return Filtergraph_Release(This); } -static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2) +static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, LONG EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2) { ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface); Event evt; - TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2); + TRACE("(%p/%p)->(%d, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2); /* We need thread safety here, let's use the events queue's one */ EnterCriticalSection(&This->evqueue.msg_crst); @@ -5336,9 +5378,9 @@ static const IUnknownVtbl IInner_VTable = FilterGraphInner_Release }; -static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This, - REFIID riid, - LPVOID * ppv) { +static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This, + REFIID riid, + LPVOID * ppv) { if (This->bAggregatable) This->bUnkOuterValid = TRUE; @@ -5365,13 +5407,13 @@ static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This, return IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv); } -static ULONG WINAPI Filtergraph_AddRef(IFilterGraphImpl *This) { +static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) { if (This->pUnkOuter && This->bUnkOuterValid) return IUnknown_AddRef(This->pUnkOuter); return IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl)); } -static ULONG WINAPI Filtergraph_Release(IFilterGraphImpl *This) { +static ULONG Filtergraph_Release(IFilterGraphImpl *This) { if (This->pUnkOuter && This->bUnkOuterValid) return IUnknown_Release(This->pUnkOuter); return IUnknown_Release((IUnknown *)&(This->IInner_vtbl)); @@ -5427,6 +5469,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj) fimpl->start_time = fimpl->position = 0; fimpl->stop_position = -1; fimpl->punkFilterMapper2 = NULL; + fimpl->recursioncount = 0; /* create Filtermapper aggregated. */ hr = CoCreateInstance(&CLSID_FilterMapper2, pUnkOuter ? pUnkOuter : (IUnknown*)&fimpl->IInner_vtbl, CLSCTX_INPROC_SERVER, diff --git a/reactos/dll/directx/quartz/filtermapper.c b/reactos/dll/directx/quartz/filtermapper.c index 9d8c9d61e57..7b8d95430bf 100644 --- a/reactos/dll/directx/quartz/filtermapper.c +++ b/reactos/dll/directx/quartz/filtermapper.c @@ -81,7 +81,7 @@ struct IAMFilterData { const IAMFilterDataVtbl *lpVtbl; }; -const GUID IID_IAMFilterData = { +static const GUID IID_IAMFilterData = { 0x97f7c4d4, 0x547b, 0x4a5f, { 0x83,0x32, 0x53,0x64,0x30,0xad,0x2e,0x4d } }; @@ -560,20 +560,20 @@ static HRESULT FM2_WriteFilterData(const REGFILTER2 * prf2, BYTE **ppData, ULONG for (j = 0; j < rgPin2.nMediaTypes; j++) { struct REG_TYPE rt; + const CLSID * clsMinorType = rgPin2.lpMediaType[j].clsMinorType ? rgPin2.lpMediaType[j].clsMinorType : &MEDIASUBTYPE_NULL; rt.signature[0] = '0'; rt.signature[1] = 't'; rt.signature[2] = 'y'; rt.signature[3] = '3'; rt.signature[0] += j; - rt.dwUnused = 0; rt.dwOffsetMajor = find_data(&clsidStore, (const BYTE*)rgPin2.lpMediaType[j].clsMajorType, sizeof(CLSID)); if (rt.dwOffsetMajor == -1) rt.dwOffsetMajor = add_data(&clsidStore, (const BYTE*)rgPin2.lpMediaType[j].clsMajorType, sizeof(CLSID)); rt.dwOffsetMajor += size; - rt.dwOffsetMinor = find_data(&clsidStore, (const BYTE*)rgPin2.lpMediaType[j].clsMinorType, sizeof(CLSID)); + rt.dwOffsetMinor = find_data(&clsidStore, (const BYTE*)clsMinorType, sizeof(CLSID)); if (rt.dwOffsetMinor == -1) - rt.dwOffsetMinor = add_data(&clsidStore, (const BYTE*)rgPin2.lpMediaType[j].clsMinorType, sizeof(CLSID)); + rt.dwOffsetMinor = add_data(&clsidStore, (const BYTE*)clsMinorType, sizeof(CLSID)); rt.dwOffsetMinor += size; add_data(&mainStore, (LPBYTE)&rt, sizeof(rt)); @@ -970,8 +970,8 @@ static BOOL MatchTypes( /* internal helper function for qsort of MONIKER_MERIT array */ static int mm_compare(const void * left, const void * right) { - const struct MONIKER_MERIT * mmLeft = (const struct MONIKER_MERIT *)left; - const struct MONIKER_MERIT * mmRight = (const struct MONIKER_MERIT *)right; + const struct MONIKER_MERIT * mmLeft = left; + const struct MONIKER_MERIT * mmRight = right; if (mmLeft->dwMerit == mmRight->dwMerit) return 0; @@ -1297,7 +1297,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( NULL, &GUID_NULL); - if (!SUCCEEDED(hr)) + if (FAILED(hr)) return hr; while(IEnumMoniker_Next(ppEnumMoniker, 1, &IMon, &nb) == S_OK) @@ -1346,7 +1346,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters( if (SUCCEEDED(hrSub)) { - len = (strlenW((WCHAR*)V_UNION(&var, bstrVal))+1) * sizeof(WCHAR); + len = (strlenW(V_UNION(&var, bstrVal))+1) * sizeof(WCHAR); if (!(regfilters[idx].Name = CoTaskMemAlloc(len*2))) hr = E_OUTOFMEMORY; } @@ -1384,7 +1384,7 @@ static HRESULT WINAPI FilterMapper_RegisterFilter(IFilterMapper * iface, CLSID c LPWSTR wszClsid = NULL; HKEY hKey; LONG lRet; - WCHAR wszKeyName[strlenW(wszFilterSlash) + (CHARS_IN_GUID-1) + 1]; + WCHAR wszKeyName[ARRAYSIZE(wszFilterSlash)-1 + (CHARS_IN_GUID-1) + 1]; TRACE("(%p)->(%s, %s, %x)\n", iface, debugstr_guid(&clsid), debugstr_w(szName), dwMerit); @@ -1453,7 +1453,7 @@ static HRESULT WINAPI FilterMapper_RegisterPin( HKEY hKey = NULL; HKEY hPinsKey = NULL; WCHAR * wszPinsKeyName; - WCHAR wszKeyName[strlenW(wszClsidSlash) + (CHARS_IN_GUID-1) + 1]; + WCHAR wszKeyName[ARRAYSIZE(wszClsidSlash)-1 + (CHARS_IN_GUID-1) + 1]; TRACE("(%p)->(%s, %s, %d, %d, %d, %d, %s, %s)\n", iface, debugstr_guid(&Filter), debugstr_w(szName), bRendered, bOutput, bZero, bMany, debugstr_guid(&ConnectsToFilter), debugstr_w(ConnectsToPin)); @@ -1614,7 +1614,7 @@ static HRESULT WINAPI FilterMapper_UnregisterFilter(IFilterMapper * iface, CLSID LONG lRet; LPWSTR wszClsid = NULL; HKEY hKey; - WCHAR wszKeyName[strlenW(wszClsidSlash) + (CHARS_IN_GUID-1) + 1]; + WCHAR wszKeyName[ARRAYSIZE(wszClsidSlash)-1 + (CHARS_IN_GUID-1) + 1]; TRACE("(%p)->(%s)\n", iface, debugstr_guid(&Filter)); @@ -1676,7 +1676,7 @@ static HRESULT WINAPI FilterMapper_UnregisterPin(IFilterMapper * iface, CLSID Fi LPWSTR wszClsid = NULL; HKEY hKey = NULL; WCHAR * wszPinNameKey; - WCHAR wszKeyName[strlenW(wszClsidSlash) + (CHARS_IN_GUID-1) + 1]; + WCHAR wszKeyName[ARRAYSIZE(wszClsidSlash)-1 + (CHARS_IN_GUID-1) + 1]; TRACE("(%p)->(%s, %s)\n", iface, debugstr_guid(&Filter), debugstr_w(Name)); diff --git a/reactos/dll/directx/quartz/main.c b/reactos/dll/directx/quartz/main.c index d935b631d89..6b4c135d234 100644 --- a/reactos/dll/directx/quartz/main.c +++ b/reactos/dll/directx/quartz/main.c @@ -24,6 +24,7 @@ #include "wine/debug.h" #include "quartz_private.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(quartz); @@ -35,9 +36,9 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) switch(fdwReason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstDLL); - break; - case DLL_PROCESS_DETACH: - break; + break; + case DLL_PROCESS_DETACH: + break; } return TRUE; } @@ -86,11 +87,11 @@ DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) IClassFactoryImpl *This = (IClassFactoryImpl *)iface; if (IsEqualGUID(riid, &IID_IUnknown) - || IsEqualGUID(riid, &IID_IClassFactory)) + || IsEqualGUID(riid, &IID_IClassFactory)) { - IClassFactory_AddRef(iface); - *ppobj = This; - return S_OK; + IClassFactory_AddRef(iface); + *ppobj = This; + return S_OK; } *ppobj = NULL; @@ -111,14 +112,14 @@ static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface) ULONG ref = InterlockedDecrement(&This->ref); if (ref == 0) - CoTaskMemFree(This); + CoTaskMemFree(This); return ref; } static HRESULT WINAPI DSCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, - REFIID riid, LPVOID *ppobj) + REFIID riid, LPVOID *ppobj) { IClassFactoryImpl *This = (IClassFactoryImpl *)iface; HRESULT hres; @@ -176,19 +177,19 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); if ( !IsEqualGUID( &IID_IClassFactory, riid ) - && ! IsEqualGUID( &IID_IUnknown, riid) ) - return E_NOINTERFACE; + && ! IsEqualGUID( &IID_IUnknown, riid) ) + return E_NOINTERFACE; for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) { - if (IsEqualGUID(object_creation[i].clsid, rclsid)) - break; + if (IsEqualGUID(object_creation[i].clsid, rclsid)) + break; } if (i == sizeof(object_creation)/sizeof(object_creation[0])) { - FIXME("%s: no class found.\n", debugstr_guid(rclsid)); - return CLASS_E_CLASSNOTAVAILABLE; + FIXME("%s: no class found.\n", debugstr_guid(rclsid)); + return CLASS_E_CLASSNOTAVAILABLE; } factory = CoTaskMemAlloc(sizeof(*factory)); @@ -216,8 +217,8 @@ HRESULT WINAPI DllCanUnloadNow(void) { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } , #name }, static const struct { - const GUID riid; - const char *name; + const GUID riid; + const char *name; } InterfaceDesc[] = { #include "uuids.h" @@ -240,26 +241,6 @@ const char * qzdebugstr_guid( const GUID * id ) return debugstr_guid(id); } -/*********************************************************************** - * qzdebugstr_State (internal) - * - * Gives a text version of the FILTER_STATE enumeration - */ -const char * qzdebugstr_State(FILTER_STATE state) -{ - switch (state) - { - case State_Stopped: - return "State_Stopped"; - case State_Running: - return "State_Running"; - case State_Paused: - return "State_Paused"; - default: - return "State_Unknown"; - } -} - LONG WINAPI AmpFactorToDB(LONG ampfactor) { FIXME("(%d) Stub!\n", ampfactor); @@ -271,7 +252,7 @@ LONG WINAPI DBToAmpFactor(LONG db) FIXME("(%d) Stub!\n", db); /* Avoid divide by zero (probably during range computation) in Windows Media Player 6.4 */ if (db < -1000) - return 0; + return 0; return 100; } @@ -280,7 +261,7 @@ LONG WINAPI DBToAmpFactor(LONG db) */ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) { - int len; + unsigned int len; static const char format[] = "Error: 0x%x"; char error[MAX_ERROR_TEXT_LEN]; @@ -288,7 +269,7 @@ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) if (!buffer) return 0; wsprintfA(error, format, hr); - if ((len = lstrlenA(error)) >= maxlen) return 0; + if ((len = strlen(error)) >= maxlen) return 0; lstrcpyA(buffer, error); return len; } @@ -298,7 +279,7 @@ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen) */ DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen) { - int len; + unsigned int len; static const WCHAR format[] = {'E','r','r','o','r',':',' ','0','x','%','l','x',0}; WCHAR error[MAX_ERROR_TEXT_LEN]; @@ -306,7 +287,7 @@ DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR buffer, DWORD maxlen) if (!buffer) return 0; wsprintfW(error, format, hr); - if ((len = lstrlenW(error)) >= maxlen) return 0; + if ((len = strlenW(error)) >= maxlen) return 0; lstrcpyW(buffer, error); return len; } diff --git a/reactos/dll/directx/quartz/memallocator.c b/reactos/dll/directx/quartz/memallocator.c index 1718d197d8c..7f799c93b7d 100644 --- a/reactos/dll/directx/quartz/memallocator.c +++ b/reactos/dll/directx/quartz/memallocator.c @@ -31,40 +31,42 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); -void dump_AM_SAMPLE2_PROPERTIES(const AM_SAMPLE2_PROPERTIES * pProps) +typedef struct BaseMemAllocator { - if (!pProps) - { - TRACE("AM_SAMPLE2_PROPERTIES: (null)\n"); - return; - } - TRACE("\tcbData: %d\n", pProps->cbData); - TRACE("\tdwTypeSpecificFlags: 0x%8x\n", pProps->dwTypeSpecificFlags); - TRACE("\tdwSampleFlags: 0x%8x\n", pProps->dwSampleFlags); - TRACE("\tlActual: %d\n", pProps->lActual); - TRACE("\ttStart: %x%08x%s\n", (LONG)(pProps->tStart >> 32), (LONG)pProps->tStart, pProps->dwSampleFlags & AM_SAMPLE_TIMEVALID ? "" : " (not valid)"); - TRACE("\ttStop: %x%08x%s\n", (LONG)(pProps->tStop >> 32), (LONG)pProps->tStop, pProps->dwSampleFlags & AM_SAMPLE_STOPVALID ? "" : " (not valid)"); - TRACE("\tdwStreamId: 0x%x\n", pProps->dwStreamId); - TRACE("\tpMediaType: %p\n", pProps->pMediaType); - TRACE("\tpbBuffer: %p\n", pProps->pbBuffer); - TRACE("\tcbBuffer: %d\n", pProps->cbBuffer); -} + const IMemAllocatorVtbl * lpVtbl; + + LONG ref; + ALLOCATOR_PROPERTIES props; + HRESULT (* fnAlloc) (IMemAllocator *); + HRESULT (* fnFree)(IMemAllocator *); + HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *); + HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD flags); + HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *); + void (* fnDestroyed)(IMemAllocator *); + HANDLE hSemWaiting; + BOOL bDecommitQueued; + BOOL bCommitted; + LONG lWaiting; + struct list free_list; + struct list used_list; + CRITICAL_SECTION *pCritSect; +} BaseMemAllocator; static const IMemAllocatorVtbl BaseMemAllocator_VTable; static const IMediaSample2Vtbl StdMediaSample2_VTable; -#define AM_SAMPLE2_PROP_SIZE_WRITABLE (unsigned int)(&((AM_SAMPLE2_PROPERTIES *)0)->pbBuffer) +#define AM_SAMPLE2_PROP_SIZE_WRITABLE FIELD_OFFSET(AM_SAMPLE2_PROPERTIES, pbBuffer) #define INVALID_MEDIA_TIME (((ULONGLONG)0x7fffffff << 32) | 0xffffffff) -HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), - HRESULT (* fnFree)(IMemAllocator *), - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), - void (* fnDestroyed)(IMemAllocator *), - CRITICAL_SECTION *pCritSect, - BaseMemAllocator * pMemAlloc) +static HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), + HRESULT (* fnFree)(IMemAllocator *), + HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), + HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), + HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), + void (* fnDestroyed)(IMemAllocator *), + CRITICAL_SECTION *pCritSect, + BaseMemAllocator * pMemAlloc) { assert(fnAlloc && fnFree && fnDestroyed); @@ -97,9 +99,9 @@ static HRESULT WINAPI BaseMemAllocator_QueryInterface(IMemAllocator * iface, REF *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMemAllocator)) - *ppv = (LPVOID)This; + *ppv = This; if (*ppv) { @@ -399,7 +401,7 @@ static const IMemAllocatorVtbl BaseMemAllocator_VTable = BaseMemAllocator_ReleaseBuffer }; -HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample) +static HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample) { assert(pbBuffer && pParent && (cbBuffer > 0)); @@ -423,7 +425,7 @@ HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator return S_OK; } -void StdMediaSample2_Delete(StdMediaSample2 * This) +static void StdMediaSample2_Delete(StdMediaSample2 * This) { /* NOTE: does not remove itself from the list it belongs to */ CoTaskMemFree(This); @@ -437,11 +439,11 @@ static HRESULT WINAPI StdMediaSample2_QueryInterface(IMediaSample2 * iface, REFI *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaSample)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaSample2)) - *ppv = (LPVOID)This; + *ppv = This; if (*ppv) { @@ -499,7 +501,7 @@ static HRESULT WINAPI StdMediaSample2_GetPointer(IMediaSample2 * iface, BYTE ** return S_OK; } -static long WINAPI StdMediaSample2_GetSize(IMediaSample2 * iface) +static LONG WINAPI StdMediaSample2_GetSize(IMediaSample2 * iface) { StdMediaSample2 *This = (StdMediaSample2 *)iface; @@ -875,7 +877,7 @@ HRESULT StdMemAllocator_create(LPUNKNOWN lpUnkOuter, LPVOID * ppv) pMemAlloc->pMemory = NULL; if (SUCCEEDED(hr = BaseMemAllocator_Init(StdMemAllocator_Alloc, StdMemAllocator_Free, NULL, NULL, NULL, StdMemAllocator_Destroy, &pMemAlloc->csState, &pMemAlloc->base))) - *ppv = (LPVOID)pMemAlloc; + *ppv = pMemAlloc; else CoTaskMemFree(pMemAlloc); diff --git a/reactos/dll/directx/quartz/mpegsplit.c b/reactos/dll/directx/quartz/mpegsplit.c index 8625277c875..373e5372973 100644 --- a/reactos/dll/directx/quartz/mpegsplit.c +++ b/reactos/dll/directx/quartz/mpegsplit.c @@ -243,7 +243,7 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, IMediaSample *pCurrentSample) static HRESULT MPEGSplitter_process_sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR cookie) { - MPEGSplitterImpl *This = (MPEGSplitterImpl*)iface; + MPEGSplitterImpl *This = iface; BYTE *pbSrcStream; DWORD cbSrcStream = 0; REFERENCE_TIME tStart, tStop, tAviStart = This->position; @@ -286,7 +286,7 @@ static HRESULT MPEGSplitter_process_sample(LPVOID iface, IMediaSample * pSample, if (BYTES_FROM_MEDIATIME(tStop) >= This->EndOfFile || This->position >= This->Parser.mediaSeeking.llStop) { - int i; + unsigned int i; TRACE("End of file reached\n"); @@ -301,7 +301,7 @@ static HRESULT MPEGSplitter_process_sample(LPVOID iface, IMediaSample * pSample, IPin_Release(ppin); } if (FAILED(hr)) - WARN("Error sending EndOfStream to pin %d (%x)\n", i, hr); + WARN("Error sending EndOfStream to pin %u (%x)\n", i, hr); } /* Force the pullpin thread to stop */ @@ -615,7 +615,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin, ALLOCATO static HRESULT MPEGSplitter_cleanup(LPVOID iface) { - MPEGSplitterImpl *This = (MPEGSplitterImpl*)iface; + MPEGSplitterImpl *This = iface; TRACE("(%p)\n", This); @@ -709,7 +709,7 @@ static HRESULT MPEGSplitter_disconnect(LPVOID iface) static HRESULT MPEGSplitter_first_request(LPVOID iface) { - MPEGSplitterImpl *This = (MPEGSplitterImpl*)iface; + MPEGSplitterImpl *This = iface; PullPin *pin = This->Parser.pInputPin; HRESULT hr; LONGLONG length; @@ -808,7 +808,7 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) This->seek = 1; /* Note: This memory is managed by the parser filter once created */ - *ppv = (LPVOID)This; + *ppv = This; return hr; } diff --git a/reactos/dll/directx/quartz/nullrenderer.c b/reactos/dll/directx/quartz/nullrenderer.c index 2f9ec94b4de..f7740121eac 100644 --- a/reactos/dll/directx/quartz/nullrenderer.c +++ b/reactos/dll/directx/quartz/nullrenderer.c @@ -67,22 +67,9 @@ typedef struct NullRendererImpl MediaSeekingImpl mediaSeeking; } NullRendererImpl; -static const IMemInputPinVtbl MemInputPin_Vtbl = -{ - MemInputPin_QueryInterface, - MemInputPin_AddRef, - MemInputPin_Release, - MemInputPin_GetAllocator, - MemInputPin_NotifyAllocator, - MemInputPin_GetAllocatorRequirements, - MemInputPin_Receive, - MemInputPin_ReceiveMultiple, - MemInputPin_ReceiveCanBlock -}; - static HRESULT NullRenderer_Sample(LPVOID iface, IMediaSample * pSample) { - NullRendererImpl *This = (NullRendererImpl *)iface; + NullRendererImpl *This = iface; HRESULT hr = S_OK; TRACE("%p %p\n", iface, pSample); @@ -193,7 +180,7 @@ HRESULT NullRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) MediaSeekingImpl_Init((IBaseFilter*)pNullRenderer, NullRendererImpl_Change, NullRendererImpl_Change, NullRendererImpl_Change, &pNullRenderer->mediaSeeking, &pNullRenderer->csFilter); pNullRenderer->mediaSeeking.lpVtbl = &TransformFilter_Seeking_Vtbl; - *ppv = (LPVOID)pNullRenderer; + *ppv = pNullRenderer; } else { @@ -216,13 +203,13 @@ static HRESULT WINAPI NullRendererInner_QueryInterface(IUnknown * iface, REFIID *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)&(This->IInner_vtbl); + *ppv = &This->IInner_vtbl; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaSeeking)) *ppv = &This->mediaSeeking; diff --git a/reactos/dll/directx/quartz/parser.c b/reactos/dll/directx/quartz/parser.c index 7f2530037cc..da5e9d3d6ce 100644 --- a/reactos/dll/directx/quartz/parser.c +++ b/reactos/dll/directx/quartz/parser.c @@ -115,15 +115,15 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaSeeking)) - *ppv = (LPVOID)&This->mediaSeeking; + *ppv = &This->mediaSeeking; if (*ppv) { @@ -219,7 +219,7 @@ HRESULT WINAPI Parser_Stop(IBaseFilter * iface) { ParserImpl *This = (ParserImpl *)iface; PullPin *pin = (PullPin *)This->ppPins[0]; - int i; + ULONG i; TRACE("()\n"); @@ -231,6 +231,7 @@ HRESULT WINAPI Parser_Stop(IBaseFilter * iface) if (This->state == State_Stopped) { LeaveCriticalSection(&This->csFilter); + IAsyncReader_EndFlush(This->pInputPin->pReader); LeaveCriticalSection(&pin->thread_lock); return S_OK; } @@ -246,6 +247,7 @@ HRESULT WINAPI Parser_Stop(IBaseFilter * iface) PullPin_PauseProcessing(This->pInputPin); PullPin_WaitForStateChange(This->pInputPin, INFINITE); + IAsyncReader_EndFlush(This->pInputPin->pReader); LeaveCriticalSection(&pin->thread_lock); return S_OK; @@ -291,7 +293,7 @@ HRESULT WINAPI Parser_Run(IBaseFilter * iface, REFERENCE_TIME tStart) ParserImpl *This = (ParserImpl *)iface; PullPin *pin = (PullPin *)This->ppPins[0]; - int i; + ULONG i; TRACE("(%s)\n", wine_dbgstr_longlong(tStart)); @@ -494,7 +496,7 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR CopyMediaType(pin->pmt, amt); pin->dwSamplesProcessed = 0; - pin->pin.pin.pUserData = (LPVOID)This->ppPins[This->cStreams + 1]; + pin->pin.pin.pUserData = This->ppPins[This->cStreams + 1]; pin->pin.pin.pinInfo.pFilter = (LPVOID)This; pin->pin.custom_allocator = 1; This->cStreams++; @@ -611,9 +613,9 @@ static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin * iface, REFIID riid, *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IMediaSeeking)) { return IBaseFilter_QueryInterface(This->pin.pin.pinInfo.pFilter, &IID_IMediaSeeking, ppv); @@ -677,7 +679,7 @@ static HRESULT WINAPI Parser_OutputPin_Connect(IPin * iface, IPin * pReceivePin, static HRESULT Parser_OutputPin_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt) { - Parser_OutputPin *This = (Parser_OutputPin *)iface; + Parser_OutputPin *This = iface; TRACE("()\n"); dump_AM_MEDIA_TYPE(pmt); @@ -745,7 +747,7 @@ static HRESULT WINAPI Parser_PullPin_Disconnect(IPin * iface) return hr; } -HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI Parser_PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) { HRESULT hr; diff --git a/reactos/dll/directx/quartz/pin.c b/reactos/dll/directx/quartz/pin.c index bcf09a5d98d..2e24d520667 100644 --- a/reactos/dll/directx/quartz/pin.c +++ b/reactos/dll/directx/quartz/pin.c @@ -142,11 +142,6 @@ out: return hr; } -static inline InputPin *impl_from_IMemInputPin( IMemInputPin *iface ) -{ - return (InputPin *)((char*)iface - FIELD_OFFSET(InputPin, lpVtblMemInput)); -} - static void Copy_PinInfo(PIN_INFO * pDest, const PIN_INFO * pSrc) { @@ -159,205 +154,6 @@ static void Copy_PinInfo(PIN_INFO * pDest, const PIN_INFO * pSrc) pDest->pFilter = pSrc->pFilter; } -/* Function called as a helper to IPin_Connect */ -/* specific AM_MEDIA_TYPE - it cannot be NULL */ -/* NOTE: not part of standard interface */ -static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) -{ - OutputPin *This = (OutputPin *)iface; - HRESULT hr; - IMemAllocator * pMemAlloc = NULL; - ALLOCATOR_PROPERTIES actual; /* FIXME: should we put the actual props back in to This? */ - - TRACE("(%p, %p)\n", pReceivePin, pmt); - dump_AM_MEDIA_TYPE(pmt); - - /* FIXME: call queryacceptproc */ - - This->pin.pConnectedTo = pReceivePin; - IPin_AddRef(pReceivePin); - CopyMediaType(&This->pin.mtCurrent, pmt); - - hr = IPin_ReceiveConnection(pReceivePin, iface, pmt); - - /* get the IMemInputPin interface we will use to deliver samples to the - * connected pin */ - if (SUCCEEDED(hr)) - { - This->pMemInputPin = NULL; - hr = IPin_QueryInterface(pReceivePin, &IID_IMemInputPin, (LPVOID)&This->pMemInputPin); - - if (SUCCEEDED(hr) && !This->custom_allocator) - { - hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pMemAlloc); - - if (hr == VFW_E_NO_ALLOCATOR) - /* Input pin provides no allocator, use standard memory allocator */ - hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)&pMemAlloc); - - if (SUCCEEDED(hr)) - hr = IMemAllocator_SetProperties(pMemAlloc, &This->allocProps, &actual); - - if (SUCCEEDED(hr)) - hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, pMemAlloc, This->readonly); - - if (pMemAlloc) - IMemAllocator_Release(pMemAlloc); - } - else if (SUCCEEDED(hr)) - { - if (This->alloc) - { - hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, This->alloc, This->readonly); - } - else - hr = VFW_E_NO_ALLOCATOR; - } - - /* break connection if we couldn't get the allocator */ - if (FAILED(hr)) - { - if (This->pMemInputPin) - IMemInputPin_Release(This->pMemInputPin); - This->pMemInputPin = NULL; - - IPin_Disconnect(pReceivePin); - } - } - - if (FAILED(hr)) - { - IPin_Release(This->pin.pConnectedTo); - This->pin.pConnectedTo = NULL; - FreeMediaType(&This->pin.mtCurrent); - } - - TRACE(" -- %x\n", hr); - return hr; -} - -static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, - QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, InputPin * pPinImpl) -{ - TRACE("\n"); - - /* Common attributes */ - pPinImpl->pin.refCount = 1; - pPinImpl->pin.pConnectedTo = NULL; - pPinImpl->pin.fnQueryAccept = pQueryAccept; - pPinImpl->pin.pUserData = pUserData; - pPinImpl->pin.pCritSec = pCritSec; - Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); - ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); - - /* Input pin attributes */ - pPinImpl->fnSampleProc = pSampleProc; - pPinImpl->fnCleanProc = pCleanUp; - pPinImpl->pAllocator = pPinImpl->preferred_allocator = allocator; - if (pPinImpl->preferred_allocator) - IMemAllocator_AddRef(pPinImpl->preferred_allocator); - pPinImpl->tStart = 0; - pPinImpl->tStop = 0; - pPinImpl->dRate = 1.0; - pPinImpl->pin.lpVtbl = InputPin_Vtbl; - pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl; - pPinImpl->flushing = pPinImpl->end_of_stream = 0; - - return S_OK; -} - -static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const ALLOCATOR_PROPERTIES * props, LPVOID pUserData, - QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, OutputPin * pPinImpl) -{ - TRACE("\n"); - - /* Common attributes */ - pPinImpl->pin.lpVtbl = OutputPin_Vtbl; - pPinImpl->pin.refCount = 1; - pPinImpl->pin.pConnectedTo = NULL; - pPinImpl->pin.fnQueryAccept = pQueryAccept; - pPinImpl->pin.pUserData = pUserData; - pPinImpl->pin.pCritSec = pCritSec; - Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); - ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); - - /* Output pin attributes */ - pPinImpl->pMemInputPin = NULL; - pPinImpl->pConnectSpecific = OutputPin_ConnectSpecific; - /* If custom_allocator is set, you will need to specify an allocator - * in the alloc member of the struct before an output pin can connect - */ - pPinImpl->custom_allocator = 0; - pPinImpl->alloc = NULL; - pPinImpl->readonly = FALSE; - if (props) - { - pPinImpl->allocProps = *props; - if (pPinImpl->allocProps.cbAlign == 0) - pPinImpl->allocProps.cbAlign = 1; - } - else - ZeroMemory(&pPinImpl->allocProps, sizeof(pPinImpl->allocProps)); - - return S_OK; -} - -HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, IPin ** ppPin) -{ - InputPin * pPinImpl; - - *ppPin = NULL; - - if (pPinInfo->dir != PINDIR_INPUT) - { - ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir); - return E_INVALIDARG; - } - - pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl)); - - if (!pPinImpl) - return E_OUTOFMEMORY; - - if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pSampleProc, pUserData, pQueryAccept, pCleanUp, pCritSec, allocator, pPinImpl))) - { - *ppPin = (IPin *)pPinImpl; - return S_OK; - } - - CoTaskMemFree(pPinImpl); - return E_FAIL; -} - -HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) -{ - OutputPin * pPinImpl; - - *ppPin = NULL; - - if (pPinInfo->dir != PINDIR_OUTPUT) - { - ERR("Pin direction(%x) != PINDIR_OUTPUT\n", pPinInfo->dir); - return E_INVALIDARG; - } - - assert(outputpin_size >= sizeof(OutputPin)); - - pPinImpl = CoTaskMemAlloc(outputpin_size); - - if (!pPinImpl) - return E_OUTOFMEMORY; - - if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, props, pUserData, pQueryAccept, pCritSec, pPinImpl))) - { - *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); - return S_OK; - } - - CoTaskMemFree(pPinImpl); - return E_FAIL; -} - /*** Common pin functions ***/ ULONG WINAPI IPinImpl_AddRef(IPin * iface) @@ -527,11 +323,11 @@ HRESULT WINAPI InputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IMemInputPin)) - *ppv = (LPVOID)&This->lpVtblMemInput; + *ppv = &This->lpVtblMemInput; else if (IsEqualIID(riid, &IID_IMediaSeeking)) { return IBaseFilter_QueryInterface(This->pin.pinInfo.pFilter, &IID_IMediaSeeking, ppv); @@ -735,28 +531,33 @@ static const IPinVtbl InputPin_Vtbl = /*** IMemInputPin implementation ***/ -HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv) +static inline InputPin *impl_from_IMemInputPin( IMemInputPin *iface ) +{ + return (InputPin *)((char*)iface - FIELD_OFFSET(InputPin, lpVtblMemInput)); +} + +static HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv) { InputPin *This = impl_from_IMemInputPin(iface); return IPin_QueryInterface((IPin *)&This->pin, riid, ppv); } -ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface) +static ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface) { InputPin *This = impl_from_IMemInputPin(iface); return IPin_AddRef((IPin *)&This->pin); } -ULONG WINAPI MemInputPin_Release(IMemInputPin * iface) +static ULONG WINAPI MemInputPin_Release(IMemInputPin * iface) { InputPin *This = impl_from_IMemInputPin(iface); return IPin_Release((IPin *)&This->pin); } -HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator) +static HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator) { InputPin *This = impl_from_IMemInputPin(iface); @@ -769,7 +570,7 @@ HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** p return *ppAllocator ? S_OK : VFW_E_NO_ALLOCATOR; } -HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly) +static HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly) { InputPin *This = impl_from_IMemInputPin(iface); @@ -797,7 +598,7 @@ HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * return S_OK; } -HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps) +static HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps) { InputPin *This = impl_from_IMemInputPin(iface); @@ -808,7 +609,7 @@ HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCA return E_NOTIMPL; } -HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample) +static HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample) { InputPin *This = impl_from_IMemInputPin(iface); HRESULT hr; @@ -819,12 +620,12 @@ HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample) return hr; } -HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, long nSamples, long *nSamplesProcessed) +static HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, LONG nSamples, LONG *nSamplesProcessed) { HRESULT hr = S_OK; InputPin *This = impl_from_IMemInputPin(iface); - TRACE("(%p/%p)->(%p, %ld, %p)\n", This, iface, pSamples, nSamples, nSamplesProcessed); + TRACE("(%p/%p)->(%p, %d, %p)\n", This, iface, pSamples, nSamples, nSamplesProcessed); for (*nSamplesProcessed = 0; *nSamplesProcessed < nSamples; (*nSamplesProcessed)++) { @@ -836,7 +637,7 @@ HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** return hr; } -HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface) +static HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface) { InputPin *This = impl_from_IMemInputPin(iface); @@ -858,6 +659,8 @@ static const IMemInputPinVtbl MemInputPin_Vtbl = MemInputPin_ReceiveCanBlock }; +/*** OutputPin implementation ***/ + HRESULT WINAPI OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) { OutputPin *This = (OutputPin *)iface; @@ -867,9 +670,9 @@ HRESULT WINAPI OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IMediaSeeking)) { return IBaseFilter_QueryInterface(This->pin.pinInfo.pFilter, &IID_IMediaSeeking, ppv); @@ -1150,22 +953,6 @@ HRESULT OutputPin_SendSample(OutputPin * This, IMediaSample * pSample) return hr; } -HRESULT OutputPin_DeliverNewSegment(OutputPin * This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) -{ - HRESULT hr; - - EnterCriticalSection(This->pin.pCritSec); - { - if (!This->pin.pConnectedTo) - hr = VFW_E_NOT_CONNECTED; - else - hr = IPin_NewSegment(This->pin.pConnectedTo, tStart, tStop, dRate); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - HRESULT OutputPin_CommitAllocator(OutputPin * This) { HRESULT hr = S_OK; @@ -1260,6 +1047,7 @@ HRESULT OutputPin_DeliverDisconnect(OutputPin * This) return hr; } +/*** PullPin implementation ***/ static HRESULT PullPin_Init(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, REQUESTPROC pCustomRequest, STOPPROCESSPROC pDone, LPCRITICAL_SECTION pCritSec, PullPin * pPinImpl) @@ -1415,9 +1203,9 @@ HRESULT WINAPI PullPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IPin)) - *ppv = (LPVOID)iface; + *ppv = iface; else if (IsEqualIID(riid, &IID_IMediaSeeking)) { return IBaseFilter_QueryInterface(This->pin.pinInfo.pFilter, &IID_IMediaSeeking, ppv); @@ -1460,7 +1248,7 @@ ULONG WINAPI PullPin_Release(IPin *iface) return refCount; } -static void CALLBACK PullPin_Flush(PullPin *This) +static void PullPin_Flush(PullPin *This) { IMediaSample *pSample; TRACE("Flushing!\n"); @@ -1488,7 +1276,7 @@ static void CALLBACK PullPin_Flush(PullPin *This) } } -static void CALLBACK PullPin_Thread_Process(PullPin *This) +static void PullPin_Thread_Process(PullPin *This) { HRESULT hr; IMediaSample * pSample = NULL; @@ -1526,6 +1314,7 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) TRACE("Process sample\n"); + pSample = NULL; hr = IAsyncReader_WaitForNext(This->pReader, 10000, &pSample, &dwUser); /* Return an empty sample on error to the implementation in case it does custom parsing, so it knows it's gone */ @@ -1537,6 +1326,12 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) { /* FIXME: This is not well handled yet! */ ERR("Processing error: %x\n", hr); + if (hr == VFW_E_TIMEOUT) + { + assert(!pSample); + hr = S_OK; + continue; + } } if (pSample) @@ -1561,7 +1356,7 @@ static void CALLBACK PullPin_Thread_Process(PullPin *This) TRACE("End: %08x, %d\n", hr, This->stop_playback); } -static void CALLBACK PullPin_Thread_Pause(PullPin *This) +static void PullPin_Thread_Pause(PullPin *This) { PullPin_Flush(This); @@ -1571,7 +1366,7 @@ static void CALLBACK PullPin_Thread_Pause(PullPin *This) LeaveCriticalSection(This->pin.pCritSec); } -static void CALLBACK PullPin_Thread_Stop(PullPin *This) +static void PullPin_Thread_Stop(PullPin *This) { TRACE("(%p)->()\n", This); @@ -1790,6 +1585,10 @@ HRESULT WINAPI PullPin_EndFlush(IPin * iface) EnterCriticalSection(&This->thread_lock); { FILTER_STATE state; + + if (This->pReader) + IAsyncReader_EndFlush(This->pReader); + IBaseFilter_GetState(This->pin.pinInfo.pFilter, INFINITE, &state); if (state != State_Stopped) @@ -1865,3 +1664,204 @@ static const IPinVtbl PullPin_Vtbl = PullPin_EndFlush, PullPin_NewSegment }; + +/*** The Construct functions ***/ + +/* Function called as a helper to IPin_Connect */ +/* specific AM_MEDIA_TYPE - it cannot be NULL */ +/* NOTE: not part of standard interface */ +static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt) +{ + OutputPin *This = (OutputPin *)iface; + HRESULT hr; + IMemAllocator * pMemAlloc = NULL; + ALLOCATOR_PROPERTIES actual; /* FIXME: should we put the actual props back in to This? */ + + TRACE("(%p, %p)\n", pReceivePin, pmt); + dump_AM_MEDIA_TYPE(pmt); + + /* FIXME: call queryacceptproc */ + + This->pin.pConnectedTo = pReceivePin; + IPin_AddRef(pReceivePin); + CopyMediaType(&This->pin.mtCurrent, pmt); + + hr = IPin_ReceiveConnection(pReceivePin, iface, pmt); + + /* get the IMemInputPin interface we will use to deliver samples to the + * connected pin */ + if (SUCCEEDED(hr)) + { + This->pMemInputPin = NULL; + hr = IPin_QueryInterface(pReceivePin, &IID_IMemInputPin, (LPVOID)&This->pMemInputPin); + + if (SUCCEEDED(hr) && !This->custom_allocator) + { + hr = IMemInputPin_GetAllocator(This->pMemInputPin, &pMemAlloc); + + if (hr == VFW_E_NO_ALLOCATOR) + /* Input pin provides no allocator, use standard memory allocator */ + hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)&pMemAlloc); + + if (SUCCEEDED(hr)) + hr = IMemAllocator_SetProperties(pMemAlloc, &This->allocProps, &actual); + + if (SUCCEEDED(hr)) + hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, pMemAlloc, This->readonly); + + if (pMemAlloc) + IMemAllocator_Release(pMemAlloc); + } + else if (SUCCEEDED(hr)) + { + if (This->alloc) + { + hr = IMemInputPin_NotifyAllocator(This->pMemInputPin, This->alloc, This->readonly); + } + else + hr = VFW_E_NO_ALLOCATOR; + } + + /* break connection if we couldn't get the allocator */ + if (FAILED(hr)) + { + if (This->pMemInputPin) + IMemInputPin_Release(This->pMemInputPin); + This->pMemInputPin = NULL; + + IPin_Disconnect(pReceivePin); + } + } + + if (FAILED(hr)) + { + IPin_Release(This->pin.pConnectedTo); + This->pin.pConnectedTo = NULL; + FreeMediaType(&This->pin.mtCurrent); + } + + TRACE(" -- %x\n", hr); + return hr; +} + +static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, + QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, InputPin * pPinImpl) +{ + TRACE("\n"); + + /* Common attributes */ + pPinImpl->pin.refCount = 1; + pPinImpl->pin.pConnectedTo = NULL; + pPinImpl->pin.fnQueryAccept = pQueryAccept; + pPinImpl->pin.pUserData = pUserData; + pPinImpl->pin.pCritSec = pCritSec; + Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); + ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); + + /* Input pin attributes */ + pPinImpl->fnSampleProc = pSampleProc; + pPinImpl->fnCleanProc = pCleanUp; + pPinImpl->pAllocator = pPinImpl->preferred_allocator = allocator; + if (pPinImpl->preferred_allocator) + IMemAllocator_AddRef(pPinImpl->preferred_allocator); + pPinImpl->tStart = 0; + pPinImpl->tStop = 0; + pPinImpl->dRate = 1.0; + pPinImpl->pin.lpVtbl = InputPin_Vtbl; + pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl; + pPinImpl->flushing = pPinImpl->end_of_stream = 0; + + return S_OK; +} + +static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const ALLOCATOR_PROPERTIES * props, LPVOID pUserData, + QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, OutputPin * pPinImpl) +{ + TRACE("\n"); + + /* Common attributes */ + pPinImpl->pin.lpVtbl = OutputPin_Vtbl; + pPinImpl->pin.refCount = 1; + pPinImpl->pin.pConnectedTo = NULL; + pPinImpl->pin.fnQueryAccept = pQueryAccept; + pPinImpl->pin.pUserData = pUserData; + pPinImpl->pin.pCritSec = pCritSec; + Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); + ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); + + /* Output pin attributes */ + pPinImpl->pMemInputPin = NULL; + pPinImpl->pConnectSpecific = OutputPin_ConnectSpecific; + /* If custom_allocator is set, you will need to specify an allocator + * in the alloc member of the struct before an output pin can connect + */ + pPinImpl->custom_allocator = 0; + pPinImpl->alloc = NULL; + pPinImpl->readonly = FALSE; + if (props) + { + pPinImpl->allocProps = *props; + if (pPinImpl->allocProps.cbAlign == 0) + pPinImpl->allocProps.cbAlign = 1; + } + else + ZeroMemory(&pPinImpl->allocProps, sizeof(pPinImpl->allocProps)); + + return S_OK; +} + +HRESULT InputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, SAMPLEPROC_PUSH pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC pCleanUp, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, IPin ** ppPin) +{ + InputPin * pPinImpl; + + *ppPin = NULL; + + if (pPinInfo->dir != PINDIR_INPUT) + { + ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir); + return E_INVALIDARG; + } + + pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl)); + + if (!pPinImpl) + return E_OUTOFMEMORY; + + if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pSampleProc, pUserData, pQueryAccept, pCleanUp, pCritSec, allocator, pPinImpl))) + { + *ppPin = (IPin *)pPinImpl; + return S_OK; + } + + CoTaskMemFree(pPinImpl); + return E_FAIL; +} + +HRESULT OutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, long outputpin_size, const PIN_INFO * pPinInfo, ALLOCATOR_PROPERTIES *props, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) +{ + OutputPin * pPinImpl; + + *ppPin = NULL; + + if (pPinInfo->dir != PINDIR_OUTPUT) + { + ERR("Pin direction(%x) != PINDIR_OUTPUT\n", pPinInfo->dir); + return E_INVALIDARG; + } + + assert(outputpin_size >= sizeof(OutputPin)); + + pPinImpl = CoTaskMemAlloc(outputpin_size); + + if (!pPinImpl) + return E_OUTOFMEMORY; + + if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, props, pUserData, pQueryAccept, pCritSec, pPinImpl))) + { + *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl); + return S_OK; + } + + CoTaskMemFree(pPinImpl); + return E_FAIL; +} diff --git a/reactos/dll/directx/quartz/pin.h b/reactos/dll/directx/quartz/pin.h index 3a9719cd224..2cbaddba0f9 100644 --- a/reactos/dll/directx/quartz/pin.h +++ b/reactos/dll/directx/quartz/pin.h @@ -187,20 +187,6 @@ HRESULT OutputPin_DecommitAllocator(OutputPin * This); HRESULT OutputPin_GetDeliveryBuffer(OutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags); HRESULT OutputPin_SendSample(OutputPin * This, IMediaSample * pSample); HRESULT OutputPin_DeliverDisconnect(OutputPin * This); -HRESULT OutputPin_DeliverNewSegment(OutputPin * This, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); - -/**********************************/ -/*** MemInputPin Implementation ***/ - -HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv); -ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface); -ULONG WINAPI MemInputPin_Release(IMemInputPin * iface); -HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator); -HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly); -HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps); -HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample); -HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, long nSamples, long *nSamplesProcessed); -HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface); /* Pull Pin */ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); diff --git a/reactos/dll/directx/quartz/quartz_private.h b/reactos/dll/directx/quartz/quartz_private.h index e025078b9ab..3e0dfe1ae5e 100644 --- a/reactos/dll/directx/quartz/quartz_private.h +++ b/reactos/dll/directx/quartz/quartz_private.h @@ -76,7 +76,6 @@ HRESULT IEnumRegFiltersImpl_Construct(REGFILTER * pInRegFilters, const ULONG siz HRESULT IEnumFiltersImpl_Construct(IBaseFilter ** ppFilters, ULONG nFilters, IEnumFilters ** ppEnum); extern const char * qzdebugstr_guid(const GUID * id); -extern const char * qzdebugstr_State(FILTER_STATE state); HRESULT CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc); void FreeMediaType(AM_MEDIA_TYPE * pmt); @@ -97,37 +96,4 @@ typedef struct StdMediaSample2 LONGLONG tMediaEnd; } StdMediaSample2; -typedef struct BaseMemAllocator -{ - const IMemAllocatorVtbl * lpVtbl; - - LONG ref; - ALLOCATOR_PROPERTIES props; - HRESULT (* fnAlloc) (IMemAllocator *); - HRESULT (* fnFree)(IMemAllocator *); - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *); - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD flags); - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *); - void (* fnDestroyed)(IMemAllocator *); - HANDLE hSemWaiting; - BOOL bDecommitQueued; - BOOL bCommitted; - LONG lWaiting; - struct list free_list; - struct list used_list; - CRITICAL_SECTION *pCritSect; -} BaseMemAllocator; - -HRESULT BaseMemAllocator_Init(HRESULT (* fnAlloc)(IMemAllocator *), - HRESULT (* fnFree)(IMemAllocator *), - HRESULT (* fnVerify)(IMemAllocator *, ALLOCATOR_PROPERTIES *), - HRESULT (* fnBufferPrepare)(IMemAllocator *, StdMediaSample2 *, DWORD), - HRESULT (* fnBufferReleased)(IMemAllocator *, StdMediaSample2 *), - void (* fnDestroyed)(IMemAllocator *), - CRITICAL_SECTION *pCritSect, - BaseMemAllocator * pMemAlloc); - -HRESULT StdMediaSample2_Construct(BYTE * pbBuffer, LONG cbBuffer, IMemAllocator * pParent, StdMediaSample2 ** ppSample); -void StdMediaSample2_Delete(StdMediaSample2 * This); - #endif /* __QUARTZ_PRIVATE_INCLUDED__ */ diff --git a/reactos/dll/directx/quartz/regsvr.c b/reactos/dll/directx/quartz/regsvr.c index 79000bf3db7..e7785c54307 100644 --- a/reactos/dll/directx/quartz/regsvr.c +++ b/reactos/dll/directx/quartz/regsvr.c @@ -36,6 +36,7 @@ #include "strmif.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(quartz); @@ -215,7 +216,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list) KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) goto error_close_iid_key; - wsprintfW(buf, fmt, list->num_methods); + sprintfW(buf, fmt, list->num_methods); res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); diff --git a/reactos/dll/directx/quartz/systemclock.c b/reactos/dll/directx/quartz/systemclock.c index 88ac7adeb02..62413525572 100644 --- a/reactos/dll/directx/quartz/systemclock.c +++ b/reactos/dll/directx/quartz/systemclock.c @@ -89,7 +89,7 @@ static void QUARTZ_InsertAviseEntryFromQueue(SystemClockImpl* This, SystemClockA #define ADVISE_ADD_PERIODIC (WM_APP + 8) static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) { - SystemClockImpl* This = (SystemClockImpl*) lpParam; + SystemClockImpl* This = lpParam; DWORD timeOut = INFINITE; DWORD tmpTimeOut; MSG msg; @@ -260,7 +260,7 @@ static HRESULT WINAPI SystemClockImpl_AdviseTime(IReferenceClock* iface, REFEREN TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtBaseTime), wine_dbgstr_longlong(rtStreamTime), hEvent, pdwAdviseCookie); - if ((HEVENT) 0 == hEvent) { + if (!hEvent) { return E_INVALIDARG; } if (0 >= rtBaseTime + rtStreamTime) { @@ -296,7 +296,7 @@ static HRESULT WINAPI SystemClockImpl_AdvisePeriodic(IReferenceClock* iface, REF TRACE("(%p, 0x%s, 0x%s, %ld, %p)\n", This, wine_dbgstr_longlong(rtStartTime), wine_dbgstr_longlong(rtPeriodTime), hSemaphore, pdwAdviseCookie); - if ((HSEMAPHORE) 0 == hSemaphore) { + if (!hSemaphore) { return E_INVALIDARG; } if (0 >= rtStartTime || 0 >= rtPeriodTime) { diff --git a/reactos/dll/directx/quartz/transform.c b/reactos/dll/directx/quartz/transform.c index 57e02b8d49d..adb753d057c 100644 --- a/reactos/dll/directx/quartz/transform.c +++ b/reactos/dll/directx/quartz/transform.c @@ -45,7 +45,6 @@ static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n' static const IBaseFilterVtbl TransformFilter_Vtbl; static const IPinVtbl TransformFilter_InputPin_Vtbl; -static const IMemInputPinVtbl MemInputPin_Vtbl; static const IPinVtbl TransformFilter_OutputPin_Vtbl; static HRESULT TransformFilter_Input_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt) @@ -64,7 +63,7 @@ static HRESULT TransformFilter_Input_QueryAccept(LPVOID iface, const AM_MEDIA_TY static HRESULT TransformFilter_Output_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt) { - TransformFilterImpl* pTransformFilter = (TransformFilterImpl*)iface; + TransformFilterImpl* pTransformFilter = iface; AM_MEDIA_TYPE* outpmt = &pTransformFilter->pmt; TRACE("%p\n", iface); @@ -226,13 +225,13 @@ static HRESULT WINAPI TransformFilter_QueryInterface(IBaseFilter * iface, REFIID *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaSeeking)) *ppv = &This->mediaSeeking; @@ -650,16 +649,3 @@ static const IPinVtbl TransformFilter_OutputPin_Vtbl = OutputPin_EndFlush, OutputPin_NewSegment }; - -static const IMemInputPinVtbl MemInputPin_Vtbl = -{ - MemInputPin_QueryInterface, - MemInputPin_AddRef, - MemInputPin_Release, - MemInputPin_GetAllocator, - MemInputPin_NotifyAllocator, - MemInputPin_GetAllocatorRequirements, - MemInputPin_Receive, - MemInputPin_ReceiveMultiple, - MemInputPin_ReceiveCanBlock -}; diff --git a/reactos/dll/directx/quartz/videorenderer.c b/reactos/dll/directx/quartz/videorenderer.c index c7d65825cab..b31959eed21 100644 --- a/reactos/dll/directx/quartz/videorenderer.c +++ b/reactos/dll/directx/quartz/videorenderer.c @@ -96,7 +96,7 @@ typedef struct VideoRendererImpl static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongA(hwnd, 0); + VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongPtrW(hwnd, 0); LPRECT lprect = (LPRECT)lParam; if (pVideoRenderer && pVideoRenderer->hWndMsgDrain) @@ -197,14 +197,14 @@ static BOOL CreateRenderingWindow(VideoRendererImpl* This) return FALSE; } - SetWindowLongA(This->hWnd, 0, (LONG)This); + SetWindowLongPtrW(This->hWnd, 0, (LONG_PTR)This); return TRUE; } static DWORD WINAPI MessageLoop(LPVOID lpParameter) { - VideoRendererImpl* This = (VideoRendererImpl*) lpParameter; + VideoRendererImpl* This = lpParameter; MSG msg; BOOL fGotMessage; @@ -237,7 +237,7 @@ static BOOL CreateRenderingSubsystem(VideoRendererImpl* This) if (!This->hEvent) return FALSE; - This->hThread = CreateThread(NULL, 0, MessageLoop, (LPVOID)This, 0, &This->ThreadID); + This->hThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->ThreadID); if (!This->hThread) { CloseHandle(This->hEvent); @@ -256,31 +256,15 @@ static BOOL CreateRenderingSubsystem(VideoRendererImpl* This) return TRUE; } -static const IMemInputPinVtbl MemInputPin_Vtbl = -{ - MemInputPin_QueryInterface, - MemInputPin_AddRef, - MemInputPin_Release, - MemInputPin_GetAllocator, - MemInputPin_NotifyAllocator, - MemInputPin_GetAllocatorRequirements, - MemInputPin_Receive, - MemInputPin_ReceiveMultiple, - MemInputPin_ReceiveCanBlock -}; - static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size) { AM_MEDIA_TYPE amt; HRESULT hr = S_OK; DDSURFACEDESC sdesc; - int width; - int height; - LPBYTE palette = NULL; HDC hDC; BITMAPINFOHEADER *bmiHeader; - TRACE("%p %p %d\n", This, data, size); + TRACE("(%p)->(%p, %d)\n", This, data, size); sdesc.dwSize = sizeof(sdesc); hr = IPin_ConnectionMediaType((IPin *)This->pInputPin, &amt); @@ -312,15 +296,16 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4)); TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage); - width = bmiHeader->biWidth; - height = bmiHeader->biHeight; - palette = ((LPBYTE)bmiHeader) + bmiHeader->biSize; - if (!This->init) { + DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE); + DWORD style_ex = GetWindowLongW(This->hWnd, GWL_EXSTYLE); + if (!This->WindowPos.right || !This->WindowPos.bottom) This->WindowPos = This->SourceRect; + AdjustWindowRectEx(&This->WindowPos, style, TRUE, style_ex); + TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom); SetWindowPos(This->hWnd, NULL, This->WindowPos.left, @@ -357,14 +342,21 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) { - VideoRendererImpl *This = (VideoRendererImpl *)iface; + VideoRendererImpl *This = iface; LPBYTE pbSrcStream = NULL; long cbSrcStream = 0; REFERENCE_TIME tStart, tStop; HRESULT hr; + + TRACE("(%p)->(%p)\n", iface, pSample); + EnterCriticalSection(&This->csFilter); + if (This->pInputPin->flushing || This->pInputPin->end_of_stream) - hr = S_FALSE; + { + LeaveCriticalSection(&This->csFilter); + return S_FALSE; + } if (This->state == State_Stopped) { @@ -372,8 +364,6 @@ static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample) return VFW_E_WRONG_STATE; } - TRACE("%p %p\n", iface, pSample); - hr = IMediaSample_GetTime(pSample, &tStart, &tStop); if (FAILED(hr)) ERR("Cannot get sample time (%x)\n", hr); @@ -492,7 +482,7 @@ static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) || IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8)) { - VideoRendererImpl* This = (VideoRendererImpl*) iface; + VideoRendererImpl* This = iface; if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) { @@ -573,7 +563,7 @@ static const IMediaSeekingVtbl VideoRendererImpl_Seeking_Vtbl = static HRESULT VideoRendererImpl_Change(IBaseFilter *iface) { - TRACE("(%p)\n", iface); + TRACE("(%p)->()\n", iface); return S_OK; } @@ -624,7 +614,7 @@ HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv) pVideoRenderer->mediaSeeking.lpVtbl = &VideoRendererImpl_Seeking_Vtbl; pVideoRenderer->sample_held = NULL; - *ppv = (LPVOID)pVideoRenderer; + *ppv = pVideoRenderer; } else { @@ -663,17 +653,17 @@ static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown * iface, REFIID *ppv = NULL; if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = (LPVOID)&(This->IInner_vtbl); + *ppv = &This->IInner_vtbl; else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = (LPVOID)This; + *ppv = This; else if (IsEqualIID(riid, &IID_IBasicVideo)) - *ppv = (LPVOID)&(This->IBasicVideo_vtbl); + *ppv = &This->IBasicVideo_vtbl; else if (IsEqualIID(riid, &IID_IVideoWindow)) - *ppv = (LPVOID)&(This->IVideoWindow_vtbl); + *ppv = &This->IVideoWindow_vtbl; else if (IsEqualIID(riid, &IID_IMediaSeeking)) *ppv = &This->mediaSeeking; @@ -963,9 +953,7 @@ static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPi { VideoRendererImpl *This = (VideoRendererImpl *)iface; - TRACE("(%p/%p)->(%p,%p)\n", This, iface, debugstr_w(Id), ppPin); - - FIXME("VideoRenderer::FindPin(...)\n"); + FIXME("(%p/%p)->(%p,%p): stub !!!\n", This, iface, debugstr_w(Id), ppPin); /* FIXME: critical section */ @@ -1196,7 +1184,7 @@ static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface, - long *pBitRate) { + LONG *pBitRate) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate); @@ -1205,7 +1193,7 @@ static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface, - long *pBitErrorRate) { + LONG *pBitErrorRate) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate); @@ -1214,7 +1202,7 @@ static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface, - long *pVideoWidth) { + LONG *pVideoWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth); @@ -1225,7 +1213,7 @@ static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface, - long *pVideoHeight) { + LONG *pVideoHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight); @@ -1236,10 +1224,10 @@ static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface, - long SourceLeft) { + LONG SourceLeft) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceLeft); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft); This->SourceRect.left = SourceLeft; @@ -1247,7 +1235,7 @@ static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface, - long *pSourceLeft) { + LONG *pSourceLeft) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft); @@ -1258,10 +1246,10 @@ static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface, - long SourceWidth) { + LONG SourceWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceWidth); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth); This->SourceRect.right = This->SourceRect.left + SourceWidth; @@ -1269,7 +1257,7 @@ static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface, - long *pSourceWidth) { + LONG *pSourceWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth); @@ -1280,10 +1268,10 @@ static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface, - long SourceTop) { + LONG SourceTop) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceTop); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop); This->SourceRect.top = SourceTop; @@ -1291,7 +1279,7 @@ static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface, - long *pSourceTop) { + LONG *pSourceTop) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop); @@ -1302,10 +1290,10 @@ static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface, - long SourceHeight) { + LONG SourceHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, SourceHeight); + TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight); This->SourceRect.bottom = This->SourceRect.top + SourceHeight; @@ -1313,7 +1301,7 @@ static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface, - long *pSourceHeight) { + LONG *pSourceHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight); @@ -1324,10 +1312,10 @@ static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface, - long DestinationLeft) { + LONG DestinationLeft) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationLeft); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft); This->DestRect.left = DestinationLeft; @@ -1335,7 +1323,7 @@ static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface, - long *pDestinationLeft) { + LONG *pDestinationLeft) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft); @@ -1346,10 +1334,10 @@ static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface, - long DestinationWidth) { + LONG DestinationWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationWidth); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth); This->DestRect.right = This->DestRect.left + DestinationWidth; @@ -1357,7 +1345,7 @@ static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface, - long *pDestinationWidth) { + LONG *pDestinationWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth); @@ -1368,10 +1356,10 @@ static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface, - long DestinationTop) { + LONG DestinationTop) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationTop); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop); This->DestRect.top = DestinationTop; @@ -1379,7 +1367,7 @@ static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface, - long *pDestinationTop) { + LONG *pDestinationTop) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop); @@ -1390,10 +1378,10 @@ static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface, - long DestinationHeight) { + LONG DestinationHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationHeight); + TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight); This->DestRect.right = This->DestRect.left + DestinationHeight; @@ -1401,7 +1389,7 @@ static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface, - long *pDestinationHeight) { + LONG *pDestinationHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight); @@ -1412,13 +1400,13 @@ static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); This->SourceRect.left = Left; This->SourceRect.top = Top; @@ -1429,10 +1417,10 @@ static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight); @@ -1459,13 +1447,13 @@ static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) { } static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); This->DestRect.left = Left; This->DestRect.top = Top; @@ -1476,10 +1464,10 @@ static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight); @@ -1510,8 +1498,8 @@ static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *ifac } static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight); @@ -1523,26 +1511,28 @@ static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface, } static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface, - long StartIndex, - long Entries, - long *pRetrieved, - long *pPalette) { + LONG StartIndex, + LONG Entries, + LONG *pRetrieved, + LONG *pPalette) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); - FIXME("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette); + FIXME("(%p/%p)->(%d, %d, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette); return S_OK; } static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface, - long *pBufferSize, - long *pDIBImage) { + LONG *pBufferSize, + LONG *pDIBImage) { ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface); BITMAPINFOHEADER *bmiHeader; LONG needed_size; AM_MEDIA_TYPE *amt = &This->pInputPin->pin.mtCurrent; char *ptr; + FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage); + EnterCriticalSection(&This->csFilter); if (!This->sample_held) @@ -1551,8 +1541,6 @@ static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface, return (This->state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED); } - FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage); - if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo)) { bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader; @@ -1580,7 +1568,7 @@ static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface, if (needed_size < *pBufferSize) { - ERR("Buffer too small %u/%lu\n", needed_size, *pBufferSize); + ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize); LeaveCriticalSection(&This->csFilter); return E_FAIL; } @@ -1758,13 +1746,13 @@ static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface, - long WindowStyle) { + LONG WindowStyle) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); LONG old; old = GetWindowLongA(This->hWnd, GWL_STYLE); - - TRACE("(%p/%p)->(%x -> %lx)\n", This, iface, old, WindowStyle); + + TRACE("(%p/%p)->(%x -> %x)\n", This, iface, old, WindowStyle); if (WindowStyle & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL)) return E_INVALIDARG; @@ -1775,7 +1763,7 @@ static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface, - long *WindowStyle) { + LONG *WindowStyle) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle); @@ -1786,10 +1774,10 @@ static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface, - long WindowStyleEx) { + LONG WindowStyleEx) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyleEx); + TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyleEx); if (WindowStyleEx & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL)) return E_INVALIDARG; @@ -1801,7 +1789,7 @@ static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface, - long *WindowStyleEx) { + LONG *WindowStyleEx) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx); @@ -1812,18 +1800,18 @@ static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface, - long AutoShow) { + LONG AutoShow) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, AutoShow); + TRACE("(%p/%p)->(%d)\n", This, iface, AutoShow); - This->AutoShow = 1; /* FXIME: Should be AutoShow */; + This->AutoShow = 1; /* FIXME: Should be AutoShow */; return S_OK; } static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface, - long *AutoShow) { + LONG *AutoShow) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow); @@ -1834,16 +1822,16 @@ static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface, - long WindowState) { + LONG WindowState) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState); + FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, WindowState); return S_OK; } static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface, - long *WindowState) { + LONG *WindowState) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState); @@ -1852,16 +1840,16 @@ static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface, - long BackgroundPalette) { + LONG BackgroundPalette) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette); + FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, BackgroundPalette); return S_OK; } static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface, - long *pBackgroundPalette) { + LONG *pBackgroundPalette) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette); @@ -1870,10 +1858,10 @@ static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface, - long Visible) { + LONG Visible) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, Visible); + TRACE("(%p/%p)->(%d)\n", This, iface, Visible); ShowWindow(This->hWnd, Visible ? SW_SHOW : SW_HIDE); @@ -1881,7 +1869,7 @@ static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface, - long *pVisible) { + LONG *pVisible) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pVisible); @@ -1892,10 +1880,10 @@ static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface, - long Left) { + LONG Left) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, Left); + TRACE("(%p/%p)->(%d)\n", This, iface, Left); if (!SetWindowPos(This->hWnd, NULL, Left, This->WindowPos.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE)) return E_FAIL; @@ -1906,7 +1894,7 @@ static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface, - long *pLeft) { + LONG *pLeft) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pLeft); @@ -1917,10 +1905,10 @@ static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface, - long Width) { + LONG Width) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, Width); + TRACE("(%p/%p)->(%d)\n", This, iface, Width); if (!SetWindowPos(This->hWnd, NULL, 0, 0, Width, This->WindowPos.bottom-This->WindowPos.top, SWP_NOZORDER|SWP_NOMOVE)) return E_FAIL; @@ -1931,7 +1919,7 @@ static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface, - long *pWidth) { + LONG *pWidth) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pWidth); @@ -1942,10 +1930,10 @@ static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface, - long Top) { + LONG Top) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, Top); + TRACE("(%p/%p)->(%d)\n", This, iface, Top); if (!SetWindowPos(This->hWnd, NULL, This->WindowPos.left, Top, 0, 0, SWP_NOZORDER|SWP_NOSIZE)) return E_FAIL; @@ -1956,7 +1944,7 @@ static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface, - long *pTop) { + LONG *pTop) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pTop); @@ -1967,10 +1955,10 @@ static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface, - long Height) { + LONG Height) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%ld)\n", This, iface, Height); + TRACE("(%p/%p)->(%d)\n", This, iface, Height); if (!SetWindowPos(This->hWnd, NULL, 0, 0, This->WindowPos.right-This->WindowPos.left, Height, SWP_NOZORDER|SWP_NOMOVE)) return E_FAIL; @@ -1981,7 +1969,7 @@ static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface, - long *pHeight) { + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p)\n", This, iface, pHeight); @@ -2006,7 +1994,7 @@ static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface, OAHWND *Owner) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner); + TRACE("(%p/%p)->(%p)\n", This, iface, Owner); *(HWND*)Owner = GetParent(This->hWnd); @@ -2036,7 +2024,7 @@ static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface, - long *Color) { + LONG *Color) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, Color); @@ -2045,16 +2033,16 @@ static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface, - long Color) { + LONG Color) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, Color); + FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, Color); return S_OK; } static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface, - long *FullScreenMode) { + LONG *FullScreenMode) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode); @@ -2063,22 +2051,22 @@ static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface, - long FullScreenMode) { + LONG FullScreenMode) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode); + FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode); return S_OK; } static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface, - long Focus) { + LONG Focus) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); BOOL ret; IPin* pPin; HRESULT hr; - TRACE("(%p/%p)->(%ld)\n", This, iface, Focus); + TRACE("(%p/%p)->(%d)\n", This, iface, Focus); if ((Focus != FALSE) && (Focus != TRUE)) return E_INVALIDARG; @@ -2100,12 +2088,12 @@ static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface, static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, - long uMsg, + LONG uMsg, LONG_PTR wParam, LONG_PTR lParam) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam); + TRACE("(%p/%p)->(%08lx, %d, %08lx, %08lx)\n", This, iface, hwnd, uMsg, wParam, lParam); if (!PostMessageA(This->hWnd, uMsg, wParam, lParam)) return E_FAIL; @@ -2114,13 +2102,13 @@ static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface, - long Left, - long Top, - long Width, - long Height) { + LONG Left, + LONG Top, + LONG Width, + LONG Height) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - - TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height); + + TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height); if (!SetWindowPos(This->hWnd, NULL, Left, Top, Width, Height, SWP_NOZORDER)) return E_FAIL; @@ -2134,10 +2122,10 @@ static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight); @@ -2151,8 +2139,8 @@ static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight); @@ -2164,8 +2152,8 @@ static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface, - long *pWidth, - long *pHeight) { + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight); @@ -2177,10 +2165,10 @@ static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface, - long *pLeft, - long *pTop, - long *pWidth, - long *pHeight) { + LONG *pLeft, + LONG *pTop, + LONG *pWidth, + LONG *pHeight) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight); @@ -2189,16 +2177,16 @@ static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface, } static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface, - long HideCursor) { + LONG HideCursor) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); - FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor); + FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, HideCursor); return S_OK; } static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface, - long *CursorHidden) { + LONG *CursorHidden) { ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface); FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden); diff --git a/reactos/dll/directx/quartz/waveparser.c b/reactos/dll/directx/quartz/waveparser.c index dbc096cdb04..cbdfcebc3b8 100644 --- a/reactos/dll/directx/quartz/waveparser.c +++ b/reactos/dll/directx/quartz/waveparser.c @@ -73,7 +73,7 @@ static LONGLONG duration_to_bytepos(WAVEParserImpl *This, LONGLONG duration) static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR cookie) { - WAVEParserImpl *This = (WAVEParserImpl *)iface; + WAVEParserImpl *This = iface; LPBYTE pbSrcStream = NULL; ULONG cbSrcStream = 0; REFERENCE_TIME tStart, tStop; @@ -142,7 +142,7 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR if (tStop >= This->EndOfFile || (bytepos_to_duration(This, tStop) >= This->Parser.mediaSeeking.llStop) || hr == VFW_E_NOT_CONNECTED) { - int i; + unsigned int i; TRACE("End of file reached\n"); @@ -151,7 +151,7 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR IPin* ppin; HRESULT hr; - TRACE("Send End Of Stream to output pin %d\n", i); + TRACE("Send End Of Stream to output pin %u\n", i); hr = IPin_ConnectedTo(This->Parser.ppPins[i+1], &ppin); if (SUCCEEDED(hr)) @@ -333,7 +333,7 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin, static HRESULT WAVEParser_Cleanup(LPVOID iface) { - WAVEParserImpl *This = (WAVEParserImpl*)iface; + WAVEParserImpl *This = iface; TRACE("(%p)->()\n", This); @@ -342,7 +342,7 @@ static HRESULT WAVEParser_Cleanup(LPVOID iface) static HRESULT WAVEParser_first_request(LPVOID iface) { - WAVEParserImpl *This = (WAVEParserImpl *)iface; + WAVEParserImpl *This = iface; PullPin *pin = This->Parser.pInputPin; HRESULT hr; IMediaSample *sample; @@ -431,7 +431,7 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv) if (FAILED(hr)) return hr; - *ppv = (LPVOID)This; + *ppv = This; return hr; }