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
ba379952
Commit
ba379952
authored
Mar 01, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 01, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf/topology_loader: Only propagate some media type attributes.
parent
7325dd4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
18 deletions
+42
-18
topology_loader.c
dlls/mf/topology_loader.c
+42
-18
No files found.
dlls/mf/topology_loader.c
View file @
ba379952
...
@@ -215,26 +215,50 @@ static HRESULT topology_node_list_branches(IMFTopologyNode *node, struct list *b
...
@@ -215,26 +215,50 @@ static HRESULT topology_node_list_branches(IMFTopologyNode *node, struct list *b
return
hr
;
return
hr
;
}
}
static
HRESULT
topology_branch_fill_media_type
(
IMFMediaType
*
up_type
,
IMFMediaType
*
down_type
)
static
void
media_type_try_copy_attr
(
IMFMediaType
*
dst
,
IMFMediaType
*
src
,
const
GUID
*
attr
,
HRESULT
*
hr
)
{
{
HRESULT
hr
=
S_OK
;
PROPVARIANT
value
;
PROPVARIANT
value
;
UINT32
count
;
GUID
key
;
if
(
FAILED
(
hr
=
IMFMediaType_GetCount
(
up_type
,
&
count
)))
PropVariantInit
(
&
value
);
return
hr
;
if
(
SUCCEEDED
(
*
hr
)
&&
FAILED
(
IMFMediaType_GetItem
(
dst
,
attr
,
NULL
))
&&
SUCCEEDED
(
IMFMediaType_GetItem
(
src
,
attr
,
&
value
)))
*
hr
=
IMFMediaType_SetItem
(
dst
,
attr
,
&
value
);
PropVariantClear
(
&
value
);
}
while
(
count
--
)
/* update a media type with additional attributes reported by upstream element */
{
/* also present in mfreadwrite/reader.c pipeline */
PropVariantInit
(
&
value
);
static
HRESULT
update_media_type_from_upstream
(
IMFMediaType
*
media_type
,
IMFMediaType
*
upstream_type
)
hr
=
IMFMediaType_GetItemByIndex
(
up_type
,
count
,
&
key
,
&
value
);
{
if
(
SUCCEEDED
(
hr
)
&&
FAILED
(
IMFMediaType_GetItem
(
down_type
,
&
key
,
NULL
)))
HRESULT
hr
=
S_OK
;
hr
=
IMFMediaType_SetItem
(
down_type
,
&
key
,
&
value
);
PropVariantClear
(
&
value
);
/* propagate common video attributes */
if
(
FAILED
(
hr
))
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_FRAME_SIZE
,
&
hr
);
return
hr
;
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_FRAME_RATE
,
&
hr
);
}
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_DEFAULT_STRIDE
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_VIDEO_ROTATION
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_FIXED_SIZE_SAMPLES
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_PIXEL_ASPECT_RATIO
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_ALL_SAMPLES_INDEPENDENT
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_MINIMUM_DISPLAY_APERTURE
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_VIDEO_CHROMA_SITING
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_INTERLACE_MODE
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_TRANSFER_FUNCTION
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_VIDEO_PRIMARIES
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_YUV_MATRIX
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_VIDEO_LIGHTING
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_VIDEO_NOMINAL_RANGE
,
&
hr
);
/* propagate common audio attributes */
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_NUM_CHANNELS
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_BLOCK_ALIGNMENT
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_BITS_PER_SAMPLE
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_SAMPLES_PER_SECOND
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_AVG_BYTES_PER_SECOND
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_CHANNEL_MASK
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_SAMPLES_PER_BLOCK
,
&
hr
);
media_type_try_copy_attr
(
media_type
,
upstream_type
,
&
MF_MT_AUDIO_VALID_BITS_PER_SAMPLE
,
&
hr
);
return
hr
;
return
hr
;
}
}
...
@@ -310,7 +334,7 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
...
@@ -310,7 +334,7 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
hr
=
topology_branch_connect_down
(
topology
,
MF_CONNECT_DIRECT
,
&
up_branch
,
up_type
);
hr
=
topology_branch_connect_down
(
topology
,
MF_CONNECT_DIRECT
,
&
up_branch
,
up_type
);
if
(
down_type
)
if
(
down_type
)
{
{
if
(
SUCCEEDED
(
topology_branch_fill_media_type
(
up_type
,
down
_type
))
if
(
SUCCEEDED
(
update_media_type_from_upstream
(
down_type
,
up
_type
))
&&
SUCCEEDED
(
IMFTransform_SetOutputType
(
transform
,
0
,
down_type
,
0
)))
&&
SUCCEEDED
(
IMFTransform_SetOutputType
(
transform
,
0
,
down_type
,
0
)))
method
=
MF_CONNECT_DIRECT
;
method
=
MF_CONNECT_DIRECT
;
}
}
...
@@ -319,7 +343,7 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
...
@@ -319,7 +343,7 @@ static HRESULT topology_branch_connect_indirect(IMFTopology *topology, MF_CONNEC
if
(
SUCCEEDED
(
hr
)
&&
method
!=
MF_CONNECT_DIRECT
if
(
SUCCEEDED
(
hr
)
&&
method
!=
MF_CONNECT_DIRECT
&&
SUCCEEDED
(
IMFTransform_GetOutputAvailableType
(
transform
,
0
,
0
,
&
media_type
)))
&&
SUCCEEDED
(
IMFTransform_GetOutputAvailableType
(
transform
,
0
,
0
,
&
media_type
)))
{
{
if
(
SUCCEEDED
(
topology_branch_fill_media_type
(
up_type
,
media
_type
)))
if
(
SUCCEEDED
(
update_media_type_from_upstream
(
media_type
,
up
_type
)))
IMFTransform_SetOutputType
(
transform
,
0
,
media_type
,
0
);
IMFTransform_SetOutputType
(
transform
,
0
,
media_type
,
0
);
IMFMediaType_Release
(
media_type
);
IMFMediaType_Release
(
media_type
);
}
}
...
...
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