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
2086698e
Commit
2086698e
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: Implement GetPresentationAttribute().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
40c99239
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
main.c
dlls/mfmediaengine/main.c
+19
-4
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+8
-0
No files found.
dlls/mfmediaengine/main.c
View file @
2086698e
...
@@ -143,6 +143,7 @@ struct media_engine
...
@@ -143,6 +143,7 @@ struct media_engine
struct
struct
{
{
IMFMediaSource
*
source
;
IMFMediaSource
*
source
;
IMFPresentationDescriptor
*
pd
;
}
presentation
;
}
presentation
;
struct
struct
{
{
...
@@ -1079,9 +1080,11 @@ static void media_engine_clear_presentation(struct media_engine *engine)
...
@@ -1079,9 +1080,11 @@ static void media_engine_clear_presentation(struct media_engine *engine)
{
{
if
(
engine
->
presentation
.
source
)
if
(
engine
->
presentation
.
source
)
{
{
IMFMediaSource_Shutdown
(
engine
->
presentation
.
source
);
IMFMediaSource_Shutdown
(
engine
->
presentation
.
source
);
IMFMediaSource_Release
(
engine
->
presentation
.
source
);
IMFMediaSource_Release
(
engine
->
presentation
.
source
);
}
}
if
(
engine
->
presentation
.
pd
)
IMFPresentationDescriptor_Release
(
engine
->
presentation
.
pd
);
memset
(
&
engine
->
presentation
,
0
,
sizeof
(
engine
->
presentation
));
memset
(
&
engine
->
presentation
,
0
,
sizeof
(
engine
->
presentation
));
}
}
...
@@ -1151,6 +1154,8 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
...
@@ -1151,6 +1154,8 @@ static HRESULT media_engine_create_topology(struct media_engine *engine, IMFMedi
engine
->
presentation
.
source
=
source
;
engine
->
presentation
.
source
=
source
;
IMFMediaSource_AddRef
(
engine
->
presentation
.
source
);
IMFMediaSource_AddRef
(
engine
->
presentation
.
source
);
engine
->
presentation
.
pd
=
pd
;
IMFPresentationDescriptor_AddRef
(
engine
->
presentation
.
pd
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_VIDEO
,
!!
sd_video
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_VIDEO
,
!!
sd_video
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_AUDIO
,
!!
sd_audio
);
media_engine_set_flag
(
engine
,
FLAGS_ENGINE_HAS_AUDIO
,
!!
sd_audio
);
...
@@ -2474,9 +2479,19 @@ static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *
...
@@ -2474,9 +2479,19 @@ static HRESULT WINAPI media_engine_GetResourceCharacteristics(IMFMediaEngineEx *
static
HRESULT
WINAPI
media_engine_GetPresentationAttribute
(
IMFMediaEngineEx
*
iface
,
REFGUID
attribute
,
static
HRESULT
WINAPI
media_engine_GetPresentationAttribute
(
IMFMediaEngineEx
*
iface
,
REFGUID
attribute
,
PROPVARIANT
*
value
)
PROPVARIANT
*
value
)
{
{
FIXME
(
"%p, %s, %p stub.
\n
"
,
iface
,
debugstr_guid
(
attribute
),
value
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngineEx
(
iface
);
HRESULT
hr
=
E_FAIL
;
return
E_NOTIMPL
;
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
attribute
),
value
);
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
engine
->
presentation
.
pd
)
hr
=
IMFPresentationDescriptor_GetItem
(
engine
->
presentation
.
pd
,
attribute
,
value
);
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
}
static
HRESULT
WINAPI
media_engine_GetNumberOfStreams
(
IMFMediaEngineEx
*
iface
,
DWORD
*
stream_count
)
static
HRESULT
WINAPI
media_engine_GetNumberOfStreams
(
IMFMediaEngineEx
*
iface
,
DWORD
*
stream_count
)
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
2086698e
...
@@ -321,6 +321,7 @@ static void test_Shutdown(void)
...
@@ -321,6 +321,7 @@ static void test_Shutdown(void)
IMFMediaEngineEx
*
media_engine_ex
;
IMFMediaEngineEx
*
media_engine_ex
;
IMFMediaTimeRange
*
time_range
;
IMFMediaTimeRange
*
time_range
;
IMFMediaEngine
*
media_engine
;
IMFMediaEngine
*
media_engine
;
PROPVARIANT
propvar
;
DWORD
flags
,
cx
,
cy
;
DWORD
flags
,
cx
,
cy
;
unsigned
int
state
;
unsigned
int
state
;
UINT32
value
;
UINT32
value
;
...
@@ -493,6 +494,9 @@ static void test_Shutdown(void)
...
@@ -493,6 +494,9 @@ static void test_Shutdown(void)
hr
=
IMFMediaEngineEx_SetRealTimeMode
(
media_engine_ex
,
TRUE
);
hr
=
IMFMediaEngineEx_SetRealTimeMode
(
media_engine_ex
,
TRUE
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetPresentationAttribute
(
media_engine_ex
,
&
MF_PD_DURATION
,
&
propvar
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaEngineEx_Release
(
media_engine_ex
);
IMFMediaEngineEx_Release
(
media_engine_ex
);
}
}
...
@@ -905,6 +909,7 @@ static void test_SetSourceFromByteStream(void)
...
@@ -905,6 +909,7 @@ static void test_SetSourceFromByteStream(void)
{
{
struct
media_engine_notify
*
notify
;
struct
media_engine_notify
*
notify
;
IMFMediaEngineEx
*
media_engine
;
IMFMediaEngineEx
*
media_engine
;
PROPVARIANT
propvar
;
DWORD
flags
;
DWORD
flags
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -927,6 +932,9 @@ static void test_SetSourceFromByteStream(void)
...
@@ -927,6 +932,9 @@ static void test_SetSourceFromByteStream(void)
hr
=
IMFMediaEngineEx_GetResourceCharacteristics
(
media_engine
,
&
flags
);
hr
=
IMFMediaEngineEx_GetResourceCharacteristics
(
media_engine
,
&
flags
);
ok
(
hr
==
E_FAIL
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFMediaEngineEx_GetPresentationAttribute
(
media_engine
,
&
MF_PD_DURATION
,
&
propvar
);
ok
(
hr
==
E_FAIL
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFMediaEngineEx_Release
(
media_engine
);
IMFMediaEngineEx_Release
(
media_engine
);
IMFMediaEngineNotify_Release
(
&
notify
->
IMFMediaEngineNotify_iface
);
IMFMediaEngineNotify_Release
(
&
notify
->
IMFMediaEngineNotify_iface
);
}
}
...
...
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