mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
autodetect: Set GST_ELEMENT_IS_SOURCE flag on sources
This commit is contained in:
parent
5c1f6c890b
commit
bcb4f50323
2 changed files with 18 additions and 13 deletions
|
@ -117,24 +117,27 @@ gst_auto_audio_src_class_init (GstAutoAudioSrcClass * klass)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_auto_audio_src_dispose (GstAutoAudioSrc * sink)
|
||||
gst_auto_audio_src_dispose (GstAutoAudioSrc * src)
|
||||
{
|
||||
gst_auto_audio_src_clear_kid (sink);
|
||||
gst_auto_audio_src_clear_kid (src);
|
||||
|
||||
if (sink->filter_caps)
|
||||
gst_caps_unref (sink->filter_caps);
|
||||
sink->filter_caps = NULL;
|
||||
if (src->filter_caps)
|
||||
gst_caps_unref (src->filter_caps);
|
||||
src->filter_caps = NULL;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->dispose ((GObject *) sink);
|
||||
G_OBJECT_CLASS (parent_class)->dispose ((GObject *) src);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_auto_audio_src_clear_kid (GstAutoAudioSrc * sink)
|
||||
gst_auto_audio_src_clear_kid (GstAutoAudioSrc * src)
|
||||
{
|
||||
if (sink->kid) {
|
||||
gst_element_set_state (sink->kid, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (sink), sink->kid);
|
||||
sink->kid = NULL;
|
||||
if (src->kid) {
|
||||
gst_element_set_state (src->kid, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (src), src->kid);
|
||||
src->kid = NULL;
|
||||
|
||||
/* Don't lose SOURCE flag */
|
||||
GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +177,7 @@ gst_auto_audio_src_init (GstAutoAudioSrc * src, GstAutoAudioSrcClass * g_class)
|
|||
src->filter_caps = gst_static_caps_get (&raw_caps);
|
||||
|
||||
/* mark as source */
|
||||
GST_OBJECT_FLAG_UNSET (src, GST_ELEMENT_IS_SINK);
|
||||
GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -133,6 +133,8 @@ gst_auto_video_src_clear_kid (GstAutoVideoSrc * src)
|
|||
gst_element_set_state (src->kid, GST_STATE_NULL);
|
||||
gst_bin_remove (GST_BIN (src), src->kid);
|
||||
src->kid = NULL;
|
||||
/* Don't loose SOURCE flag */
|
||||
GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,7 +176,7 @@ gst_auto_video_src_init (GstAutoVideoSrc * src, GstAutoVideoSrcClass * g_class)
|
|||
src->filter_caps = gst_static_caps_get (&raw_caps);
|
||||
|
||||
/* mark as source */
|
||||
GST_OBJECT_FLAG_UNSET (src, GST_ELEMENT_IS_SINK);
|
||||
GST_OBJECT_FLAG_SET (src, GST_ELEMENT_IS_SOURCE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue