{
PROP_0,
PROP_URI,
+ PROP_CURRENT_URI,
PROP_SUBURI,
+ PROP_CURRENT_SUBURI,
PROP_SOURCE,
PROP_FLAGS,
PROP_N_VIDEO,
g_param_spec_string ("uri", "URI", "URI of the media to play",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstPlayBin:current-uri
+ *
+ * The currently playing uri.
+ */
+ g_object_class_install_property (gobject_klass, PROP_CURRENT_URI,
+ g_param_spec_string ("current-uri", "Current URI",
+ "The currently playing URI", NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
/**
* GstPlayBin:suburi
*
g_param_spec_string ("suburi", ".sub-URI", "Optional URI of a subtitle",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ /**
+ * GstPlayBin:current-suburi
+ *
+ * The currently playing subtitle uri.
+ */
+ g_object_class_install_property (gobject_klass, PROP_CURRENT_SUBURI,
+ g_param_spec_string ("current-suburi", "Current .sub-URI",
+ "The currently playing URI of a subtitle",
+ NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
g_object_class_install_property (gobject_klass, PROP_SOURCE,
g_param_spec_object ("source", "Source", "Source element",
GST_TYPE_ELEMENT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
GstSourceGroup *group;
GST_PLAY_BIN_LOCK (playbin);
+ group = playbin->next_group;
+ g_value_set_string (value, group->uri);
+ GST_PLAY_BIN_UNLOCK (playbin);
+ break;
+ break;
+ }
+ case PROP_CURRENT_URI:
+ {
+ GstSourceGroup *group;
+
+ GST_PLAY_BIN_LOCK (playbin);
group = get_group (playbin);
g_value_set_string (value, group->uri);
GST_PLAY_BIN_UNLOCK (playbin);
GstSourceGroup *group;
GST_PLAY_BIN_LOCK (playbin);
+ group = playbin->next_group;
+ g_value_set_string (value, group->suburi);
+ GST_PLAY_BIN_UNLOCK (playbin);
+ break;
+ }
+ case PROP_CURRENT_SUBURI:
+ {
+ GstSourceGroup *group;
+
+ GST_PLAY_BIN_LOCK (playbin);
group = get_group (playbin);
g_value_set_string (value, group->suburi);
GST_PLAY_BIN_UNLOCK (playbin);
static GType gst_red_video_src_get_type (void);
static GType gst_codec_src_get_type (void);
+GST_START_TEST (test_uri)
+{
+ GstElement *playbin, *fakesink;
+ gchar *uri;
+
+ fail_unless (gst_element_register (NULL, "redvideosrc", GST_RANK_PRIMARY,
+ gst_red_video_src_get_type ()));
+
+ playbin = gst_element_factory_make ("playbin", "playbin");
+ fail_unless (playbin != NULL, "Failed to create playbin element");
+
+ fakesink = gst_element_factory_make ("fakesink", "fakesink");
+ fail_unless (fakesink != NULL, "Failed to create fakesink element");
+
+ g_object_set (playbin, "video-sink", fakesink, NULL);
+
+ g_object_set (playbin, "uri", "redvideo://", NULL);
+ g_object_get (playbin, "uri", &uri, NULL);
+
+ fail_unless_equals_string (uri, "redvideo://");
+
+ g_object_get (playbin, "current-uri", &uri, NULL);
+ fail_unless_equals_string (uri, NULL);
+
+ fail_unless_equals_int (gst_element_set_state (playbin, GST_STATE_PAUSED),
+ GST_STATE_CHANGE_ASYNC);
+ fail_unless_equals_int (gst_element_get_state (playbin, NULL, NULL, -1),
+ GST_STATE_CHANGE_SUCCESS);
+
+ g_object_get (playbin, "uri", &uri, NULL);
+ fail_unless_equals_string (uri, NULL);
+ g_object_get (playbin, "current-uri", &uri, NULL);
+ fail_unless_equals_string (uri, "redvideo://");
+
+ gst_element_set_state (playbin, GST_STATE_NULL);
+ gst_object_unref (playbin);
+}
+
+GST_END_TEST;
+
/* make sure the audio sink is not touched for video-only streams */
GST_START_TEST (test_sink_usage_video_only_stream)
{
suite_add_tcase (s, tc_chain);
#ifndef GST_DISABLE_REGISTRY
+ tcase_add_test (tc_chain, test_uri);
tcase_add_test (tc_chain, test_sink_usage_video_only_stream);
tcase_add_test (tc_chain, test_suburi_error_wrongproto);
tcase_add_test (tc_chain, test_suburi_error_invalidfile);