Maarten Lankhorst : quartz: Add initial support for time formats in IMediaSeeking.
Alexandre Julliard
julliard at winehq.org
Sat Mar 15 05:53:51 CDT 2008
Module: wine
Branch: master
Commit: b662a6a556c8144cf7586d5f17b92f59b9dce3c4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b662a6a556c8144cf7586d5f17b92f59b9dce3c4
Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date: Fri Mar 14 12:35:42 2008 -0700
quartz: Add initial support for time formats in IMediaSeeking.
Only support the SYSTEM_MEDIA_TIME for now.
---
dlls/quartz/filtergraph.c | 46 ++++++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c
index cf89771..becbd72 100644
--- a/dlls/quartz/filtergraph.c
+++ b/dlls/quartz/filtergraph.c
@@ -198,6 +198,7 @@ typedef struct _IFilterGraphImpl {
IUnknown * pUnkOuter;
BOOL bUnkOuterValid;
BOOL bAggregatable;
+ GUID timeformatseek;
} IFilterGraphImpl;
static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This,
@@ -1717,7 +1718,16 @@ static HRESULT WINAPI MediaSeeking_IsFormatSupported(IMediaSeeking *iface,
const GUID *pFormat) {
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
+ if (!pFormat)
+ return E_POINTER;
+
+ TRACE("(%p/%p)->(%s)\n", This, iface, debugstr_guid(pFormat));
+
+ if (!IsEqualGUID(&TIME_FORMAT_MEDIA_TIME, pFormat))
+ {
+ FIXME("Unhandled time format %s\n", debugstr_guid(pFormat));
+ return S_FALSE;
+ }
return S_OK;
}
@@ -1726,7 +1736,11 @@ static HRESULT WINAPI MediaSeeking_QueryPreferredFormat(IMediaSeeking *iface,
GUID *pFormat) {
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
+ if (!pFormat)
+ return E_POINTER;
+
+ FIXME("(%p/%p)->(%p): semi-stub !!!\n", This, iface, pFormat);
+ memcpy(pFormat, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID));
return S_OK;
}
@@ -1735,7 +1749,11 @@ static HRESULT WINAPI MediaSeeking_GetTimeFormat(IMediaSeeking *iface,
GUID *pFormat) {
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
+ if (!pFormat)
+ return E_POINTER;
+
+ TRACE("(%p/%p)->(%p)\n", This, iface, pFormat);
+ memcpy(pFormat, &This->timeformatseek, sizeof(GUID));
return S_OK;
}
@@ -1744,7 +1762,12 @@ static HRESULT WINAPI MediaSeeking_IsUsingTimeFormat(IMediaSeeking *iface,
const GUID *pFormat) {
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
+ TRACE("(%p/%p)->(%p)\n", This, iface, pFormat);
+ if (!pFormat)
+ return E_POINTER;
+
+ if (memcmp(pFormat, &This->timeformatseek, sizeof(GUID)))
+ return S_FALSE;
return S_OK;
}
@@ -1753,7 +1776,19 @@ static HRESULT WINAPI MediaSeeking_SetTimeFormat(IMediaSeeking *iface,
const GUID *pFormat) {
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
- FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
+ if (!pFormat)
+ return E_POINTER;
+
+ TRACE("(%p/%p)->(%s)\n", This, iface, debugstr_guid(pFormat));
+
+ if (This->state != State_Stopped)
+ return VFW_E_WRONG_STATE;
+
+ if (!IsEqualGUID(&TIME_FORMAT_MEDIA_TIME, pFormat))
+ {
+ FIXME("Unhandled time format %s\n", debugstr_guid(pFormat));
+ return E_INVALIDARG;
+ }
return S_OK;
}
@@ -4759,6 +4794,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
InitializeCriticalSection(&fimpl->cs);
fimpl->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IFilterGraphImpl.cs");
fimpl->nItfCacheEntries = 0;
+ memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID));
hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
if (FAILED(hr)) {
More information about the wine-cvs
mailing list