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
346c2d8d
Commit
346c2d8d
authored
Aug 11, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Allow resolving topology with missing downstream current type.
And without enumerating the downstream types either.
parent
245ac9b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
mf.c
dlls/mf/tests/mf.c
+4
-2
topology_loader.c
dlls/mf/topology_loader.c
+26
-27
No files found.
dlls/mf/tests/mf.c
View file @
346c2d8d
...
...
@@ -1374,8 +1374,10 @@ static HRESULT WINAPI test_handler_GetMediaTypeByIndex(IMFMediaTypeHandler *ifac
static
HRESULT
WINAPI
test_handler_SetCurrentMediaType
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
*
media_type
)
{
/* FIXME: Wine sets downstream media type when resolving topology, native doesn't */
todo_wine
ok
(
0
,
"Unexpected call.
\n
"
);
return
E_NOTIMPL
;
return
S_OK
;
}
static
HRESULT
WINAPI
test_handler_GetCurrentMediaType
(
IMFMediaTypeHandler
*
iface
,
IMFMediaType
**
media_type
)
...
...
@@ -2424,7 +2426,7 @@ static void test_topology_loader(void)
/* RGB32 -> Any Video, no current output type */
.
input_type
=
&
video_i420_1280
,
.
output_type
=
&
video_dummy
,
.
sink_method
=
-
1
,
.
source_method
=
-
1
,
.
expected_result
=
S_OK
,
.
flags
=
LOADER_NO_CURRENT_OUTPUT
|
LOADER_TODO
,
.
flags
=
LOADER_NO_CURRENT_OUTPUT
,
},
{
/* RGB32 -> Any Video, no current output type, refuse input type */
...
...
dlls/mf/topology_loader.c
View file @
346c2d8d
...
...
@@ -253,7 +253,6 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
IMFTopologyNode
*
node
;
unsigned
int
i
,
count
;
GUID
category
,
guid
;
DWORD
flags
;
HRESULT
hr
;
TRACE
(
"topology %p, method_mask %#x, branch %s, up_type %p, down_type %p.
\n
"
,
...
...
@@ -263,13 +262,15 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
return
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
up_type
,
&
MF_MT_SUBTYPE
,
&
input_info
.
guidSubtype
)))
return
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_GetMajorType
(
down_type
,
&
output_info
.
guidMajorType
)))
return
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
down_type
,
&
MF_MT_SUBTYPE
,
&
output_info
.
guidSubtype
)))
return
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_IsEqual
(
up_type
,
down_type
,
&
flags
))
||
!
(
flags
&
MF_MEDIATYPE_EQUAL_MAJOR_TYPES
))
return
MF_E_INVALIDMEDIATYPE
;
if
(
!
down_type
)
output_info
=
input_info
;
else
{
if
(
FAILED
(
hr
=
IMFMediaType_GetMajorType
(
down_type
,
&
output_info
.
guidMajorType
)))
return
hr
;
if
(
FAILED
(
hr
=
IMFMediaType_GetGUID
(
down_type
,
&
MF_MT_SUBTYPE
,
&
output_info
.
guidSubtype
)))
return
hr
;
}
if
(
IsEqualGUID
(
&
input_info
.
guidMajorType
,
&
MFMediaType_Audio
))
category
=
decoder
?
MFT_CATEGORY_AUDIO_DECODER
:
MFT_CATEGORY_AUDIO_EFFECT
;
...
...
@@ -300,10 +301,13 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
IMFTopologyNode_SetGUID
(
node
,
&
MF_TOPONODE_TRANSFORM_OBJECTID
,
&
guid
);
hr
=
topology_branch_connect_down
(
topology
,
MF_CONNECT_DIRECT
,
&
up_branch
,
up_type
);
if
(
SUCCEEDED
(
hr
))
hr
=
topology_branch_fill_media_type
(
up_type
,
down_type
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMFTransform_SetOutputType
(
transform
,
0
,
down_type
,
0
);
if
(
down_type
)
{
if
(
SUCCEEDED
(
hr
))
hr
=
topology_branch_fill_media_type
(
up_type
,
down_type
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMFTransform_SetOutputType
(
transform
,
0
,
down_type
,
0
);
}
IMFTransform_Release
(
transform
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -328,8 +332,8 @@ static HRESULT topology_branch_connect_down(IMFTopology *topology, MF_CONNECT_ME
struct
topology_branch
*
branch
,
IMFMediaType
*
up_type
)
{
IMFMediaTypeHandler
*
down_handler
;
IMFMediaType
*
down_type
=
NULL
;
MF_CONNECT_METHOD
method
;
IMFMediaType
*
down_type
;
DWORD
flags
;
HRESULT
hr
;
...
...
@@ -346,27 +350,18 @@ static HRESULT topology_branch_connect_down(IMFTopology *topology, MF_CONNECT_ME
&&
IMFMediaType_IsEqual
(
up_type
,
down_type
,
&
flags
)
==
S_OK
)
{
TRACE
(
"Connecting branch %s with current type %p.
\n
"
,
debugstr_topology_branch
(
branch
),
up_type
);
IMFMediaTypeHandler_Release
(
down_handler
);
IMFMediaType_Release
(
down_type
);
return
IMFTopologyNode_ConnectOutput
(
branch
->
up
.
node
,
branch
->
up
.
stream
,
branch
->
down
.
node
,
branch
->
down
.
stream
);
hr
=
IMFTopologyNode_ConnectOutput
(
branch
->
up
.
node
,
branch
->
up
.
stream
,
branch
->
down
.
node
,
branch
->
down
.
stream
);
goto
done
;
}
if
(
FAILED
(
hr
)
&&
FAILED
(
hr
=
IMFMediaTypeHandler_GetMediaTypeByIndex
(
down_handler
,
0
,
&
down_type
)))
return
hr
;
if
(
SUCCEEDED
(
hr
=
IMFMediaTypeHandler_IsMediaTypeSupported
(
down_handler
,
up_type
,
NULL
))
&&
SUCCEEDED
(
hr
=
IMFMediaTypeHandler_SetCurrentMediaType
(
down_handler
,
up_type
)))
{
TRACE
(
"Connected branch %s with upstream type %p.
\n
"
,
debugstr_topology_branch
(
branch
),
up_type
);
IMFMediaTypeHandler_Release
(
down_handler
);
IMFMediaType_Release
(
down_type
);
return
IMFTopologyNode_ConnectOutput
(
branch
->
up
.
node
,
branch
->
up
.
stream
,
branch
->
down
.
node
,
branch
->
down
.
stream
);
hr
=
IMFTopologyNode_ConnectOutput
(
branch
->
up
.
node
,
branch
->
up
.
stream
,
branch
->
down
.
node
,
branch
->
down
.
stream
);
goto
done
;
}
IMFMediaTypeHandler_Release
(
down_handler
);
if
(
FAILED
(
hr
)
&&
(
method
&
method_mask
&
MF_CONNECT_ALLOW_CONVERTER
)
==
MF_CONNECT_ALLOW_CONVERTER
)
hr
=
topology_branch_connect_indirect
(
topology
,
MF_CONNECT_ALLOW_CONVERTER
,
branch
,
up_type
,
down_type
);
...
...
@@ -375,7 +370,11 @@ static HRESULT topology_branch_connect_down(IMFTopology *topology, MF_CONNECT_ME
hr
=
topology_branch_connect_indirect
(
topology
,
MF_CONNECT_ALLOW_DECODER
,
branch
,
up_type
,
down_type
);
IMFMediaType_Release
(
down_type
);
done:
if
(
down_type
)
IMFMediaType_Release
(
down_type
);
IMFMediaTypeHandler_Release
(
down_handler
);
return
hr
;
}
...
...
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