https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b313fd906e8ecb62e414f…
commit b313fd906e8ecb62e414f70712d2488b281f298b
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sun Jan 21 22:33:20 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sun Jan 21 22:33:20 2018 +0100
[QUARTZ] Sync with Wine 3.0. CORE-14225
---
dll/directx/wine/quartz/avisplit.c | 3 +-
dll/directx/wine/quartz/filesource.c | 36 ++++++-----
dll/directx/wine/quartz/filtergraph.c | 111 +++++++++++++++++-----------------
dll/directx/wine/quartz/parser.c | 25 ++++----
dll/directx/wine/quartz/pin.c | 5 +-
dll/directx/wine/quartz/pin.h | 5 +-
media/doc/README.WINE | 2 +-
7 files changed, 98 insertions(+), 89 deletions(-)
diff --git a/dll/directx/wine/quartz/avisplit.c b/dll/directx/wine/quartz/avisplit.c
index fbdd01a3a8..0f5c2d72ed 100644
--- a/dll/directx/wine/quartz/avisplit.c
+++ b/dll/directx/wine/quartz/avisplit.c
@@ -1098,8 +1098,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 (hr == S_OK && (list.fcc != FOURCC_LIST ||
- (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE)));
+ while (hr == S_OK && (list.fcc != FOURCC_LIST || list.fccListType !=
listtypeAVIMOVIE));
if (hr != S_OK)
{
diff --git a/dll/directx/wine/quartz/filesource.c b/dll/directx/wine/quartz/filesource.c
index 16a0419327..39227a1747 100644
--- a/dll/directx/wine/quartz/filesource.c
+++ b/dll/directx/wine/quartz/filesource.c
@@ -376,6 +376,8 @@ static IPin* WINAPI AsyncReader_GetPin(BaseFilter *iface, int pos)
{
AsyncReader *This = impl_from_BaseFilter(iface);
+ TRACE("%p->(%d)\n", This, pos);
+
if (pos >= 1 || !This->pOutputPin)
return NULL;
@@ -387,6 +389,8 @@ static LONG WINAPI AsyncReader_GetPinCount(BaseFilter *iface)
{
AsyncReader *This = impl_from_BaseFilter(iface);
+ TRACE("%p->()\n", This);
+
if (!This->pOutputPin)
return 0;
else
@@ -432,7 +436,7 @@ static HRESULT WINAPI AsyncReader_QueryInterface(IBaseFilter * iface,
REFIID rii
{
AsyncReader *This = impl_from_IBaseFilter(iface);
- TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv);
+ TRACE("%p->(%s, %p)\n", This, qzdebugstr_guid(riid), ppv);
*ppv = NULL;
@@ -467,7 +471,7 @@ static ULONG WINAPI AsyncReader_Release(IBaseFilter * iface)
AsyncReader *This = impl_from_IBaseFilter(iface);
ULONG refCount = InterlockedDecrement(&This->filter.refCount);
- TRACE("(%p)->() Release from %d\n", This, refCount + 1);
+ TRACE("%p->() Release from %d\n", This, refCount + 1);
if (!refCount)
{
@@ -499,7 +503,7 @@ static HRESULT WINAPI AsyncReader_Stop(IBaseFilter * iface)
{
AsyncReader *This = impl_from_IBaseFilter(iface);
- TRACE("()\n");
+ TRACE("%p->()\n", This);
This->filter.state = State_Stopped;
@@ -510,7 +514,7 @@ static HRESULT WINAPI AsyncReader_Pause(IBaseFilter * iface)
{
AsyncReader *This = impl_from_IBaseFilter(iface);
- TRACE("()\n");
+ TRACE("%p->()\n", This);
This->filter.state = State_Paused;
@@ -521,7 +525,7 @@ static HRESULT WINAPI AsyncReader_Run(IBaseFilter * iface,
REFERENCE_TIME tStart
{
AsyncReader *This = impl_from_IBaseFilter(iface);
- TRACE("(%s)\n", wine_dbgstr_longlong(tStart));
+ TRACE("%p->(%s)\n", This, wine_dbgstr_longlong(tStart));
This->filter.state = State_Running;
@@ -533,7 +537,7 @@ static HRESULT WINAPI AsyncReader_Run(IBaseFilter * iface,
REFERENCE_TIME tStart
static HRESULT WINAPI AsyncReader_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
{
AsyncReader *This = impl_from_IBaseFilter(iface);
- TRACE("(%s, %p)\n", debugstr_w(Id), ppPin);
+ TRACE("%p->(%s, %p)\n", This, debugstr_w(Id), ppPin);
if (!Id || !ppPin)
return E_POINTER;
@@ -596,7 +600,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface,
LPCOLESTR pszFi
IAsyncReader * pReader = NULL;
AsyncReader *This = impl_from_IFileSourceFilter(iface);
- TRACE("(%s, %p)\n", debugstr_w(pszFileName), pmt);
+ TRACE("%p->(%s, %p)\n", This, debugstr_w(pszFileName), pmt);
if (!pszFileName)
return E_POINTER;
@@ -677,7 +681,7 @@ static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter * iface,
LPOLESTR
{
AsyncReader *This = impl_from_IFileSourceFilter(iface);
- TRACE("(%p, %p)\n", ppszFileName, pmt);
+ TRACE("%p->(%p, %p)\n", This, ppszFileName, pmt);
if (!ppszFileName)
return E_POINTER;
@@ -873,7 +877,7 @@ static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(BasePin *
iface, IPin
BaseOutputPin *This = impl_BaseOutputPin_from_BasePin(iface);
HRESULT hr;
- TRACE("(%p, %p)\n", pReceivePin, pmt);
+ TRACE("%p->(%p, %p)\n", This, pReceivePin, pmt);
dump_AM_MEDIA_TYPE(pmt);
/* FIXME: call queryacceptproc */
@@ -981,7 +985,7 @@ static HRESULT WINAPI FileAsyncReader_RequestAllocator(IAsyncReader *
iface, IMe
HRESULT hr = S_OK;
- TRACE("(%p, %p, %p)\n", pPreferred, pProps, ppActual);
+ TRACE("%p->(%p, %p, %p)\n", This, pPreferred, pProps, ppActual);
if (!pProps->cbAlign || (pProps->cbAlign % DEF_ALIGNMENT) != 0)
pProps->cbAlign = DEF_ALIGNMENT;
@@ -1077,7 +1081,7 @@ static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader * iface,
IMediaSample
FileAsyncReader *This = impl_from_IAsyncReader(iface);
LPBYTE pBuffer = NULL;
- TRACE("(%p, %lx)\n", pSample, dwUser);
+ TRACE("%p->(%p, %lx)\n", This, pSample, dwUser);
if (!pSample)
return E_POINTER;
@@ -1155,7 +1159,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader *
iface, DWORD dw
FileAsyncReader *This = impl_from_IAsyncReader(iface);
DWORD buffer = ~0;
- TRACE("(%u, %p, %p)\n", dwTimeout, ppSample, pdwUser);
+ TRACE("%p->(%u, %p, %p)\n", This, dwTimeout, ppSample, pdwUser);
*ppSample = NULL;
*pdwUser = 0;
@@ -1320,7 +1324,7 @@ static HRESULT WINAPI FileAsyncReader_SyncRead(IAsyncReader * iface,
LONGLONG ll
HRESULT hr = S_OK;
FileAsyncReader *This = impl_from_IAsyncReader(iface);
- TRACE("(%s, %d, %p)\n", wine_dbgstr_longlong(llPosition), lLength,
pBuffer);
+ TRACE("%p->(%s, %d, %p)\n", This, wine_dbgstr_longlong(llPosition),
lLength, pBuffer);
ZeroMemory(&ovl, sizeof(ovl));
@@ -1355,7 +1359,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader * iface,
LONGLONG * pT
DWORD dwSizeHigh;
FileAsyncReader *This = impl_from_IAsyncReader(iface);
- TRACE("(%p, %p)\n", pTotal, pAvailable);
+ TRACE("%p->(%p, %p)\n", This, pTotal, pAvailable);
if (((dwSizeLow = GetFileSize(This->hFile, &dwSizeHigh)) == -1) &&
(GetLastError() != NO_ERROR))
@@ -1372,7 +1376,7 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader *
iface)
{
FileAsyncReader *This = impl_from_IAsyncReader(iface);
- TRACE("()\n");
+ TRACE("%p->()\n", This);
EnterCriticalSection(&This->csList);
This->bFlushing = TRUE;
@@ -1388,7 +1392,7 @@ static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader *
iface)
FileAsyncReader *This = impl_from_IAsyncReader(iface);
int x;
- TRACE("()\n");
+ TRACE("%p->()\n", This);
EnterCriticalSection(&This->csList);
ResetEvent(This->handle_list[This->samples]);
diff --git a/dll/directx/wine/quartz/filtergraph.c
b/dll/directx/wine/quartz/filtergraph.c
index 8e6dda73a3..b6538ab16c 100644
--- a/dll/directx/wine/quartz/filtergraph.c
+++ b/dll/directx/wine/quartz/filtergraph.c
@@ -179,6 +179,7 @@ typedef struct _IFilterGraphImpl {
GUID timeformatseek;
REFERENCE_TIME start_time;
REFERENCE_TIME pause_time;
+ LONGLONG stop_position;
LONG recursioncount;
IUnknown *pSite;
LONG version;
@@ -2457,6 +2458,52 @@ static HRESULT WINAPI MediaSeeking_GetDuration(IMediaSeeking
*iface, LONGLONG *p
return hr;
}
+static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG
*pStop)
+{
+ IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
+ HRESULT hr = S_OK;
+
+ TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
+
+ if (!pStop)
+ return E_POINTER;
+
+ EnterCriticalSection(&This->cs);
+ if (This->stop_position < 0)
+ /* Stop position not set, use duration instead */
+ hr = IMediaSeeking_GetDuration(iface, pStop);
+ else
+ *pStop = This->stop_position;
+ LeaveCriticalSection(&This->cs);
+
+ return hr;
+}
+
+static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG
*pCurrent)
+{
+ IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
+ LONGLONG time = 0;
+
+ if (!pCurrent)
+ return E_POINTER;
+
+ EnterCriticalSection(&This->cs);
+ if (This->state == State_Running && This->refClock &&
This->start_time >= 0)
+ {
+ IReferenceClock_GetTime(This->refClock, &time);
+ if (time)
+ time -= This->start_time;
+ }
+ if (This->pause_time > 0)
+ time += This->pause_time;
+ *pCurrent = time;
+ LeaveCriticalSection(&This->cs);
+
+ TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent
/ 10000)%1000));
+
+ return S_OK;
+}
+
static HRESULT WINAPI MediaSeeking_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG
*pTarget,
const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
{
@@ -2509,6 +2556,11 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking
*iface, LONGLONG *
(dwCurrentFlags & 0x7) != AM_SEEKING_NoPositioning)
FIXME("Adjust method %x not handled yet!\n", dwCurrentFlags &
0x7);
+ if ((dwStopFlags & 0x7) == AM_SEEKING_AbsolutePositioning)
+ This->stop_position = *pStop;
+ else if ((dwStopFlags & 0x7) != AM_SEEKING_NoPositioning)
+ FIXME("Stop position not handled yet!\n");
+
if (state == State_Running && !(dwCurrentFlags & AM_SEEKING_NoFlush))
IMediaControl_Pause(&This->IMediaControl_iface);
args.current = pCurrent;
@@ -2526,68 +2578,16 @@ static HRESULT WINAPI MediaSeeking_SetPositions(IMediaSeeking
*iface, LONGLONG *
return hr;
}
-static HRESULT WINAPI found_getposition(IFilterGraphImpl *This, IMediaSeeking *seek,
DWORD_PTR pargs)
-{
- struct pos_args *args = (void*)pargs;
-
- return IMediaSeeking_GetPositions(seek, args->current, args->stop);
-}
-
static HRESULT WINAPI MediaSeeking_GetPositions(IMediaSeeking *iface, LONGLONG
*pCurrent,
LONGLONG *pStop)
{
IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
- struct pos_args args;
- LONGLONG time = 0;
HRESULT hr;
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pCurrent, pStop);
-
- args.current = pCurrent;
- args.stop = pStop;
- EnterCriticalSection(&This->cs);
- hr = all_renderers_seek(This, found_getposition, (DWORD_PTR)&args);
- if (This->state == State_Running && This->refClock &&
This->start_time >= 0)
- {
- IReferenceClock_GetTime(This->refClock, &time);
- if (time)
- time -= This->start_time;
- }
- if (This->pause_time > 0)
- time += This->pause_time;
- *pCurrent += time;
- LeaveCriticalSection(&This->cs);
-
- return hr;
-}
-
-static HRESULT WINAPI MediaSeeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG
*pCurrent)
-{
- LONGLONG time;
- HRESULT hr;
-
- if (!pCurrent)
- return E_POINTER;
-
- hr = MediaSeeking_GetPositions(iface, pCurrent, &time);
-
- TRACE("Time: %u.%03u\n", (DWORD)(*pCurrent / 10000000), (DWORD)((*pCurrent
/ 10000)%1000));
-
- return hr;
-}
-
-static HRESULT WINAPI MediaSeeking_GetStopPosition(IMediaSeeking *iface, LONGLONG
*pStop)
-{
- IFilterGraphImpl *This = impl_from_IMediaSeeking(iface);
- LONGLONG time;
- HRESULT hr;
-
- TRACE("(%p/%p)->(%p)\n", This, iface, pStop);
-
- if (!pStop)
- return E_POINTER;
-
- hr = MediaSeeking_GetPositions(iface, &time, pStop);
+ hr = IMediaSeeking_GetCurrentPosition(iface, pCurrent);
+ if (SUCCEEDED(hr))
+ hr = IMediaSeeking_GetStopPosition(iface, pStop);
return hr;
}
@@ -5713,6 +5713,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
fimpl->nItfCacheEntries = 0;
memcpy(&fimpl->timeformatseek, &TIME_FORMAT_MEDIA_TIME, sizeof(GUID));
fimpl->start_time = fimpl->pause_time = 0;
+ fimpl->stop_position = -1;
fimpl->punkFilterMapper2 = NULL;
fimpl->recursioncount = 0;
fimpl->version = 0;
diff --git a/dll/directx/wine/quartz/parser.c b/dll/directx/wine/quartz/parser.c
index d24bd85c91..6f46ed7339 100644
--- a/dll/directx/wine/quartz/parser.c
+++ b/dll/directx/wine/quartz/parser.c
@@ -54,7 +54,7 @@ static IPin* WINAPI Parser_GetPin(BaseFilter *iface, int pos)
{
ParserImpl *This = impl_from_BaseFilter(iface);
- TRACE("Asking for pos %x\n", pos);
+ TRACE("%p->(%x)\n", This, pos);
/* Input pin also has a pin, hence the > and not >= */
if (pos > This->cStreams || pos < 0)
@@ -68,6 +68,8 @@ static LONG WINAPI Parser_GetPinCount(BaseFilter *iface)
{
ParserImpl *This = impl_from_BaseFilter(iface);
+ TRACE("%p->()\n", This);
+
return This->cStreams;
}
@@ -141,12 +143,8 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID
riid, LPVOID *
return S_OK;
}
- if (!IsEqualIID(riid, &IID_IPin) &&
- !IsEqualIID(riid, &IID_IVideoWindow) &&
- !IsEqualIID(riid, &IID_IAMFilterMiscFlags))
- {
+ if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid,
&IID_IVideoWindow))
FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
- }
return E_NOINTERFACE;
}
@@ -212,7 +210,7 @@ HRESULT WINAPI Parser_GetClassID(IBaseFilter * iface, CLSID * pClsid)
{
ParserImpl *This = impl_from_IBaseFilter(iface);
- TRACE("(%p)\n", pClsid);
+ TRACE("%p->(%p)\n", This, pClsid);
*pClsid = This->filter.clsid;
@@ -227,7 +225,7 @@ HRESULT WINAPI Parser_Stop(IBaseFilter * iface)
PullPin *pin = impl_PullPin_from_IPin(This->ppPins[0]);
ULONG i;
- TRACE("()\n");
+ TRACE("%p->()\n", This);
EnterCriticalSection(&pin->thread_lock);
@@ -265,7 +263,7 @@ HRESULT WINAPI Parser_Pause(IBaseFilter * iface)
ParserImpl *This = impl_from_IBaseFilter(iface);
PullPin *pin = impl_PullPin_from_IPin(This->ppPins[0]);
- TRACE("()\n");
+ TRACE("%p->()\n", This);
EnterCriticalSection(&pin->thread_lock);
EnterCriticalSection(&This->filter.csFilter);
@@ -301,7 +299,7 @@ HRESULT WINAPI Parser_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
ULONG i;
- TRACE("(%s)\n", wine_dbgstr_longlong(tStart));
+ TRACE("%p->(%s)\n", This, wine_dbgstr_longlong(tStart));
EnterCriticalSection(&pin->thread_lock);
EnterCriticalSection(&This->filter.csFilter);
@@ -347,7 +345,7 @@ HRESULT WINAPI Parser_GetState(IBaseFilter * iface, DWORD
dwMilliSecsTimeout, FI
PullPin *pin = impl_PullPin_from_IPin(This->ppPins[0]);
HRESULT hr = S_OK;
- TRACE("(%d, %p)\n", dwMilliSecsTimeout, pState);
+ TRACE("%p->(%d, %p)\n", This, dwMilliSecsTimeout, pState);
EnterCriticalSection(&pin->thread_lock);
EnterCriticalSection(&This->filter.csFilter);
@@ -368,7 +366,7 @@ HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface,
IReferenceClock *pClock
ParserImpl *This = impl_from_IBaseFilter(iface);
PullPin *pin = impl_PullPin_from_IPin(This->ppPins[0]);
- TRACE("(%p)\n", pClock);
+ TRACE("%p->(%p)\n", This, pClock);
EnterCriticalSection(&pin->thread_lock);
BaseFilterImpl_SetSyncSource(iface,pClock);
@@ -391,7 +389,8 @@ HRESULT WINAPI Parser_EnumPins(IBaseFilter * iface, IEnumPins
**ppEnum)
HRESULT WINAPI Parser_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
{
- FIXME("(%p)->(%s,%p)\n", iface, debugstr_w(Id), ppPin);
+ ParserImpl *This = impl_from_IBaseFilter(iface);
+ FIXME("(%p)->(%s,%p)\n", This, debugstr_w(Id), ppPin);
/* FIXME: critical section */
diff --git a/dll/directx/wine/quartz/pin.c b/dll/directx/wine/quartz/pin.c
index 50dd0c26aa..738b1c0609 100644
--- a/dll/directx/wine/quartz/pin.c
+++ b/dll/directx/wine/quartz/pin.c
@@ -209,7 +209,10 @@ static HRESULT PullPin_Init(const IPinVtbl *PullPin_Vtbl, const
PIN_INFO * pPinI
return S_OK;
}
-HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo,
SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC
pCleanUp, REQUESTPROC pCustomRequest, STOPPROCESSPROC pDone, LPCRITICAL_SECTION pCritSec,
IPin ** ppPin)
+HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo,
+ SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept,
+ CLEANUPPROC pCleanUp, REQUESTPROC pCustomRequest,
STOPPROCESSPROC pDone,
+ LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
{
PullPin * pPinImpl;
diff --git a/dll/directx/wine/quartz/pin.h b/dll/directx/wine/quartz/pin.h
index 84046bc1e2..2cc44c1d1d 100644
--- a/dll/directx/wine/quartz/pin.h
+++ b/dll/directx/wine/quartz/pin.h
@@ -104,7 +104,10 @@ typedef struct PullPin
#define Req_Pause 3
/*** Constructors ***/
-HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo,
SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, CLEANUPPROC
pCleanUp, STOPPROCESSPROC, REQUESTPROC pCustomRequest, LPCRITICAL_SECTION pCritSec, IPin
** ppPin);
+HRESULT PullPin_Construct(const IPinVtbl *PullPin_Vtbl, const PIN_INFO * pPinInfo,
+ SAMPLEPROC_PULL pSampleProc, LPVOID pUserData, QUERYACCEPTPROC
pQueryAccept,
+ CLEANUPPROC pCleanUp, REQUESTPROC pCustomRequest,
STOPPROCESSPROC pDone,
+ LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
/**************************/
/*** Pin Implementation ***/
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index bebb2f97bc..9bab464f27 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -39,7 +39,7 @@ reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
reactos/dll/directx/wine/dxdiagn # Synced to Wine-3.0
reactos/dll/directx/wine/msdmo # Synced to WineStaging-2.9
reactos/dll/directx/wine/qedit # Synced to Wine-3.0
-reactos/dll/directx/wine/quartz # Synced to WineStaging-2.16
+reactos/dll/directx/wine/quartz # Synced to Wine-3.0
reactos/dll/directx/wine/wined3d # Synced to Wine-3.0
reactos/dll/win32/activeds # Synced to WineStaging-2.9