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
40c99239
Commit
40c99239
authored
Feb 18, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Handle realtime mode flag.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d1eebf3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
5 deletions
+64
-5
main.c
dlls/mfmediaengine/main.c
+27
-4
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+37
-1
No files found.
dlls/mfmediaengine/main.c
View file @
40c99239
...
...
@@ -1169,6 +1169,9 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
IMFTopologyNode
*
sar_node
=
NULL
,
*
audio_src
=
NULL
;
IMFTopologyNode
*
grabber_node
=
NULL
,
*
video_src
=
NULL
;
if
(
engine
->
flags
&
MF_MEDIA_ENGINE_REAL_TIME_MODE
)
IMFTopology_SetUINT32
(
topology
,
&
MF_LOW_LATENCY
,
TRUE
);
if
(
sd_audio
)
{
if
(
FAILED
(
hr
=
media_engine_create_source_node
(
source
,
pd
,
sd_audio
,
&
audio_src
)))
...
...
@@ -2695,16 +2698,36 @@ static HRESULT WINAPI media_engine_SetAudioEndpointRole(IMFMediaEngineEx *iface,
static
HRESULT
WINAPI
media_engine_GetRealTimeMode
(
IMFMediaEngineEx
*
iface
,
BOOL
*
enabled
)
{
FIXME
(
"%p, %p stub.
\n
"
,
iface
,
enabled
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
enabled
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
*
enabled
=
!!
(
engine
->
flags
&
MF_MEDIA_ENGINE_REAL_TIME_MODE
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetRealTimeMode
(
IMFMediaEngineEx
*
iface
,
BOOL
enable
)
{
FIXME
(
"%p, %d stub.
\n
"
,
iface
,
enable
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %d.
\n
"
,
iface
,
enable
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
media_engine_set_flag
(
engine
,
MF_MEDIA_ENGINE_REAL_TIME_MODE
,
enable
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetCurrentTimeEx
(
IMFMediaEngineEx
*
iface
,
double
seektime
,
MF_MEDIA_ENGINE_SEEK_MODE
mode
)
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
40c99239
...
...
@@ -240,12 +240,14 @@ static void test_factory(void)
static
void
test_CreateInstance
(
void
)
{
struct
media_engine_notify
*
notify
;
IMFMediaEngineEx
*
media_engine_ex
;
IMFDXGIDeviceManager
*
manager
;
IMFMediaEngine
*
media_engine
;
IMFAttributes
*
attributes
;
IUnknown
*
unk
;
UINT
token
;
HRESULT
hr
;
BOOL
ret
;
notify
=
create_callback
();
...
...
@@ -273,7 +275,8 @@ static void test_CreateInstance(void)
hr
=
IMFAttributes_SetUINT32
(
attributes
,
&
MF_MEDIA_ENGINE_VIDEO_OUTPUT_FORMAT
,
DXGI_FORMAT_UNKNOWN
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineClassFactory_CreateInstance
(
factory
,
MF_MEDIA_ENGINE_WAITFORSTABLE_STATE
,
attributes
,
&
media_engine
);
hr
=
IMFMediaEngineClassFactory_CreateInstance
(
factory
,
MF_MEDIA_ENGINE_REAL_TIME_MODE
|
MF_MEDIA_ENGINE_WAITFORSTABLE_STATE
,
attributes
,
&
media_engine
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
check_interface
(
media_engine
,
&
IID_IMFMediaEngine
,
TRUE
);
...
...
@@ -283,6 +286,29 @@ static void test_CreateInstance(void)
if
(
SUCCEEDED
(
hr
))
IUnknown_Release
(
unk
);
if
(
SUCCEEDED
(
IMFMediaEngine_QueryInterface
(
media_engine
,
&
IID_IMFMediaEngineEx
,
(
void
**
)
&
media_engine_ex
)))
{
hr
=
IMFMediaEngineEx_GetRealTimeMode
(
media_engine_ex
,
&
ret
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
ret
,
"Unexpected value.
\n
"
);
hr
=
IMFMediaEngineEx_SetRealTimeMode
(
media_engine_ex
,
FALSE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetRealTimeMode
(
media_engine_ex
,
&
ret
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
ret
,
"Unexpected value.
\n
"
);
hr
=
IMFMediaEngineEx_SetRealTimeMode
(
media_engine_ex
,
TRUE
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetRealTimeMode
(
media_engine_ex
,
&
ret
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
ret
,
"Unexpected value.
\n
"
);
IMFMediaEngineEx_Release
(
media_engine_ex
);
}
IMFMediaEngine_Release
(
media_engine
);
IMFAttributes_Release
(
attributes
);
IMFDXGIDeviceManager_Release
(
manager
);
...
...
@@ -301,6 +327,7 @@ static void test_Shutdown(void)
double
val
;
HRESULT
hr
;
BSTR
str
;
BOOL
ret
;
notify
=
create_callback
();
...
...
@@ -457,6 +484,15 @@ static void test_Shutdown(void)
hr
=
IMFMediaEngineEx_GetResourceCharacteristics
(
media_engine_ex
,
&
flags
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetRealTimeMode
(
media_engine_ex
,
NULL
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetRealTimeMode
(
media_engine_ex
,
&
ret
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_SetRealTimeMode
(
media_engine_ex
,
TRUE
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaEngineEx_Release
(
media_engine_ex
);
}
...
...
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