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
b3535aa0
Commit
b3535aa0
authored
Apr 29, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
May 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use helpers to convert stream descriptor type to wg_format.
parent
6f477988
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
media_source.c
dlls/winegstreamer/media_source.c
+30
-11
No files found.
dlls/winegstreamer/media_source.c
View file @
b3535aa0
...
...
@@ -241,6 +241,32 @@ static ULONG WINAPI source_async_commands_callback_Release(IMFAsyncCallback *ifa
return
IMFMediaSource_Release
(
&
source
->
IMFMediaSource_iface
);
}
static
HRESULT
stream_descriptor_get_media_type
(
IMFStreamDescriptor
*
descriptor
,
IMFMediaType
**
media_type
)
{
IMFMediaTypeHandler
*
handler
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
IMFStreamDescriptor_GetMediaTypeHandler
(
descriptor
,
&
handler
)))
return
hr
;
hr
=
IMFMediaTypeHandler_GetCurrentMediaType
(
handler
,
media_type
);
IMFMediaTypeHandler_Release
(
handler
);
return
hr
;
}
static
HRESULT
wg_format_from_stream_descriptor
(
IMFStreamDescriptor
*
descriptor
,
struct
wg_format
*
format
)
{
IMFMediaType
*
media_type
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
stream_descriptor_get_media_type
(
descriptor
,
&
media_type
)))
return
hr
;
mf_media_type_to_wg_format
(
media_type
,
format
);
IMFMediaType_Release
(
media_type
);
return
hr
;
}
static
IMFStreamDescriptor
*
stream_descriptor_from_id
(
IMFPresentationDescriptor
*
pres_desc
,
DWORD
id
,
BOOL
*
selected
)
{
ULONG
sd_count
;
...
...
@@ -322,6 +348,7 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
PROPVARIANT
*
position
=
&
command
->
u
.
start
.
position
;
BOOL
seek_message
=
source
->
state
!=
SOURCE_STOPPED
&&
position
->
vt
!=
VT_EMPTY
;
unsigned
int
i
;
HRESULT
hr
;
/* seek to beginning on stop->play */
if
(
source
->
state
==
SOURCE_STOPPED
&&
position
->
vt
==
VT_EMPTY
)
...
...
@@ -334,8 +361,7 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
{
struct
media_stream
*
stream
;
IMFStreamDescriptor
*
sd
;
IMFMediaTypeHandler
*
mth
;
IMFMediaType
*
current_mt
;
struct
wg_format
format
;
DWORD
stream_id
;
BOOL
was_active
;
BOOL
selected
;
...
...
@@ -352,16 +378,9 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
if
(
selected
)
{
struct
wg_format
format
;
IMFStreamDescriptor_GetMediaTypeHandler
(
stream
->
descriptor
,
&
mth
);
IMFMediaTypeHandler_GetCurrentMediaType
(
mth
,
&
current_mt
);
mf_media_type_to_wg_format
(
current_mt
,
&
format
);
if
(
FAILED
(
hr
=
wg_format_from_stream_descriptor
(
stream
->
descriptor
,
&
format
)))
WARN
(
"Failed to get wg_format from stream descriptor, hr %#lx
\n
"
,
hr
);
wg_parser_stream_enable
(
stream
->
wg_stream
,
&
format
);
IMFMediaType_Release
(
current_mt
);
IMFMediaTypeHandler_Release
(
mth
);
}
else
{
...
...
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