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
b0ecfc96
Commit
b0ecfc96
authored
Jun 01, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Factor the creation of the first stream media type.
parent
82b1cc3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
26 deletions
+5
-26
media_source.c
dlls/winegstreamer/media_source.c
+5
-26
No files found.
dlls/winegstreamer/media_source.c
View file @
b0ecfc96
...
...
@@ -925,6 +925,10 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
wg_parser_stream_get_preferred_format
(
stream
->
wg_stream
,
&
format
);
if
(
!
(
stream_types
[
0
]
=
mf_media_type_from_wg_format
(
&
format
)))
return
MF_E_INVALIDMEDIATYPE
;
type_count
=
1
;
if
(
format
.
major_type
==
WG_MAJOR_TYPE_VIDEO
)
{
/* Try to prefer YUV formats over RGB ones. Most decoders output in the
...
...
@@ -937,20 +941,9 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
WG_VIDEO_FORMAT_YUY2
,
WG_VIDEO_FORMAT_I420
,
};
IMFMediaType
*
base_type
=
mf_media_type_from_wg_format
(
&
format
);
GUID
base_subtype
;
if
(
!
base_type
)
{
hr
=
MF_E_INVALIDMEDIATYPE
;
goto
done
;
}
IMFMediaType_GetGUID
(
base_type
,
&
MF_MT_SUBTYPE
,
&
base_subtype
);
stream_types
[
0
]
=
base_type
;
type_count
=
1
;
IMFMediaType_GetGUID
(
stream_types
[
0
],
&
MF_MT_SUBTYPE
,
&
base_subtype
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
video_formats
);
++
i
)
{
...
...
@@ -990,9 +983,6 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
WG_AUDIO_FORMAT_F32LE
,
};
if
((
stream_types
[
0
]
=
mf_media_type_from_wg_format
(
&
format
)))
type_count
=
1
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
audio_types
);
i
++
)
{
struct
wg_format
new_format
;
...
...
@@ -1004,20 +994,9 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
type_count
++
;
}
}
else
{
if
((
stream_types
[
0
]
=
mf_media_type_from_wg_format
(
&
format
)))
type_count
=
1
;
}
assert
(
type_count
<=
ARRAY_SIZE
(
stream_types
));
if
(
!
type_count
)
{
ERR
(
"Failed to establish an IMFMediaType from any of the possible stream caps!
\n
"
);
return
E_FAIL
;
}
if
(
FAILED
(
hr
=
MFCreateStreamDescriptor
(
stream
->
stream_id
,
type_count
,
stream_types
,
&
stream
->
descriptor
)))
goto
done
;
...
...
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