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
98d20975
Commit
98d20975
authored
Jan 24, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Initialize media source video types from a wg_video_format array.
The mf_media_type_from_wg_format function will use the video format to calculate stride.
parent
93c5adbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
media_source.c
dlls/winegstreamer/media_source.c
+27
-16
No files found.
dlls/winegstreamer/media_source.c
View file @
98d20975
...
@@ -866,15 +866,15 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
...
@@ -866,15 +866,15 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
if
(
format
.
major_type
==
WG_MAJOR_TYPE_VIDEO
)
if
(
format
.
major_type
==
WG_MAJOR_TYPE_VIDEO
)
{
{
/* These are the most common native output types of decoders:
/* Try to prefer YUV formats over RGB ones. Most decoders output in the
https://docs.microsoft.com/en-us/windows/win32/medfound/mft-decoder-expose-output-types-in-native-order */
* YUV color space, and it's generally much less expensive for
static
const
GUID
*
const
video_types
[]
=
* videoconvert to do YUV -> YUV transformations. */
static
const
enum
wg_video_format
video_formats
[]
=
{
{
&
MFVideoFormat_NV12
,
WG_VIDEO_FORMAT_NV12
,
&
MFVideoFormat_YV12
,
WG_VIDEO_FORMAT_YV12
,
&
MFVideoFormat_YUY2
,
WG_VIDEO_FORMAT_YUY2
,
&
MFVideoFormat_IYUV
,
WG_VIDEO_FORMAT_I420
,
&
MFVideoFormat_I420
,
};
};
IMFMediaType
*
base_type
=
mf_media_type_from_wg_format
(
&
format
);
IMFMediaType
*
base_type
=
mf_media_type_from_wg_format
(
&
format
);
...
@@ -891,21 +891,32 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
...
@@ -891,21 +891,32 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
stream_types
[
0
]
=
base_type
;
stream_types
[
0
]
=
base_type
;
type_count
=
1
;
type_count
=
1
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
video_
types
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
video_
formats
);
++
i
)
{
{
struct
wg_format
new_format
=
format
;
IMFMediaType
*
new_type
;
IMFMediaType
*
new_type
;
if
(
IsEqualGUID
(
&
base_subtype
,
video_types
[
i
]))
new_format
.
u
.
video
.
format
=
video_formats
[
i
];
continue
;
if
(
FAILED
(
hr
=
MFCreateMediaType
(
&
new_type
)))
if
(
!
(
new_type
=
mf_media_type_from_wg_format
(
&
new_format
)))
{
hr
=
E_OUTOFMEMORY
;
goto
done
;
goto
done
;
}
stream_types
[
type_count
++
]
=
new_type
;
stream_types
[
type_count
++
]
=
new_type
;
if
(
FAILED
(
hr
=
IMFMediaType_CopyAllItems
(
base_type
,
(
IMFAttributes
*
)
new_type
)))
if
(
video_formats
[
i
]
==
WG_VIDEO_FORMAT_I420
)
goto
done
;
{
if
(
FAILED
(
hr
=
IMFMediaType_SetGUID
(
new_type
,
&
MF_MT_SUBTYPE
,
video_types
[
i
])))
IMFMediaType
*
iyuv_type
;
goto
done
;
if
(
FAILED
(
hr
=
MFCreateMediaType
(
&
iyuv_type
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_CopyAllItems
(
iyuv_type
,
(
IMFAttributes
*
)
iyuv_type
)))
goto
done
;
if
(
FAILED
(
hr
=
IMFMediaType_SetGUID
(
iyuv_type
,
&
MF_MT_SUBTYPE
,
&
MFVideoFormat_IYUV
)))
goto
done
;
stream_types
[
type_count
++
]
=
iyuv_type
;
}
}
}
}
}
else
if
(
format
.
major_type
==
WG_MAJOR_TYPE_AUDIO
)
else
if
(
format
.
major_type
==
WG_MAJOR_TYPE_AUDIO
)
...
...
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