quartz: Implement MediaSeekingPassThru.

This commit is contained in:
Maarten Lankhorst 2010-05-22 14:04:38 +02:00 committed by Alexandre Julliard
parent 9c07be4399
commit 5fbef39607
1 changed files with 148 additions and 82 deletions

View File

@ -710,190 +710,256 @@ static ULONG WINAPI MediaSeekingPassThru_Release(IMediaSeeking *iface)
return SeekOuter_Release(This); return SeekOuter_Release(This);
} }
static HRESULT get_connected(PassThruImpl *This, IMediaSeeking **seek) {
HRESULT hr;
IPin *pin;
*seek = NULL;
hr = IPin_ConnectedTo(This->pin, &pin);
if (FAILED(hr))
return hr;
hr = IPin_QueryInterface(pin, &IID_IMediaSeeking, (void**)seek);
IPin_Release(pin);
if (FAILED(hr))
hr = E_NOTIMPL;
return hr;
}
static HRESULT WINAPI MediaSeekingPassThru_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) static HRESULT WINAPI MediaSeekingPassThru_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities); TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetCapabilities(seek, pCapabilities);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities) static HRESULT WINAPI MediaSeekingPassThru_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities); TRACE("(%p/%p)->(%p)\n", iface, This, pCapabilities);
hr = get_connected(This, &seek);
if (!pCapabilities) if (SUCCEEDED(hr)) {
return E_POINTER; hr = IMediaSeeking_CheckCapabilities(seek, pCapabilities);
IMediaSeeking_Release(seek);
FIXME("stub\n"); }
return E_NOTIMPL; return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat) static HRESULT WINAPI MediaSeekingPassThru_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat)); TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat));
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_IsFormatSupported(seek, pFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat) static HRESULT WINAPI MediaSeekingPassThru_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pFormat); TRACE("(%p/%p)->(%p)\n", iface, This, pFormat);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_QueryPreferredFormat(seek, pFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat) static HRESULT WINAPI MediaSeekingPassThru_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pFormat); TRACE("(%p/%p)->(%p)\n", iface, This, pFormat);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetTimeFormat(seek, pFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat) static HRESULT WINAPI MediaSeekingPassThru_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat)); TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat));
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_IsUsingTimeFormat(seek, pFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat) static HRESULT WINAPI MediaSeekingPassThru_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat)); TRACE("(%p/%p)->(%s)\n", iface, This, qzdebugstr_guid(pFormat));
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_SetTimeFormat(seek, pFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration) static HRESULT WINAPI MediaSeekingPassThru_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
PIN_INFO info; IMediaSeeking *seek;
HRESULT hr; HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pDuration); TRACE("(%p/%p)->(%p)\n", iface, This, pDuration);
hr = get_connected(This, &seek);
IPin_QueryPinInfo(This->pin, &info); if (SUCCEEDED(hr)) {
hr = IMediaSeeking_GetDuration(seek, pDuration);
hr = ForwardCmdSeek(NULL, info.pFilter, fwd_getduration, pDuration); IMediaSeeking_Release(seek);
IBaseFilter_Release(info.pFilter); }
return hr; return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop) static HRESULT WINAPI MediaSeekingPassThru_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pStop); TRACE("(%p/%p)->(%p)\n", iface, This, pStop);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetStopPosition(seek, pStop);
IMediaSeeking_Release(seek);
}
return hr;
} }
/* FIXME: Make use of the info the filter should expose */
static HRESULT WINAPI MediaSeekingPassThru_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent) static HRESULT WINAPI MediaSeekingPassThru_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, pCurrent); TRACE("(%p/%p)->(%p)\n", iface, This, pCurrent);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetCurrentPosition(seek, pCurrent);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat) static HRESULT WINAPI MediaSeekingPassThru_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p,%s,%x%08x,%s)\n", iface, This, pTarget, debugstr_guid(pTargetFormat), (DWORD)(Source>>32), (DWORD)Source, debugstr_guid(pSourceFormat)); TRACE("(%p/%p)->(%p,%s,%x%08x,%s)\n", iface, This, pTarget, debugstr_guid(pTargetFormat), (DWORD)(Source>>32), (DWORD)Source, debugstr_guid(pSourceFormat));
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_ConvertTimeFormat(seek, pTarget, pTargetFormat, Source, pSourceFormat);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags) static HRESULT WINAPI MediaSeekingPassThru_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
struct pos_args args; IMediaSeeking *seek;
PIN_INFO info;
HRESULT hr; HRESULT hr;
TRACE("(%p/%p)->(%p,%x,%p,%x)\n", iface, This, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
TRACE("(%p/%p)->(%p, %p)\n", iface, This, pCurrent, pStop); hr = get_connected(This, &seek);
args.current = pCurrent; if (SUCCEEDED(hr)) {
args.stop = pStop; hr = IMediaSeeking_SetPositions(seek, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
args.curflags = dwCurrentFlags; IMediaSeeking_Release(seek);
args.stopflags = dwStopFlags; }
IPin_QueryPinInfo(This->pin, &info);
hr = ForwardCmdSeek(NULL, info.pFilter, fwd_setposition, &args);
IBaseFilter_Release(info.pFilter);
return hr; return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop) static HRESULT WINAPI MediaSeekingPassThru_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p, %p)\n", iface, This, pCurrent, pStop); TRACE("(%p/%p)->(%p, %p)\n", iface, This, pCurrent, pStop);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetPositions(seek, pCurrent, pStop);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest) static HRESULT WINAPI MediaSeekingPassThru_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p,%p)\n", iface, This, pEarliest, pLatest); TRACE("(%p/%p)->(%p,%p)\n", iface, This, pEarliest, pLatest);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetAvailable(seek, pEarliest, pLatest);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_SetRate(IMediaSeeking * iface, double dRate) static HRESULT WINAPI MediaSeekingPassThru_SetRate(IMediaSeeking * iface, double dRate)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%e)\n", iface, This, dRate); TRACE("(%p/%p)->(%e)\n", iface, This, dRate);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_SetRate(seek, dRate);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetRate(IMediaSeeking * iface, double * dRate) static HRESULT WINAPI MediaSeekingPassThru_GetRate(IMediaSeeking * iface, double * dRate)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface); ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p/%p)->(%p)\n", iface, This, dRate); TRACE("(%p/%p)->(%p)\n", iface, This, dRate);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetRate(seek, dRate);
IMediaSeeking_Release(seek);
}
return hr;
} }
static HRESULT WINAPI MediaSeekingPassThru_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll) static HRESULT WINAPI MediaSeekingPassThru_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll)
{ {
ICOM_THIS_MULTI(PassThruImpl, IMediaSeeking_vtbl, iface);
IMediaSeeking *seek;
HRESULT hr;
TRACE("(%p)\n", pPreroll); TRACE("(%p)\n", pPreroll);
hr = get_connected(This, &seek);
FIXME("stub\n"); if (SUCCEEDED(hr)) {
return E_NOTIMPL; hr = IMediaSeeking_GetPreroll(seek, pPreroll);
IMediaSeeking_Release(seek);
}
return hr;
} }
static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl = static const IMediaSeekingVtbl IMediaSeekingPassThru_Vtbl =