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
a343a317
Commit
a343a317
authored
Dec 01, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/topoloader: Set MF_TOPONODE_DECODER for the decoders.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
940adfdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
mf.c
dlls/mf/tests/mf.c
+8
-2
topology.c
dlls/mf/topology.c
+22
-5
No files found.
dlls/mf/tests/mf.c
View file @
a343a317
...
...
@@ -1740,7 +1740,6 @@ static void test_topology_loader(void)
{
/* PCM -> PCM, different bps. */
&
MFMediaType_Audio
,
/* Source type */
{
{
{
&
MF_MT_SUBTYPE
,
WAVE_FORMAT_PCM
},
...
...
@@ -1751,7 +1750,6 @@ static void test_topology_loader(void)
{
&
MF_MT_AUDIO_BITS_PER_SAMPLE
,
8
},
}
},
/* Sink type */
{
{
{
&
MF_MT_SUBTYPE
,
WAVE_FORMAT_PCM
},
...
...
@@ -2039,6 +2037,14 @@ todo_wine {
hr
=
IMFTopologyNode_GetObject
(
mft_node
,
&
node_object
);
ok
(
hr
==
S_OK
,
"Failed to get object of transform node, hr %#x.
\n
"
,
hr
);
if
(
test
->
flags
&
LOADER_EXPECTED_DECODER
)
{
value
=
0
;
hr
=
IMFTopologyNode_GetUINT32
(
mft_node
,
&
MF_TOPONODE_DECODER
,
&
value
);
ok
(
hr
==
S_OK
,
"Failed to get attribute, hr %#x.
\n
"
,
hr
);
ok
(
value
==
1
,
"Unexpected value.
\n
"
);
}
hr
=
IUnknown_QueryInterface
(
node_object
,
&
IID_IMFTransform
,
(
void
**
)
&
transform
);
ok
(
hr
==
S_OK
,
"Failed to get IMFTransform from transform node's object, hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
node_object
);
...
...
dlls/mf/topology.c
View file @
a343a317
...
...
@@ -1996,6 +1996,7 @@ struct transform_output_type
{
IMFMediaType
*
type
;
IMFTransform
*
transform
;
const
GUID
*
category
;
};
struct
connect_context
...
...
@@ -2053,6 +2054,7 @@ static HRESULT topology_loader_enumerate_output_types(const GUID *category, IMFM
unsigned
int
output_count
=
0
;
output_type
.
transform
=
transform
;
output_type
.
category
=
category
;
while
(
SUCCEEDED
(
IMFTransform_GetOutputAvailableType
(
transform
,
0
,
output_count
++
,
&
output_type
.
type
)))
{
hr
=
connect_func
(
&
output_type
,
context
);
...
...
@@ -2073,6 +2075,24 @@ static HRESULT topology_loader_enumerate_output_types(const GUID *category, IMFM
return
hr
;
}
static
HRESULT
topology_loader_create_transform
(
const
struct
transform_output_type
*
output_type
,
IMFTopologyNode
**
node
)
{
HRESULT
hr
;
if
(
FAILED
(
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TRANSFORM_NODE
,
node
)))
return
hr
;
IMFTopologyNode_SetObject
(
*
node
,
(
IUnknown
*
)
output_type
->
transform
);
if
(
IsEqualGUID
(
output_type
->
category
,
&
MFT_CATEGORY_AUDIO_DECODER
)
||
IsEqualGUID
(
output_type
->
category
,
&
MFT_CATEGORY_VIDEO_DECODER
))
{
IMFTopologyNode_SetUINT32
(
*
node
,
&
MF_TOPONODE_DECODER
,
1
);
}
return
hr
;
}
static
HRESULT
connect_to_sink
(
struct
transform_output_type
*
output_type
,
struct
connect_context
*
context
)
{
IMFTopologyNode
*
node
;
...
...
@@ -2081,10 +2101,9 @@ static HRESULT connect_to_sink(struct transform_output_type *output_type, struct
if
(
FAILED
(
IMFMediaTypeHandler_IsMediaTypeSupported
(
context
->
sink_handler
,
output_type
->
type
,
NULL
)))
return
MF_E_TRANSFORM_NOT_POSSIBLE_FOR_CURRENT_MEDIATYPE_COMBINATION
;
if
(
FAILED
(
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TRANSFORM_NODE
,
&
node
)))
if
(
FAILED
(
hr
=
topology_loader_create_transform
(
output_type
,
&
node
)))
return
hr
;
IMFTopologyNode_SetObject
(
node
,
(
IUnknown
*
)
output_type
->
transform
);
IMFTopology_AddNode
(
context
->
context
->
output_topology
,
node
);
IMFTopologyNode_ConnectOutput
(
context
->
upstream_node
,
0
,
node
,
0
);
IMFTopologyNode_ConnectOutput
(
node
,
0
,
context
->
sink
,
0
);
...
...
@@ -2107,11 +2126,9 @@ static HRESULT connect_to_converter(struct transform_output_type *output_type, s
if
(
SUCCEEDED
(
connect_to_sink
(
output_type
,
context
)))
return
S_OK
;
if
(
FAILED
(
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_TRANSFORM_NODE
,
&
node
)))
if
(
FAILED
(
hr
=
topology_loader_create_transform
(
output_type
,
&
node
)))
return
hr
;
IMFTopologyNode_SetObject
(
node
,
(
IUnknown
*
)
output_type
->
transform
);
sink_ctx
=
*
context
;
sink_ctx
.
upstream_node
=
node
;
...
...
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