[QUARTZ] Sync with Wine Staging 3.3. CORE-14434

This commit is contained in:
Amine Khaldi 2018-03-08 13:46:24 +01:00
parent 7446d8c8a2
commit 83d28845a1
26 changed files with 413 additions and 102 deletions

View file

@ -35,7 +35,7 @@ list(APPEND SOURCE
videorenderer.c
vmr9.c
waveparser.c
quartz_private.h)
precomp.h)
add_library(quartz SHARED
${SOURCE}
@ -57,5 +57,5 @@ set_module_type(quartz win32dll)
target_link_libraries(quartz strmbase strmiids uuid dxguid wine ${PSEH_LIB})
add_importlibs(quartz dsound msacm32 msvfw32 ole32 oleaut32 rpcrt4 user32 gdi32 advapi32 advapi32_vista shlwapi msvcrt kernel32 ntdll)
add_dependencies(quartz dxsdk quartz_idlheader stdole2)
add_pch(quartz quartz_private.h SOURCE)
add_pch(quartz precomp.h SOURCE)
add_cd_file(TARGET quartz DESTINATION reactos/system32 FOR all)

View file

@ -18,7 +18,26 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "mmreg.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "msacm.h"
#include <assert.h>
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct ACMWrapperImpl
{

View file

@ -18,7 +18,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "vfw.h"
#include "dvdmedia.h"
#include <assert.h>
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct AVIDecImpl
{

View file

@ -30,6 +30,21 @@
*/
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfw.h"
#include "aviriff.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include <math.h>
#include <assert.h>
#include "parser.h"
#define TWOCCFromFOURCC(fcc) HIWORD(fcc)
@ -37,6 +52,8 @@
#define ckidINFO mmioFOURCC('I','N','F','O')
#define ckidREC mmioFOURCC('R','E','C',' ')
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct StreamData
{
DWORD dwSampleSize;

View file

@ -18,7 +18,25 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "dsound.h"
#include "amaudio.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
/* NOTE: buffer can still be filled completely,
* but we start waiting until only this amount is buffered

View file

@ -20,6 +20,10 @@
#include "quartz_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct IEnumFiltersImpl
{
IEnumFilters IEnumFilters_iface;

View file

@ -20,6 +20,10 @@
#include "quartz_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt)
{
if (!pmt)

View file

@ -18,8 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "quartz_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct EnumMonikerImpl
{
IEnumMoniker IEnumMoniker_iface;

View file

@ -20,6 +20,12 @@
#include "quartz_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct IEnumRegFiltersImpl
{
IEnumRegFilters IEnumRegFilters_iface;

View file

@ -18,8 +18,23 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "quartz_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "winbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const WCHAR wszOutputPinName[] = { 'O','u','t','p','u','t',0 };
typedef struct AsyncReader

View file

@ -18,7 +18,28 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "shlwapi.h"
#include "dshow.h"
#include "wine/debug.h"
#include "quartz_private.h"
#include "ole2.h"
#include "olectl.h"
#include "strmif.h"
#include "vfwmsgs.h"
#include "evcode.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct {
HWND hWnd; /* Target window */
@ -179,7 +200,6 @@ typedef struct _IFilterGraphImpl {
GUID timeformatseek;
REFERENCE_TIME start_time;
REFERENCE_TIME pause_time;
LONGLONG stop_position;
LONG recursioncount;
IUnknown *pSite;
LONG version;
@ -1028,6 +1048,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut,
if (IsEqualGUID(&clsid, &FilterCLSID)) {
/* Skip filter (same as the one the output pin belongs to) */
IBaseFilter_Release(pfilter);
pfilter = NULL;
goto error;
}
@ -2458,52 +2479,6 @@ 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)
{
@ -2556,11 +2531,6 @@ 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;
@ -2578,16 +2548,68 @@ 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);
hr = IMediaSeeking_GetCurrentPosition(iface, pCurrent);
if (SUCCEEDED(hr))
hr = IMediaSeeking_GetStopPosition(iface, 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);
return hr;
}
@ -5713,7 +5735,6 @@ 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;

View file

@ -19,10 +19,29 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "quartz_private.h"
#include <initguid.h>
#include <fil_data.h>
#include "ole2.h"
#include "olectl.h"
#include "strmif.h"
#include "wine/unicode.h"
#include "uuids.h"
#include "initguid.h"
#include "fil_data.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
#undef ARRAYSIZE
#define ARRAYSIZE(array) (sizeof(array)/sizeof((array)[0]))

View file

@ -17,7 +17,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/debug.h"
#include "quartz_private.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN;
extern HRESULT WINAPI QUARTZ_DllCanUnloadNow(void) DECLSPEC_HIDDEN;

View file

@ -18,9 +18,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "quartz_private.h"
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
#include <wine/list.h>
#include "windef.h"
#include "winbase.h"
#include "vfwmsgs.h"
#include "quartz_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct StdMediaSample2
{

View file

@ -21,10 +21,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include <math.h>
#include "quartz_private.h"
#include "pin.h"
#include <strmif.h>
#include "uuids.h"
#include "mmreg.h"
#include "mmsystem.h"
#include "wine/winternl.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "parser.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
#define SEQUENCE_HEADER_CODE 0xB3
#define PACK_START_CODE 0xBA

View file

@ -19,7 +19,25 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "ddraw.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct NullRendererImpl
{

View file

@ -20,6 +20,20 @@
*/
#include "quartz_private.h"
#include "pin.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include <math.h>
#include <assert.h>
#include "parser.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
static const IMediaSeekingVtbl Parser_Seeking_Vtbl;
@ -143,8 +157,12 @@ HRESULT WINAPI Parser_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID *
return S_OK;
}
if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
if (!IsEqualIID(riid, &IID_IPin) &&
!IsEqualIID(riid, &IID_IVideoWindow) &&
!IsEqualIID(riid, &IID_IAMFilterMiscFlags))
{
FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
}
return E_NOINTERFACE;
}

View file

@ -19,6 +19,15 @@
*/
#include "quartz_private.h"
#include "pin.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
#define ALIGNDOWN(value,boundary) ((value)/(boundary)*(boundary))
#define ALIGNUP(value,boundary) (ALIGNDOWN((value)+(boundary)-1, (boundary)))
@ -532,11 +541,7 @@ static void PullPin_Thread_Stop(PullPin *This)
TRACE("(%p)->()\n", This);
EnterCriticalSection(This->pin.pCritSec);
{
CloseHandle(This->hThread);
This->hThread = NULL;
SetEvent(This->hEventStateChanged);
}
SetEvent(This->hEventStateChanged);
LeaveCriticalSection(This->pin.pCritSec);
IBaseFilter_Release(This->pin.pinInfo.pFilter);
@ -822,6 +827,10 @@ HRESULT WINAPI PullPin_Disconnect(IPin *iface)
}
LeaveCriticalSection(This->pin.pCritSec);
WaitForSingleObject(This->hThread, INFINITE);
CloseHandle(This->hThread);
This->hThread = NULL;
return hr;
}

View file

@ -0,0 +1,29 @@
#ifndef _QUARTZ_PRECOMP_H_
#define _QUARTZ_PRECOMP_H_
#include <wine/config.h>
#include <assert.h>
#define WIN32_LEAN_AND_MEAN
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "quartz_private.h"
#include <dvdmedia.h>
#include <vfw.h>
#include <aviriff.h>
#include <shlwapi.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include "pin.h"
#include "parser.h"
#endif /* !_QUARTZ_PRECOMP_H_ */

View file

@ -20,37 +20,18 @@
#ifndef __QUARTZ_PRIVATE_INCLUDED__
#define __QUARTZ_PRIVATE_INCLUDED__
#include <wine/config.h>
#include <stdarg.h>
#include <assert.h>
#define WIN32_LEAN_AND_MEAN
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include <windef.h>
#include <winbase.h>
#include <objbase.h>
#include <dshow.h>
#include <dvdmedia.h>
#include <vfw.h>
#include <aviriff.h>
#include <shlwapi.h>
#include <wine/strmbase.h>
#include <wine/unicode.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
#include "pin.h"
#include "parser.h"
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
#include "wingdi.h"
#include "winuser.h"
#include "dshow.h"
#include "wine/strmbase.h"
#include "wine/list.h"
/* see IAsyncReader::Request on MSDN for the explanation of this */
#define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000)

View file

@ -18,9 +18,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "quartz_private.h"
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define COBJMACROS
#include <stdarg.h>
#include <string.h>
#include <uuids.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "winerror.h"
#include "ole2.h"
#include "uuids.h"
#include "strmif.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
/*
* Near the bottom of this file are the exported DllRegisterServer and

View file

@ -20,6 +20,12 @@
#include "quartz_private.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include <assert.h>
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct SystemClockAdviseEntry SystemClockAdviseEntry;
struct SystemClockAdviseEntry {
SystemClockAdviseEntry* next;
@ -223,7 +229,7 @@ static ULONG WINAPI SystemClockImpl_Release(IReferenceClock* iface) {
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p): ReleaseRef to %d\n", This, ref);
if (ref == 0) {
if (SystemClockPostMessageToAdviseThread(This, ADVISE_EXIT)) {
if (This->adviseThreadActive && SystemClockPostMessageToAdviseThread(This, ADVISE_EXIT)) {
WaitForSingleObject(This->adviseThread, INFINITE);
CloseHandle(This->adviseThread);
}

View file

@ -18,7 +18,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "ddraw.h"
#include "dvdmedia.h"
#include <assert.h>
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct VideoRendererImpl
{

View file

@ -20,10 +20,28 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "quartz_private.h"
#include <d3d9.h>
#include <vmr9.h>
#include "uuids.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "ddraw.h"
#include "dvdmedia.h"
#include "d3d9.h"
#include "vmr9.h"
#include "pin.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
struct quartz_vmr
{

View file

@ -19,6 +19,22 @@
*/
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "aviriff.h"
#include "vfwmsgs.h"
#include "mmsystem.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include <math.h>
#include <assert.h>
#include "parser.h"
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n',0};

View file

@ -39,7 +39,7 @@ reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-3.3
reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.3
reactos/dll/directx/wine/qedit # Synced to WineStaging-3.3
reactos/dll/directx/wine/quartz # Synced to Wine-3.0
reactos/dll/directx/wine/quartz # Synced to WineStaging-3.3
reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.3
reactos/dll/win32/activeds # Synced to WineStaging-2.9