Maarten Lankhorst : quartz: Add mediaseeking stub to audio renderer.
Alexandre Julliard
julliard at winehq.org
Thu Mar 20 09:48:21 CDT 2008
Module: wine
Branch: master
Commit: 9ec4240065f1494fb90c2e1aa61be1330f9fe340
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ec4240065f1494fb90c2e1aa61be1330f9fe340
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Wed Mar 19 18:29:09 2008 -0700
quartz: Add mediaseeking stub to audio renderer.
---
dlls/quartz/dsoundrender.c | 76 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c
index 6c5d3f1..ec1b9fe 100644
--- a/dlls/quartz/dsoundrender.c
+++ b/dlls/quartz/dsoundrender.c
@@ -45,6 +45,7 @@ static const IPinVtbl DSoundRender_InputPin_Vtbl;
static const IMemInputPinVtbl MemInputPin_Vtbl;
static const IBasicAudioVtbl IBasicAudio_Vtbl;
static const IReferenceClockVtbl IReferenceClock_Vtbl;
+static const IMediaSeekingVtbl IMediaSeeking_Vtbl;
typedef struct DSoundRenderImpl
{
@@ -71,11 +72,31 @@ typedef struct DSoundRenderImpl
DWORD last_play_pos;
DWORD play_loops;
REFERENCE_TIME play_time;
+ MediaSeekingImpl mediaSeeking;
long volume;
long pan;
} DSoundRenderImpl;
+static HRESULT sound_mod_stop(IBaseFilter *iface)
+{
+ FIXME("(%p) stub\n", iface);
+ return S_OK;
+}
+
+static HRESULT sound_mod_start(IBaseFilter *iface)
+{
+ FIXME("(%p) stub\n", iface);
+ return S_OK;
+}
+
+static HRESULT sound_mod_rate(IBaseFilter *iface)
+{
+ FIXME("(%p) stub\n", iface);
+ return S_OK;
+}
+
+
static HRESULT DSoundRender_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
{
InputPin * pPinImpl;
@@ -315,6 +336,9 @@ HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
if (SUCCEEDED(hr))
{
+ MediaSeekingImpl_Init((IBaseFilter*)pDSoundRender, sound_mod_stop, sound_mod_start, sound_mod_rate, &pDSoundRender->mediaSeeking, &pDSoundRender->csFilter);
+ pDSoundRender->mediaSeeking.lpVtbl = &IMediaSeeking_Vtbl;
+
pDSoundRender->ppPins[0] = (IPin *)pDSoundRender->pInputPin;
*ppv = (LPVOID)pDSoundRender;
}
@@ -350,6 +374,8 @@ static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter * iface, REFIID ri
*ppv = (LPVOID)&(This->IBasicAudio_vtbl);
else if (IsEqualIID(riid, &IID_IReferenceClock))
*ppv = (LPVOID)&(This->IReferenceClock_vtbl);
+ else if (IsEqualIID(riid, &IID_IMediaSeeking))
+ *ppv = &This->mediaSeeking.lpVtbl;
if (*ppv)
{
@@ -1071,3 +1097,53 @@ static const IReferenceClockVtbl IReferenceClock_Vtbl =
ReferenceClock_AdvisePeriodic,
ReferenceClock_Unadvise
};
+
+static inline DSoundRenderImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
+{
+ return (DSoundRenderImpl *)((char*)iface - FIELD_OFFSET(DSoundRenderImpl, mediaSeeking.lpVtbl));
+}
+
+static HRESULT WINAPI sound_seek_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv)
+{
+ DSoundRenderImpl *This = impl_from_IMediaSeeking(iface);
+
+ return IUnknown_QueryInterface((IUnknown *)This, riid, ppv);
+}
+
+static ULONG WINAPI sound_seek_AddRef(IMediaSeeking * iface)
+{
+ DSoundRenderImpl *This = impl_from_IMediaSeeking(iface);
+
+ return IUnknown_AddRef((IUnknown *)This);
+}
+
+static ULONG WINAPI sound_seek_Release(IMediaSeeking * iface)
+{
+ DSoundRenderImpl *This = impl_from_IMediaSeeking(iface);
+
+ return IUnknown_Release((IUnknown *)This);
+}
+
+static const IMediaSeekingVtbl IMediaSeeking_Vtbl =
+{
+ sound_seek_QueryInterface,
+ sound_seek_AddRef,
+ sound_seek_Release,
+ MediaSeekingImpl_GetCapabilities,
+ MediaSeekingImpl_CheckCapabilities,
+ MediaSeekingImpl_IsFormatSupported,
+ MediaSeekingImpl_QueryPreferredFormat,
+ MediaSeekingImpl_GetTimeFormat,
+ MediaSeekingImpl_IsUsingTimeFormat,
+ MediaSeekingImpl_SetTimeFormat,
+ MediaSeekingImpl_GetDuration,
+ MediaSeekingImpl_GetStopPosition,
+ MediaSeekingImpl_GetCurrentPosition,
+ MediaSeekingImpl_ConvertTimeFormat,
+ MediaSeekingImpl_SetPositions,
+ MediaSeekingImpl_GetPositions,
+ MediaSeekingImpl_GetAvailable,
+ MediaSeekingImpl_SetRate,
+ MediaSeekingImpl_GetRate,
+ MediaSeekingImpl_GetPreroll
+};
More information about the wine-cvs
mailing list