mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
gst/playback/: Fix the case where we try to ref a NULL element when we delay a link because of unfixed caps.
Original commit message from CVS: * gst/playback/gstdecodebin.c: (dynamic_add), (close_pad_link), (is_demuxer_element), (new_caps): * gst/playback/gstplaybasebin.c: (source_new_pad): Fix the case where we try to ref a NULL element when we delay a link because of unfixed caps. Set the state of autoplugged decodebins to PAUSED. RTSP now works in playbin, we can remove it from the blacklist.
This commit is contained in:
parent
686ad73bfe
commit
3f147830e1
3 changed files with 25 additions and 17 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2007-01-10 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/playback/gstdecodebin.c: (dynamic_add), (close_pad_link),
|
||||||
|
(is_demuxer_element), (new_caps):
|
||||||
|
* gst/playback/gstplaybasebin.c: (source_new_pad):
|
||||||
|
Fix the case where we try to ref a NULL element when we delay a link
|
||||||
|
because of unfixed caps.
|
||||||
|
Set the state of autoplugged decodebins to PAUSED.
|
||||||
|
RTSP now works in playbin, we can remove it from the blacklist.
|
||||||
|
|
||||||
2007-01-09 Tim-Philipp Müller <tim at centricular dot net>
|
2007-01-09 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/playback/Makefile.am:
|
* gst/playback/Makefile.am:
|
||||||
|
|
|
@ -409,7 +409,7 @@ dynamic_add (GstElement * element, GstPad * pad, GstDecodeBin * decode_bin)
|
||||||
struct DynFind find_info;
|
struct DynFind find_info;
|
||||||
GList *found;
|
GList *found;
|
||||||
|
|
||||||
g_return_if_fail (element != NULL || pad != NULL);
|
g_return_if_fail (element != NULL);
|
||||||
|
|
||||||
/* do a search that this entry doesn't already exist */
|
/* do a search that this entry doesn't already exist */
|
||||||
find_info.elem = element;
|
find_info.elem = element;
|
||||||
|
@ -421,25 +421,21 @@ dynamic_add (GstElement * element, GstPad * pad, GstDecodeBin * decode_bin)
|
||||||
|
|
||||||
/* take refs */
|
/* take refs */
|
||||||
dyn = g_new0 (GstDynamic, 1);
|
dyn = g_new0 (GstDynamic, 1);
|
||||||
dyn->element = element;
|
dyn->element = gst_object_ref (element);
|
||||||
dyn->pad = pad;
|
|
||||||
dyn->decode_bin = gst_object_ref (decode_bin);
|
dyn->decode_bin = gst_object_ref (decode_bin);
|
||||||
if (element) {
|
if (pad) {
|
||||||
|
dyn->pad = gst_object_ref (pad);
|
||||||
|
GST_DEBUG_OBJECT (decode_bin, "dynamic create for pad %" GST_PTR_FORMAT,
|
||||||
|
pad);
|
||||||
|
dyn->caps_sig_id = g_signal_connect (G_OBJECT (pad), "notify::caps",
|
||||||
|
G_CALLBACK (new_caps), dyn);
|
||||||
|
} else {
|
||||||
GST_DEBUG_OBJECT (decode_bin, "dynamic create for element %"
|
GST_DEBUG_OBJECT (decode_bin, "dynamic create for element %"
|
||||||
GST_PTR_FORMAT, element);
|
GST_PTR_FORMAT, element);
|
||||||
|
|
||||||
gst_object_ref (element);
|
|
||||||
dyn->np_sig_id = g_signal_connect (G_OBJECT (element), "pad-added",
|
dyn->np_sig_id = g_signal_connect (G_OBJECT (element), "pad-added",
|
||||||
G_CALLBACK (new_pad), dyn);
|
G_CALLBACK (new_pad), dyn);
|
||||||
dyn->nmp_sig_id = g_signal_connect (G_OBJECT (element), "no-more-pads",
|
dyn->nmp_sig_id = g_signal_connect (G_OBJECT (element), "no-more-pads",
|
||||||
G_CALLBACK (no_more_pads), dyn);
|
G_CALLBACK (no_more_pads), dyn);
|
||||||
} else {
|
|
||||||
GST_DEBUG_OBJECT (decode_bin, "dynamic create for pad %" GST_PTR_FORMAT,
|
|
||||||
pad);
|
|
||||||
|
|
||||||
gst_object_ref (pad);
|
|
||||||
dyn->caps_sig_id = g_signal_connect (G_OBJECT (pad), "notify::caps",
|
|
||||||
G_CALLBACK (new_caps), dyn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* and add this element to the dynamic elements */
|
/* and add this element to the dynamic elements */
|
||||||
|
@ -794,7 +790,7 @@ many_types:
|
||||||
setup_caps_delay:
|
setup_caps_delay:
|
||||||
{
|
{
|
||||||
GST_LOG_OBJECT (pad, "setting up a delayed link");
|
GST_LOG_OBJECT (pad, "setting up a delayed link");
|
||||||
dynamic_add (NULL, pad, decode_bin);
|
dynamic_add (element, pad, decode_bin);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -814,7 +810,7 @@ is_demuxer_element (GstElement * srcelement)
|
||||||
klass = gst_element_factory_get_klass (srcfactory);
|
klass = gst_element_factory_get_klass (srcfactory);
|
||||||
|
|
||||||
/* Can't be a demuxer unless it has Demux in the klass name */
|
/* Can't be a demuxer unless it has Demux in the klass name */
|
||||||
if (!strstr (klass, "Demux"))
|
if (klass == NULL || !strstr (klass, "Demux"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Walk the src pad templates and count how many the element
|
/* Walk the src pad templates and count how many the element
|
||||||
|
@ -1311,7 +1307,7 @@ no_more_pads (GstElement * element, GstDynamic * dynamic)
|
||||||
static void
|
static void
|
||||||
new_caps (GstPad * pad, GParamSpec * unused, GstDynamic * dynamic)
|
new_caps (GstPad * pad, GParamSpec * unused, GstDynamic * dynamic)
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (dynamic->decode_bin, "delayed link triggered\n");
|
GST_DEBUG_OBJECT (dynamic->decode_bin, "delayed link triggered");
|
||||||
|
|
||||||
new_pad (dynamic->element, pad, dynamic);
|
new_pad (dynamic->element, pad, dynamic);
|
||||||
|
|
||||||
|
|
|
@ -1451,7 +1451,7 @@ static const gchar *stream_uris[] = { "http://", "mms://", "mmsh://",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* blacklisted URIs, we know they will always fail. */
|
/* blacklisted URIs, we know they will always fail. */
|
||||||
static const gchar *blacklisted_uris[] = { "rtsp://", NULL };
|
static const gchar *blacklisted_uris[] = { NULL };
|
||||||
|
|
||||||
/* mime types that we don't consider to be media types */
|
/* mime types that we don't consider to be media types */
|
||||||
static const gchar *no_media_mimes[] = {
|
static const gchar *no_media_mimes[] = {
|
||||||
|
@ -1580,6 +1580,8 @@ source_new_pad (GstElement * element, GstPad * pad, GstPlayBaseBin * bin)
|
||||||
if (!gst_element_link (bin->source, decoder))
|
if (!gst_element_link (bin->source, decoder))
|
||||||
goto could_not_link;
|
goto could_not_link;
|
||||||
|
|
||||||
|
gst_element_set_state (decoder, GST_STATE_PAUSED);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
Loading…
Reference in a new issue