mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
gst/playback/gstplaybin2.c: Implement the source property, emit notify when it changes in the underlying uridecodebin.
Original commit message from CVS: * gst/playback/gstplaybin2.c: (gst_play_bin_get_property), (notify_source), (activate_group): Implement the source property, emit notify when it changes in the underlying uridecodebin.
This commit is contained in:
parent
24770f8f62
commit
cf7da52701
2 changed files with 37 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst/playback/gstplaybin2.c: (gst_play_bin_get_property),
|
||||||
|
(notify_source), (activate_group):
|
||||||
|
Implement the source property, emit notify when it changes in the
|
||||||
|
underlying uridecodebin.
|
||||||
|
|
||||||
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-06-20 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* tests/examples/seek/seek.c: (stop_cb):
|
* tests/examples/seek/seek.c: (stop_cb):
|
||||||
|
|
|
@ -362,6 +362,9 @@ struct _GstPlayBin
|
||||||
/* our play sink */
|
/* our play sink */
|
||||||
GstPlaySink *playsink;
|
GstPlaySink *playsink;
|
||||||
|
|
||||||
|
/* the last activated source */
|
||||||
|
GstElement *source;
|
||||||
|
|
||||||
GValueArray *elements; /* factories we can use for selecting elements */
|
GValueArray *elements; /* factories we can use for selecting elements */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1299,7 +1302,12 @@ gst_play_bin_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PROP_SOURCE:
|
case PROP_SOURCE:
|
||||||
|
{
|
||||||
|
GST_OBJECT_LOCK (playbin);
|
||||||
|
g_value_set_object (value, playbin->source);
|
||||||
|
GST_OBJECT_UNLOCK (playbin);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case PROP_FLAGS:
|
case PROP_FLAGS:
|
||||||
g_value_set_flags (value, gst_play_sink_get_flags (playbin->playsink));
|
g_value_set_flags (value, gst_play_sink_get_flags (playbin->playsink));
|
||||||
break;
|
break;
|
||||||
|
@ -1815,12 +1823,31 @@ autoplug_select_cb (GstElement * decodebin, GstPad * pad,
|
||||||
return GST_AUTOPLUG_SELECT_EXPOSE;
|
return GST_AUTOPLUG_SELECT_EXPOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
notify_source (GstElement * uridecodebin, GParamSpec * pspec,
|
||||||
|
GstSourceGroup * group)
|
||||||
|
{
|
||||||
|
GstPlayBin *playbin;
|
||||||
|
GstElement *source;
|
||||||
|
|
||||||
|
playbin = group->playbin;
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (playbin);
|
||||||
|
g_object_get (group->uridecodebin, "source", &source, NULL);
|
||||||
|
if (playbin->source)
|
||||||
|
gst_object_unref (playbin->source);
|
||||||
|
playbin->source = source;
|
||||||
|
GST_OBJECT_UNLOCK (playbin);
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (playbin), "source");
|
||||||
|
}
|
||||||
|
|
||||||
/* must be called with PLAY_BIN_LOCK */
|
/* must be called with PLAY_BIN_LOCK */
|
||||||
static gboolean
|
static gboolean
|
||||||
activate_group (GstPlayBin * playbin, GstSourceGroup * group)
|
activate_group (GstPlayBin * playbin, GstSourceGroup * group)
|
||||||
{
|
{
|
||||||
GstElement *uridecodebin;
|
GstElement *uridecodebin;
|
||||||
GstElement *suburidecodebin;
|
GstElement *suburidecodebin = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (group->valid, FALSE);
|
g_return_val_if_fail (group->valid, FALSE);
|
||||||
g_return_val_if_fail (!group->active, FALSE);
|
g_return_val_if_fail (!group->active, FALSE);
|
||||||
|
@ -1851,6 +1878,8 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group)
|
||||||
group);
|
group);
|
||||||
g_signal_connect (uridecodebin, "no-more-pads", G_CALLBACK (no_more_pads_cb),
|
g_signal_connect (uridecodebin, "no-more-pads", G_CALLBACK (no_more_pads_cb),
|
||||||
group);
|
group);
|
||||||
|
g_signal_connect (uridecodebin, "notify::source", G_CALLBACK (notify_source),
|
||||||
|
group);
|
||||||
/* we have 1 pending no-more-pads */
|
/* we have 1 pending no-more-pads */
|
||||||
group->pending = 1;
|
group->pending = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue