Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
58a93786
Commit
58a93786
authored
Mar 06, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add a stub for system time source.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3fb0b48e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
258 additions
and
1 deletion
+258
-1
main.c
dlls/mfplat/main.c
+215
-0
mfplat.spec
dlls/mfplat/mfplat.spec
+1
-1
mfplat.c
dlls/mfplat/tests/mfplat.c
+34
-0
mfidl.idl
include/mfidl.idl
+8
-0
No files found.
dlls/mfplat/main.c
View file @
58a93786
...
@@ -39,6 +39,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
...
@@ -39,6 +39,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static
LONG
platform_lock
;
static
LONG
platform_lock
;
struct
system_time_source
{
IMFPresentationTimeSource
IMFPresentationTimeSource_iface
;
IMFClockStateSink
IMFClockStateSink_iface
;
LONG
refcount
;
};
static
struct
system_time_source
*
impl_from_IMFPresentationTimeSource
(
IMFPresentationTimeSource
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
system_time_source
,
IMFPresentationTimeSource_iface
);
}
static
struct
system_time_source
*
impl_from_IMFClockStateSink
(
IMFClockStateSink
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
system_time_source
,
IMFClockStateSink_iface
);
}
static
const
WCHAR
transform_keyW
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'F'
,
'o'
,
'u'
,
'n'
,
'd'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
static
const
WCHAR
transform_keyW
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'F'
,
'o'
,
'u'
,
'n'
,
'd'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'f'
,
'o'
,
'r'
,
'm'
,
's'
,
0
};
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'f'
,
'o'
,
'r'
,
'm'
,
's'
,
0
};
static
const
WCHAR
categories_keyW
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'F'
,
'o'
,
'u'
,
'n'
,
'd'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
static
const
WCHAR
categories_keyW
[]
=
{
'M'
,
'e'
,
'd'
,
'i'
,
'a'
,
'F'
,
'o'
,
'u'
,
'n'
,
'd'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
...
@@ -3023,3 +3040,201 @@ HRESULT WINAPI MFCreateMFByteStreamOnStreamEx(IUnknown *stream, IMFByteStream **
...
@@ -3023,3 +3040,201 @@ HRESULT WINAPI MFCreateMFByteStreamOnStreamEx(IUnknown *stream, IMFByteStream **
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
system_time_source_QueryInterface
(
IMFPresentationTimeSource
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
system_time_source
*
source
=
impl_from_IMFPresentationTimeSource
(
iface
);
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IMFPresentationTimeSource
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
&
source
->
IMFPresentationTimeSource_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMFClockStateSink
))
{
*
obj
=
&
source
->
IMFClockStateSink_iface
;
}
else
{
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
obj
);
return
S_OK
;
}
static
ULONG
WINAPI
system_time_source_AddRef
(
IMFPresentationTimeSource
*
iface
)
{
struct
system_time_source
*
source
=
impl_from_IMFPresentationTimeSource
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
source
->
refcount
);
TRACE
(
"%p, refcount %u.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
system_time_source_Release
(
IMFPresentationTimeSource
*
iface
)
{
struct
system_time_source
*
source
=
impl_from_IMFPresentationTimeSource
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
source
->
refcount
);
TRACE
(
"%p, refcount %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
heap_free
(
source
);
return
refcount
;
}
static
HRESULT
WINAPI
system_time_source_GetClockCharacteristics
(
IMFPresentationTimeSource
*
iface
,
DWORD
*
flags
)
{
TRACE
(
"%p, %p.
\n
"
,
iface
,
flags
);
*
flags
=
MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ
|
MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK
;
return
S_OK
;
}
static
HRESULT
WINAPI
system_time_source_GetCorrelatedTime
(
IMFPresentationTimeSource
*
iface
,
DWORD
reserved
,
LONGLONG
*
clock_time
,
MFTIME
*
system_time
)
{
FIXME
(
"%p, %#x, %p, %p.
\n
"
,
iface
,
reserved
,
clock_time
,
system_time
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_GetContinuityKey
(
IMFPresentationTimeSource
*
iface
,
DWORD
*
key
)
{
TRACE
(
"%p, %p.
\n
"
,
iface
,
key
);
*
key
=
0
;
return
S_OK
;
}
static
HRESULT
WINAPI
system_time_source_GetState
(
IMFPresentationTimeSource
*
iface
,
DWORD
reserved
,
MFCLOCK_STATE
*
state
)
{
FIXME
(
"%p, %#x, %p.
\n
"
,
iface
,
reserved
,
state
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_GetProperties
(
IMFPresentationTimeSource
*
iface
,
MFCLOCK_PROPERTIES
*
props
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
props
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_GetUnderlyingClock
(
IMFPresentationTimeSource
*
iface
,
IMFClock
**
clock
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
clock
);
return
E_NOTIMPL
;
}
static
const
IMFPresentationTimeSourceVtbl
systemtimesourcevtbl
=
{
system_time_source_QueryInterface
,
system_time_source_AddRef
,
system_time_source_Release
,
system_time_source_GetClockCharacteristics
,
system_time_source_GetCorrelatedTime
,
system_time_source_GetContinuityKey
,
system_time_source_GetState
,
system_time_source_GetProperties
,
system_time_source_GetUnderlyingClock
,
};
static
HRESULT
WINAPI
system_time_source_sink_QueryInterface
(
IMFClockStateSink
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
system_time_source
*
source
=
impl_from_IMFClockStateSink
(
iface
);
return
IMFPresentationTimeSource_QueryInterface
(
&
source
->
IMFPresentationTimeSource_iface
,
riid
,
out
);
}
static
ULONG
WINAPI
system_time_source_sink_AddRef
(
IMFClockStateSink
*
iface
)
{
struct
system_time_source
*
source
=
impl_from_IMFClockStateSink
(
iface
);
return
IMFPresentationTimeSource_AddRef
(
&
source
->
IMFPresentationTimeSource_iface
);
}
static
ULONG
WINAPI
system_time_source_sink_Release
(
IMFClockStateSink
*
iface
)
{
struct
system_time_source
*
source
=
impl_from_IMFClockStateSink
(
iface
);
return
IMFPresentationTimeSource_Release
(
&
source
->
IMFPresentationTimeSource_iface
);
}
static
HRESULT
WINAPI
system_time_source_sink_OnClockStart
(
IMFClockStateSink
*
iface
,
MFTIME
system_time
,
LONGLONG
start_offset
)
{
FIXME
(
"%p, %s, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
system_time
),
wine_dbgstr_longlong
(
start_offset
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_sink_OnClockStop
(
IMFClockStateSink
*
iface
,
MFTIME
system_time
)
{
FIXME
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
system_time
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_sink_OnClockPause
(
IMFClockStateSink
*
iface
,
MFTIME
system_time
)
{
FIXME
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
system_time
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_sink_OnClockRestart
(
IMFClockStateSink
*
iface
,
MFTIME
system_time
)
{
FIXME
(
"%p, %s.
\n
"
,
iface
,
wine_dbgstr_longlong
(
system_time
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
system_time_source_sink_OnClockSetRate
(
IMFClockStateSink
*
iface
,
MFTIME
system_time
,
float
rate
)
{
FIXME
(
"%p, %s, %f.
\n
"
,
iface
,
wine_dbgstr_longlong
(
system_time
),
rate
);
return
E_NOTIMPL
;
}
static
const
IMFClockStateSinkVtbl
systemtimesourcesinkvtbl
=
{
system_time_source_sink_QueryInterface
,
system_time_source_sink_AddRef
,
system_time_source_sink_Release
,
system_time_source_sink_OnClockStart
,
system_time_source_sink_OnClockStop
,
system_time_source_sink_OnClockPause
,
system_time_source_sink_OnClockRestart
,
system_time_source_sink_OnClockSetRate
,
};
/***********************************************************************
* MFCreateSystemTimeSource (mfplat.@)
*/
HRESULT
WINAPI
MFCreateSystemTimeSource
(
IMFPresentationTimeSource
**
time_source
)
{
struct
system_time_source
*
object
;
TRACE
(
"%p.
\n
"
,
time_source
);
object
=
heap_alloc
(
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
IMFPresentationTimeSource_iface
.
lpVtbl
=
&
systemtimesourcevtbl
;
object
->
IMFClockStateSink_iface
.
lpVtbl
=
&
systemtimesourcesinkvtbl
;
object
->
refcount
=
1
;
*
time_source
=
&
object
->
IMFPresentationTimeSource_iface
;
return
S_OK
;
}
dlls/mfplat/mfplat.spec
View file @
58a93786
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
@ stub MFCreateSocketListener
@ stub MFCreateSocketListener
@ stdcall MFCreateSourceResolver(ptr)
@ stdcall MFCreateSourceResolver(ptr)
@ stdcall MFCreateStreamDescriptor(long long ptr ptr)
@ stdcall MFCreateStreamDescriptor(long long ptr ptr)
@ st
ub MFCreateSystemTimeSource
@ st
dcall MFCreateSystemTimeSource(ptr)
@ stub MFCreateSystemUnderlyingClock
@ stub MFCreateSystemUnderlyingClock
@ stub MFCreateTempFile
@ stub MFCreateTempFile
@ stub MFCreateTransformActivate
@ stub MFCreateTransformActivate
...
...
dlls/mfplat/tests/mfplat.c
View file @
58a93786
...
@@ -1598,6 +1598,39 @@ static void test_presentation_descriptor(void)
...
@@ -1598,6 +1598,39 @@ static void test_presentation_descriptor(void)
IMFMediaType_Release
(
media_type
);
IMFMediaType_Release
(
media_type
);
}
}
static
void
test_system_time_source
(
void
)
{
IMFPresentationTimeSource
*
time_source
;
IMFClockStateSink
*
statesink
;
MFCLOCK_STATE
state
;
DWORD
value
;
HRESULT
hr
;
hr
=
MFCreateSystemTimeSource
(
&
time_source
);
ok
(
hr
==
S_OK
,
"Failed to create time source, hr %#x.
\n
"
,
hr
);
hr
=
IMFPresentationTimeSource_GetClockCharacteristics
(
time_source
,
&
value
);
ok
(
hr
==
S_OK
,
"Failed to get flags, hr %#x.
\n
"
,
hr
);
ok
(
value
==
(
MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ
|
MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK
),
"Unexpected flags %#x.
\n
"
,
value
);
value
=
1
;
hr
=
IMFPresentationTimeSource_GetContinuityKey
(
time_source
,
&
value
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
value
==
0
,
"Unexpected value %u.
\n
"
,
value
);
hr
=
IMFPresentationTimeSource_GetState
(
time_source
,
0
,
&
state
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Failed to get state, hr %#x.
\n
"
,
hr
);
ok
(
state
==
MFCLOCK_STATE_INVALID
,
"Unexpected state %d.
\n
"
,
state
);
}
hr
=
IMFPresentationTimeSource_QueryInterface
(
time_source
,
&
IID_IMFClockStateSink
,
(
void
**
)
&
statesink
);
ok
(
hr
==
S_OK
,
"Failed to get state sink, hr %#x.
\n
"
,
hr
);
IMFClockStateSink_Release
(
statesink
);
IMFPresentationTimeSource_Release
(
time_source
);
}
START_TEST
(
mfplat
)
START_TEST
(
mfplat
)
{
{
CoInitialize
(
NULL
);
CoInitialize
(
NULL
);
...
@@ -1624,6 +1657,7 @@ START_TEST(mfplat)
...
@@ -1624,6 +1657,7 @@ START_TEST(mfplat)
test_periodic_callback
();
test_periodic_callback
();
test_event_queue
();
test_event_queue
();
test_presentation_descriptor
();
test_presentation_descriptor
();
test_system_time_source
();
CoUninitialize
();
CoUninitialize
();
}
}
include/mfidl.idl
View file @
58a93786
...
@@ -57,6 +57,13 @@ typedef struct _MFCLOCK_PROPERTIES
...
@@ -57,6 +57,13 @@ typedef struct _MFCLOCK_PROPERTIES
DWORD
dwClockJitter
;
DWORD
dwClockJitter
;
}
MFCLOCK_PROPERTIES
;
}
MFCLOCK_PROPERTIES
;
typedef
enum
_MFCLOCK_CHARACTERISTICS_FLAGS
{
MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ
=
0
x00000002
,
MFCLOCK_CHARACTERISTICS_FLAG_ALWAYS_RUNNING
=
0
x00000004
,
MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK
=
0
x00000008
,
}
MFCLOCK_CHARACTERISTICS_FLAGS
;
[
[
object
,
object
,
uuid
(
2
eb1e945
-
18b8
-
4139
-
9b1
a
-
d5d584818530
),
uuid
(
2
eb1e945
-
18b8
-
4139
-
9b1
a
-
d5d584818530
),
...
@@ -357,6 +364,7 @@ cpp_quote("HRESULT WINAPI MFCreateSequencerSource(IUnknown *reserved, IMFSequenc
...
@@ -357,6 +364,7 @@ cpp_quote("HRESULT WINAPI MFCreateSequencerSource(IUnknown *reserved, IMFSequenc
cpp_quote
(
"HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMediaTypes,"
)
cpp_quote
(
"HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMediaTypes,"
)
cpp_quote
(
" IMFMediaType **types, IMFStreamDescriptor **descriptor);"
)
cpp_quote
(
" IMFMediaType **types, IMFStreamDescriptor **descriptor);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateSystemTimeSource(IMFPresentationTimeSource **time_source);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopology(IMFTopology **topology);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopology(IMFTopology **topology);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopologyNode(MF_TOPOLOGY_TYPE node_type, IMFTopologyNode **node);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopologyNode(MF_TOPOLOGY_TYPE node_type, IMFTopologyNode **node);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopoLoader(IMFTopoLoader **loader);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTopoLoader(IMFTopoLoader **loader);"
)
...
...
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