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
87daa41e
Commit
87daa41e
authored
Feb 03, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Avoid accessing the DirectShow peer from GStreamer callbacks.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cb7fb161
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
gstdemux.c
dlls/winegstreamer/gstdemux.c
+21
-8
No files found.
dlls/winegstreamer/gstdemux.c
View file @
87daa41e
...
...
@@ -106,7 +106,7 @@ struct wg_parser_stream
pthread_cond_t
event_cond
,
event_empty_cond
;
struct
wg_parser_event
event
;
bool
flushing
,
eos
;
bool
flushing
,
eos
,
enabled
;
};
struct
parser
...
...
@@ -546,6 +546,7 @@ static GstCaps *amt_to_gst_caps(const AM_MEDIA_TYPE *mt)
static
gboolean
query_sink
(
GstPad
*
pad
,
GstObject
*
parent
,
GstQuery
*
query
)
{
struct
parser_source
*
pin
=
gst_pad_get_element_private
(
pad
);
struct
wg_parser_stream
*
stream
=
pin
->
wg_stream
;
TRACE
(
"pin %p, type
\"
%s
\"
.
\n
"
,
pin
,
gst_query_type_get_name
(
query
->
type
));
...
...
@@ -557,7 +558,7 @@ static gboolean query_sink(GstPad *pad, GstObject *parent, GstQuery *query)
gst_query_parse_caps
(
query
,
&
filter
);
if
(
pin
->
pin
.
pin
.
peer
)
if
(
stream
->
enabled
)
caps
=
amt_to_gst_caps
(
&
pin
->
pin
.
pin
.
mt
);
else
caps
=
gst_caps_new_any
();
...
...
@@ -581,7 +582,7 @@ static gboolean query_sink(GstPad *pad, GstObject *parent, GstQuery *query)
AM_MEDIA_TYPE
mt
;
GstCaps
*
caps
;
if
(
!
pin
->
pin
.
pin
.
peer
)
if
(
!
stream
->
enabled
)
{
gst_query_set_accept_caps_result
(
query
,
TRUE
);
return
TRUE
;
...
...
@@ -751,7 +752,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event)
switch
(
event
->
type
)
{
case
GST_EVENT_SEGMENT
:
if
(
pin
->
pin
.
pin
.
peer
)
if
(
stream
->
enabled
)
{
struct
wg_parser_event
stream_event
;
const
GstSegment
*
segment
;
...
...
@@ -775,7 +776,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event)
break
;
case
GST_EVENT_EOS
:
if
(
pin
->
pin
.
pin
.
peer
)
if
(
stream
->
enabled
)
{
struct
wg_parser_event
stream_event
;
...
...
@@ -792,7 +793,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event)
break
;
case
GST_EVENT_FLUSH_START
:
if
(
pin
->
pin
.
pin
.
peer
)
if
(
stream
->
enabled
)
{
pthread_mutex_lock
(
&
parser
->
mutex
);
...
...
@@ -818,7 +819,7 @@ static gboolean event_sink(GstPad *pad, GstObject *parent, GstEvent *event)
case
GST_EVENT_FLUSH_STOP
:
gst_segment_init
(
stream
->
segment
,
GST_FORMAT_TIME
);
if
(
pin
->
pin
.
pin
.
peer
)
if
(
stream
->
enabled
)
{
pthread_mutex_lock
(
&
parser
->
mutex
);
stream
->
flushing
=
false
;
...
...
@@ -900,12 +901,13 @@ static void *push_data(void *iface)
static
GstFlowReturn
got_data_sink
(
GstPad
*
pad
,
GstObject
*
parent
,
GstBuffer
*
buffer
)
{
struct
parser_source
*
pin
=
gst_pad_get_element_private
(
pad
);
struct
wg_parser_stream
*
stream
=
pin
->
wg_stream
;
struct
wg_parser_event
stream_event
;
GstFlowReturn
ret
;
GST_LOG
(
"pin %p, buffer %p."
,
pin
,
buffer
);
if
(
!
pin
->
pin
.
pin
.
peer
)
if
(
!
stream
->
enabled
)
{
gst_buffer_unref
(
buffer
);
return
GST_FLOW_OK
;
...
...
@@ -2434,6 +2436,8 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
buffer_size
=
format
->
nAvgBytesPerSec
;
}
stream
->
enabled
=
true
;
gst_pad_push_event
(
stream
->
my_sink
,
gst_event_new_reconfigure
());
/* We do need to drop any buffers that might have been sent with the old
* caps, but this will be handled in parser_init_stream(). */
...
...
@@ -2444,6 +2448,14 @@ static HRESULT WINAPI GSTOutPin_DecideBufferSize(struct strmbase_source *iface,
return
IMemAllocator_SetProperties
(
allocator
,
props
,
&
ret_props
);
}
static
void
source_disconnect
(
struct
strmbase_source
*
iface
)
{
struct
parser_source
*
pin
=
impl_source_from_IPin
(
&
iface
->
pin
.
IPin_iface
);
struct
wg_parser_stream
*
stream
=
pin
->
wg_stream
;
stream
->
enabled
=
false
;
}
static
void
free_source_pin
(
struct
parser_source
*
pin
)
{
struct
wg_parser_stream
*
stream
=
pin
->
wg_stream
;
...
...
@@ -2493,6 +2505,7 @@ static const struct strmbase_source_ops source_ops =
.
pfnAttemptConnection
=
BaseOutputPinImpl_AttemptConnection
,
.
pfnDecideAllocator
=
BaseOutputPinImpl_DecideAllocator
,
.
pfnDecideBufferSize
=
GSTOutPin_DecideBufferSize
,
.
source_disconnect
=
source_disconnect
,
};
static
struct
parser_source
*
create_pin
(
struct
parser
*
filter
,
const
WCHAR
*
name
)
...
...
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