- Sync quartz with Wine head

svn path=/trunk/; revision=40045
This commit is contained in:
Dmitry Chapyshev 2009-03-15 19:03:42 +00:00
parent ea9fc099f5
commit 57e8c21128
26 changed files with 871 additions and 888 deletions

View file

@ -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;

View file

@ -336,7 +336,7 @@ HRESULT AVIDec_create(IUnknown * pUnkOuter, LPVOID * ppv)
if (FAILED(hr))
return hr;
*ppv = (LPVOID)This;
*ppv = This;
return hr;
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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);

View file

@ -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)
{

View file

@ -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);

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -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));

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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;
}

View file

@ -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);

View file

@ -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__ */

View file

@ -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));

View file

@ -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) {

View file

@ -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
};

View file

@ -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);

View file

@ -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;
}