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
43ea59fd
Commit
43ea59fd
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: Introduce new init_audio_media_types helper.
parent
3a603357
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
media_source.c
dlls/winegstreamer/media_source.c
+27
-18
No files found.
dlls/winegstreamer/media_source.c
View file @
43ea59fd
...
...
@@ -371,6 +371,31 @@ done:
return
hr
;
}
static
HRESULT
init_audio_media_types
(
struct
wg_format
*
format
,
IMFMediaType
*
types
[
6
],
DWORD
*
types_count
)
{
/* Expose at least one PCM and one floating point type for the
consumer to pick from. */
static
const
enum
wg_audio_format
audio_types
[]
=
{
WG_AUDIO_FORMAT_S16LE
,
WG_AUDIO_FORMAT_F32LE
,
};
UINT
count
=
*
types_count
,
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
audio_types
);
i
++
)
{
struct
wg_format
new_format
=
*
format
;
if
(
new_format
.
u
.
audio
.
format
==
audio_types
[
i
])
continue
;
new_format
.
u
.
audio
.
format
=
audio_types
[
i
];
if
((
types
[
count
]
=
mf_media_type_from_wg_format
(
&
new_format
)))
count
++
;
}
*
types_count
=
count
;
return
S_OK
;
}
static
BOOL
enqueue_token
(
struct
media_stream
*
stream
,
IUnknown
*
token
)
{
if
(
stream
->
token_queue_count
==
stream
->
token_queue_cap
)
...
...
@@ -988,24 +1013,8 @@ static HRESULT media_stream_init_desc(struct media_stream *stream)
}
else
if
(
format
.
major_type
==
WG_MAJOR_TYPE_AUDIO
)
{
/* Expose at least one PCM and one floating point type for the
consumer to pick from. */
static
const
enum
wg_audio_format
audio_types
[]
=
{
WG_AUDIO_FORMAT_S16LE
,
WG_AUDIO_FORMAT_F32LE
,
};
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
audio_types
);
i
++
)
{
struct
wg_format
new_format
;
if
(
format
.
u
.
audio
.
format
==
audio_types
[
i
])
continue
;
new_format
=
format
;
new_format
.
u
.
audio
.
format
=
audio_types
[
i
];
if
((
stream_types
[
type_count
]
=
mf_media_type_from_wg_format
(
&
new_format
)))
type_count
++
;
}
if
(
FAILED
(
hr
=
init_audio_media_types
(
&
format
,
stream_types
,
&
type_count
)))
goto
done
;
}
assert
(
type_count
<=
ARRAY_SIZE
(
stream_types
));
...
...
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