Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Yeongjin Jeong
gst-plugins-bad
Commits
6996453c
Commit
6996453c
authored
Aug 16, 2018
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videoaggregator: Make sure to hold object lock while iterating sink pads
They might otherwise just change while we iterate.
parent
8c49fbca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
gst-libs/gst/video/gstvideoaggregator.c
gst-libs/gst/video/gstvideoaggregator.c
+21
-10
No files found.
gst-libs/gst/video/gstvideoaggregator.c
View file @
6996453c
...
...
@@ -716,6 +716,23 @@ gst_video_aggregator_default_update_src_caps (GstAggregator * agg,
return
GST_FLOW_OK
;
}
static
gboolean
_pad_set_info
(
GstElement
*
element
,
GstPad
*
pad
,
gpointer
user_data
)
{
GstVideoAggregator
*
vagg
=
GST_VIDEO_AGGREGATOR
(
element
);
GstVideoAggregatorPad
*
vaggpad
=
GST_VIDEO_AGGREGATOR_PAD
(
pad
);
GstVideoAggregatorPadClass
*
vaggpad_klass
=
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS
(
vaggpad
);
if
(
vaggpad_klass
->
set_info
&&
!
vaggpad_klass
->
set_info
(
vaggpad
,
vagg
,
&
vaggpad
->
info
,
&
vagg
->
info
))
{
return
FALSE
;
}
return
TRUE
;
}
static
gboolean
gst_video_aggregator_default_negotiated_src_caps
(
GstAggregator
*
agg
,
GstCaps
*
caps
)
...
...
@@ -768,16 +785,7 @@ gst_video_aggregator_default_negotiated_src_caps (GstAggregator * agg,
}
/* Then browse the sinks once more, setting or unsetting conversion if needed */
for
(
l
=
GST_ELEMENT
(
vagg
)
->
sinkpads
;
l
;
l
=
l
->
next
)
{
GstVideoAggregatorPad
*
pad
=
GST_VIDEO_AGGREGATOR_PAD
(
l
->
data
);
GstVideoAggregatorPadClass
*
vaggpad_klass
=
GST_VIDEO_AGGREGATOR_PAD_GET_CLASS
(
pad
);
if
(
vaggpad_klass
->
set_info
&&
!
vaggpad_klass
->
set_info
(
pad
,
vagg
,
&
pad
->
info
,
&
vagg
->
info
))
{
return
FALSE
;
}
}
gst_element_foreach_sink_pad
(
GST_ELEMENT_CAST
(
vagg
),
_pad_set_info
,
NULL
);
if
(
vagg
->
priv
->
current_caps
==
NULL
||
gst_caps_is_equal
(
caps
,
vagg
->
priv
->
current_caps
)
==
FALSE
)
{
...
...
@@ -800,6 +808,7 @@ gst_video_aggregator_get_sinkpads_interlace_mode (GstVideoAggregator * vagg,
{
GList
*
walk
;
GST_OBJECT_LOCK
(
vagg
);
for
(
walk
=
GST_ELEMENT
(
vagg
)
->
sinkpads
;
walk
;
walk
=
g_list_next
(
walk
))
{
GstVideoAggregatorPad
*
vaggpad
=
walk
->
data
;
...
...
@@ -808,9 +817,11 @@ gst_video_aggregator_get_sinkpads_interlace_mode (GstVideoAggregator * vagg,
if
(
vaggpad
->
info
.
finfo
&&
GST_VIDEO_INFO_FORMAT
(
&
vaggpad
->
info
)
!=
GST_VIDEO_FORMAT_UNKNOWN
)
{
*
mode
=
GST_VIDEO_INFO_INTERLACE_MODE
(
&
vaggpad
->
info
);
GST_OBJECT_UNLOCK
(
vagg
);
return
TRUE
;
}
}
GST_OBJECT_UNLOCK
(
vagg
);
return
FALSE
;
}
...
...
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