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
449e5612
Commit
449e5612
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: Start media streams in a dedicated media_stream_start helper.
parent
b3535aa0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
28 deletions
+25
-28
media_source.c
dlls/winegstreamer/media_source.c
+25
-28
No files found.
dlls/winegstreamer/media_source.c
View file @
449e5612
...
...
@@ -343,6 +343,25 @@ static void flush_token_queue(struct media_stream *stream, BOOL send)
stream
->
token_queue_cap
=
0
;
}
static
HRESULT
media_stream_start
(
struct
media_stream
*
stream
,
BOOL
active
,
BOOL
seeking
,
const
PROPVARIANT
*
position
)
{
struct
media_source
*
source
=
impl_from_IMFMediaSource
(
stream
->
media_source
);
struct
wg_format
format
;
HRESULT
hr
;
TRACE
(
"source %p, stream %p
\n
"
,
source
,
stream
);
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
);
if
(
FAILED
(
hr
=
IMFMediaEventQueue_QueueEventParamUnk
(
source
->
event_queue
,
active
?
MEUpdatedStream
:
MENewStream
,
&
GUID_NULL
,
S_OK
,
(
IUnknown
*
)
&
stream
->
IMFMediaStream_iface
)))
WARN
(
"Failed to send source stream event, hr %#lx
\n
"
,
hr
);
return
IMFMediaEventQueue_QueueEventParamVar
(
stream
->
event_queue
,
seeking
?
MEStreamSeeked
:
MEStreamStarted
,
&
GUID_NULL
,
S_OK
,
position
);
}
static
void
start_pipeline
(
struct
media_source
*
source
,
struct
source_async_command
*
command
)
{
PROPVARIANT
*
position
=
&
command
->
u
.
start
.
position
;
...
...
@@ -360,46 +379,24 @@ static void start_pipeline(struct media_source *source, struct source_async_comm
for
(
i
=
0
;
i
<
source
->
stream_count
;
i
++
)
{
struct
media_stream
*
stream
;
BOOL
was_active
,
selected
;
IMFStreamDescriptor
*
sd
;
struct
wg_format
format
;
DWORD
stream_id
;
BOOL
was_active
;
BOOL
selected
;
stream
=
source
->
streams
[
i
];
was_active
=
stream
->
active
;
IMFStreamDescriptor_GetStreamIdentifier
(
stream
->
descriptor
,
&
stream_id
);
sd
=
stream_descriptor_from_id
(
command
->
u
.
start
.
descriptor
,
stream_id
,
&
selected
);
IMFStreamDescriptor_Release
(
sd
);
was_active
=
stream
->
active
;
stream
->
active
=
selected
;
if
(
selected
)
{
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
);
}
else
{
wg_parser_stream_disable
(
stream
->
wg_stream
);
}
if
(
position
->
vt
!=
VT_EMPTY
)
stream
->
eos
=
FALSE
;
if
(
selected
)
{
TRACE
(
"Stream %u (%p) selected
\n
"
,
i
,
stream
);
IMFMediaEventQueue_QueueEventParamUnk
(
source
->
event_queue
,
was_active
?
MEUpdatedStream
:
MENewStream
,
&
GUID_NULL
,
S_OK
,
(
IUnknown
*
)
&
stream
->
IMFMediaStream_iface
);
IMFMediaEventQueue_QueueEventParamVar
(
stream
->
event_queue
,
seek_message
?
MEStreamSeeked
:
MEStreamStarted
,
&
GUID_NULL
,
S_OK
,
position
);
}
if
(
!
(
stream
->
active
=
selected
))
wg_parser_stream_disable
(
stream
->
wg_stream
);
else
if
(
FAILED
(
hr
=
media_stream_start
(
stream
,
was_active
,
seek_message
,
position
)))
WARN
(
"Failed to start media stream, hr %#lx
\n
"
,
hr
);
}
IMFMediaEventQueue_QueueEventParamVar
(
source
->
event_queue
,
...
...
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