Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f42b3a1f
Commit
f42b3a1f
authored
Mar 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/tests: Add a test for deferred item posting.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b75627ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
5 deletions
+112
-5
mfplat.spec
dlls/mfplat/mfplat.spec
+3
-3
queue.c
dlls/mfplat/queue.c
+47
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+60
-2
mfapi.h
include/mfapi.h
+2
-0
No files found.
dlls/mfplat/mfplat.spec
View file @
f42b3a1f
...
...
@@ -28,7 +28,7 @@
@ stub MFCalculateBitmapImageSize
@ stub MFCalculateImageSize
@ stub MFCancelCreateFile
@ st
ub MFCancelWorkItem
@ st
dcall MFCancelWorkItem(int64)
@ stub MFCompareFullToPartialMediaType
@ stub MFCompareSockaddrAddresses
@ stub MFConvertColorInfoFromDXVA
...
...
@@ -124,8 +124,8 @@
@ stdcall MFPutWorkItemEx(long ptr)
@ stub MFRecordError
@ stub MFRemovePeriodicCallback
@ st
ub MFScheduleWorkItem
@ st
ub MFScheduleWorkItemEx
@ st
dcall MFScheduleWorkItem(ptr ptr int64 ptr)
@ st
dcall MFScheduleWorkItemEx(ptr int64 ptr)
@ stub MFSerializeAttributesToStream
@ stub MFSerializeEvent
@ stub MFSerializeMediaTypeToStream
...
...
dlls/mfplat/queue.c
View file @
f42b3a1f
...
...
@@ -385,3 +385,50 @@ HRESULT WINAPI MFInvokeCallback(IMFAsyncResult *result)
return
hr
;
}
static
HRESULT
schedule_work_item
(
IMFAsyncResult
*
result
,
INT64
timeout
,
MFWORKITEM_KEY
*
key
)
{
FIXME
(
"%p, %s, %p.
\n
"
,
result
,
wine_dbgstr_longlong
(
timeout
),
key
);
return
E_NOTIMPL
;
}
/***********************************************************************
* MFScheduleWorkItemEx (mfplat.@)
*/
HRESULT
WINAPI
MFScheduleWorkItemEx
(
IMFAsyncResult
*
result
,
INT64
timeout
,
MFWORKITEM_KEY
*
key
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
result
,
wine_dbgstr_longlong
(
timeout
),
key
);
return
schedule_work_item
(
result
,
timeout
,
key
);
}
/***********************************************************************
* MFScheduleWorkItemEx (mfplat.@)
*/
HRESULT
WINAPI
MFScheduleWorkItem
(
IMFAsyncCallback
*
callback
,
IUnknown
*
state
,
INT64
timeout
,
MFWORKITEM_KEY
*
key
)
{
IMFAsyncResult
*
result
;
HRESULT
hr
;
TRACE
(
"%p, %p, %s, %p.
\n
"
,
callback
,
state
,
wine_dbgstr_longlong
(
timeout
),
key
);
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
callback
,
state
,
&
result
)))
return
hr
;
hr
=
schedule_work_item
(
result
,
timeout
,
key
);
IMFAsyncResult_Release
(
result
);
return
hr
;
}
/***********************************************************************
* MFCancelWorkItem (mfplat.@)
*/
HRESULT
WINAPI
MFCancelWorkItem
(
MFWORKITEM_KEY
key
)
{
FIXME
(
"%s.
\n
"
,
wine_dbgstr_longlong
(
key
));
return
E_NOTIMPL
;
}
dlls/mfplat/tests/mfplat.c
View file @
f42b3a1f
...
...
@@ -43,6 +43,7 @@ static HRESULT (WINAPI *pMFCreateMFByteStreamOnStream)(IStream *stream, IMFByteS
static
HRESULT
(
WINAPI
*
pMFCreateMemoryBuffer
)(
DWORD
max_length
,
IMFMediaBuffer
**
buffer
);
static
void
*
(
WINAPI
*
pMFHeapAlloc
)(
SIZE_T
size
,
ULONG
flags
,
char
*
file
,
int
line
,
EAllocationType
type
);
static
void
(
WINAPI
*
pMFHeapFree
)(
void
*
p
);
static
HRESULT
(
WINAPI
*
pMFPutWaitingWorkItem
)(
HANDLE
event
,
LONG
priority
,
IMFAsyncResult
*
result
,
MFWORKITEM_KEY
*
key
);
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
...
...
@@ -318,6 +319,7 @@ static void init_functions(void)
X
(
MFCreateMemoryBuffer
);
X
(
MFHeapAlloc
);
X
(
MFHeapFree
);
X
(
MFPutWaitingWorkItem
);
#undef X
}
...
...
@@ -718,13 +720,13 @@ static ULONG WINAPI testcallback_Release(IMFAsyncCallback *iface)
static
HRESULT
WINAPI
testcallback_GetParameters
(
IMFAsyncCallback
*
iface
,
DWORD
*
flags
,
DWORD
*
queue
)
{
ok
(
0
,
"Unexpected call
.
\n
"
);
ok
(
flags
!=
NULL
&&
queue
!=
NULL
,
"Unexpected arguments
.
\n
"
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
testcallback_Invoke
(
IMFAsyncCallback
*
iface
,
IMFAsyncResult
*
result
)
{
ok
(
0
,
"Unexpected call
.
\n
"
);
ok
(
result
!=
NULL
,
"Unexpected result object
.
\n
"
);
return
E_NOTIMPL
;
}
...
...
@@ -1035,6 +1037,61 @@ static void test_MFHeapAlloc(void)
pMFHeapFree
(
res
);
}
static
void
test_scheduled_items
(
void
)
{
IMFAsyncCallback
callback
=
{
&
testcallbackvtbl
};
IMFAsyncResult
*
result
;
MFWORKITEM_KEY
key
,
key2
;
HRESULT
hr
;
hr
=
MFStartup
(
MF_VERSION
,
MFSTARTUP_FULL
);
ok
(
hr
==
S_OK
,
"Failed to start up, hr %#x.
\n
"
,
hr
);
hr
=
MFScheduleWorkItem
(
&
callback
,
NULL
,
-
5000
,
&
key
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to schedule item, hr %#x.
\n
"
,
hr
);
hr
=
MFCancelWorkItem
(
key
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to cancel item, hr %#x.
\n
"
,
hr
);
hr
=
MFCancelWorkItem
(
key
);
todo_wine
ok
(
hr
==
MF_E_NOT_FOUND
||
broken
(
hr
==
S_OK
)
/* < win10 */
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
!
pMFPutWaitingWorkItem
)
{
skip
(
"Waiting items are not supported.
\n
"
);
return
;
}
hr
=
MFCreateAsyncResult
(
NULL
,
&
callback
,
NULL
,
&
result
);
ok
(
hr
==
S_OK
,
"Failed to create result, hr %#x.
\n
"
,
hr
);
hr
=
pMFPutWaitingWorkItem
(
NULL
,
0
,
result
,
&
key
);
ok
(
hr
==
S_OK
,
"Failed to add waiting item, hr %#x.
\n
"
,
hr
);
hr
=
pMFPutWaitingWorkItem
(
NULL
,
0
,
result
,
&
key2
);
ok
(
hr
==
S_OK
,
"Failed to add waiting item, hr %#x.
\n
"
,
hr
);
hr
=
MFCancelWorkItem
(
key
);
ok
(
hr
==
S_OK
,
"Failed to cancel item, hr %#x.
\n
"
,
hr
);
hr
=
MFCancelWorkItem
(
key2
);
ok
(
hr
==
S_OK
,
"Failed to cancel item, hr %#x.
\n
"
,
hr
);
IMFAsyncResult_Release
(
result
);
hr
=
MFScheduleWorkItem
(
&
callback
,
NULL
,
-
5000
,
&
key
);
ok
(
hr
==
S_OK
,
"Failed to schedule item, hr %#x.
\n
"
,
hr
);
hr
=
MFCancelWorkItem
(
key
);
ok
(
hr
==
S_OK
,
"Failed to cancel item, hr %#x.
\n
"
,
hr
);
hr
=
MFShutdown
();
ok
(
hr
==
S_OK
,
"Failed to shutdown, hr %#x.
\n
"
,
hr
);
}
START_TEST
(
mfplat
)
{
CoInitialize
(
NULL
);
...
...
@@ -1056,6 +1113,7 @@ START_TEST(mfplat)
test_MFCopyImage
();
test_MFCreateCollection
();
test_MFHeapAlloc
();
test_scheduled_items
();
CoUninitialize
();
}
include/mfapi.h
View file @
f42b3a1f
...
...
@@ -115,6 +115,8 @@ HRESULT WINAPI MFInvokeCallback(IMFAsyncResult *result);
HRESULT
WINAPI
MFLockPlatform
(
void
);
HRESULT
WINAPI
MFPutWorkItem
(
DWORD
queue
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
);
HRESULT
WINAPI
MFPutWorkItemEx
(
DWORD
queue
,
IMFAsyncResult
*
result
);
HRESULT
WINAPI
MFScheduleWorkItem
(
IMFAsyncCallback
*
callback
,
IUnknown
*
state
,
INT64
timeout
,
MFWORKITEM_KEY
*
key
);
HRESULT
WINAPI
MFScheduleWorkItemEx
(
IMFAsyncResult
*
result
,
INT64
timeout
,
MFWORKITEM_KEY
*
key
);
HRESULT
WINAPI
MFTRegister
(
CLSID
clsid
,
GUID
category
,
LPWSTR
name
,
UINT32
flags
,
UINT32
cinput
,
MFT_REGISTER_TYPE_INFO
*
input_types
,
UINT32
coutput
,
MFT_REGISTER_TYPE_INFO
*
output_types
,
IMFAttributes
*
attributes
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment