Commit 7b87278d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Forward async queue functionality to rtworkq.

parent 0c91600e
MODULE = mfplat.dll
IMPORTLIB = mfplat
IMPORTS = advapi32 ole32 mfuuid propsys
IMPORTS = advapi32 ole32 mfuuid propsys rtworkq
EXTRADLLFLAGS = -mno-cygwin
......
......@@ -40,6 +40,7 @@
#include "mfreadwrite.h"
#include "propvarutil.h"
#include "strsafe.h"
#include "rtworkq.h"
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
......@@ -64,8 +65,6 @@ static HRESULT heap_strdupW(const WCHAR *str, WCHAR **dest)
return hr;
}
static LONG platform_lock;
struct local_handler
{
struct list entry;
......@@ -1128,10 +1127,7 @@ HRESULT WINAPI MFStartup(ULONG version, DWORD flags)
if (version != MF_VERSION_XP && version != MF_VERSION_WIN7)
return MF_E_BAD_STARTUP_VERSION;
if (InterlockedIncrement(&platform_lock) == 1)
{
init_system_queues();
}
RtwqStartup();
return S_OK;
}
......@@ -1143,45 +1139,11 @@ HRESULT WINAPI MFShutdown(void)
{
TRACE("\n");
if (platform_lock <= 0)
return S_OK;
if (InterlockedExchangeAdd(&platform_lock, -1) == 1)
{
shutdown_system_queues();
}
return S_OK;
}
/***********************************************************************
* MFLockPlatform (mfplat.@)
*/
HRESULT WINAPI MFLockPlatform(void)
{
InterlockedIncrement(&platform_lock);
return S_OK;
}
/***********************************************************************
* MFUnlockPlatform (mfplat.@)
*/
HRESULT WINAPI MFUnlockPlatform(void)
{
if (InterlockedDecrement(&platform_lock) == 0)
{
shutdown_system_queues();
}
RtwqShutdown();
return S_OK;
}
BOOL is_platform_locked(void)
{
return platform_lock > 0;
}
/***********************************************************************
* MFCopyImage (mfplat.@)
*/
......
......@@ -15,9 +15,9 @@
@ stub GetAMSubtypeFromD3DFormat
@ stub GetD3DFormatFromMFSubtype
@ stub LFGetGlobalPool
@ stdcall MFAddPeriodicCallback(ptr ptr ptr)
@ stdcall MFAddPeriodicCallback(ptr ptr ptr) rtworkq.RtwqAddPeriodicCallback
@ stdcall MFAllocateWorkQueue(ptr)
@ stdcall MFAllocateWorkQueueEx(long ptr)
@ stdcall MFAllocateWorkQueueEx(long ptr) rtworkq.RtwqAllocateWorkQueue
@ stub MFAppendCollection
@ stub MFAverageTimePerFrameToFrameRate
@ stdcall MFBeginCreateFile(long long long wstr ptr ptr ptr)
......@@ -28,7 +28,7 @@
@ stub MFCalculateBitmapImageSize
@ stdcall MFCalculateImageSize(ptr long long ptr)
@ stdcall MFCancelCreateFile(ptr)
@ stdcall MFCancelWorkItem(int64)
@ stdcall MFCancelWorkItem(int64) rtworkq.RtwqCancelWorkItem
@ stdcall MFCompareFullToPartialMediaType(ptr ptr)
@ stub MFCompareSockaddrAddresses
@ stub MFConvertColorInfoFromDXVA
......@@ -121,9 +121,9 @@
@ stub MFInitVideoFormat_RGB
@ stdcall MFInvokeCallback(ptr)
@ stub MFJoinIoPort
@ stdcall MFLockPlatform()
@ stdcall MFLockWorkQueue(long)
@ stdcall MFPutWaitingWorkItem(long long ptr ptr)
@ stdcall MFLockPlatform() rtworkq.RtwqLockPlatform
@ stdcall MFLockWorkQueue(long) rtworkq.RtwqLockWorkQueue
@ stdcall MFPutWaitingWorkItem(long long ptr ptr) rtworkq.RtwqPutWaitingWorkItem
@ stdcall MFPutWorkItem(long ptr ptr)
@ stdcall MFPutWorkItem2(long long ptr ptr)
@ stdcall MFPutWorkItemEx(long ptr)
......@@ -131,7 +131,7 @@
@ stub MFRecordError
@ stdcall MFRegisterLocalByteStreamHandler(wstr wstr ptr)
@ stdcall MFRegisterLocalSchemeHandler(wstr ptr)
@ stdcall MFRemovePeriodicCallback(long)
@ stdcall MFRemovePeriodicCallback(long) rtworkq.RtwqRemovePeriodicCallback
@ stdcall MFScheduleWorkItem(ptr ptr int64 ptr)
@ stdcall MFScheduleWorkItemEx(ptr int64 ptr)
@ stub MFSerializeAttributesToStream
......@@ -154,8 +154,8 @@
@ stub MFTraceError
@ stub MFTraceFuncEnter
@ stub MFUnblockThread
@ stdcall MFUnlockPlatform()
@ stdcall MFUnlockWorkQueue(long)
@ stdcall MFUnlockPlatform() rtworkq.RtwqUnlockPlatform
@ stdcall MFUnlockWorkQueue(long) rtworkq.RtwqUnlockWorkQueue
@ stdcall MFUnwrapMediaType(ptr ptr)
@ stub MFValidateMediaTypeSize
@ stdcall MFWrapMediaType(ptr ptr ptr ptr)
......
......@@ -87,10 +87,6 @@ extern HRESULT attributes_GetItemByIndex(struct attributes *object, UINT32 index
PROPVARIANT *value) DECLSPEC_HIDDEN;
extern HRESULT attributes_CopyAllItems(struct attributes *object, IMFAttributes *dest) DECLSPEC_HIDDEN;
extern void init_system_queues(void) DECLSPEC_HIDDEN;
extern void shutdown_system_queues(void) DECLSPEC_HIDDEN;
extern BOOL is_platform_locked(void) DECLSPEC_HIDDEN;
static inline BOOL mf_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
{
size_t new_capacity, max_capacity;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment