static void
gst_discoverer_stream_info_init (GstDiscovererStreamInfo * info)
{
- /* Nothing needs initialization */
+ info->stream_number = -1;
}
static void
if (stream_map)
g_hash_table_insert (stream_map, info, ret);
+ ret->stream_number = info->stream_number;
+
return ret;
}
}
#endif
+/**
+ * gst_discoverer_stream_info_get_stream_number:
+ * @info: a #GstDiscovererStreamInfo
+ *
+ * Returns: the stream number, -1 if no index could be determined. This property
+ * acts as a unique identifier as a 'int' for the stream.
+ *
+ * Since: 1.20
+ */
+gint
+gst_discoverer_stream_info_get_stream_number (GstDiscovererStreamInfo * info)
+{
+ g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), -1);
+
+ return info->stream_number;
+}
+
/* GstDiscovererContainerInfo */
/**
}
if (add_to_list) {
+ res->stream_number = dc->priv->current_info->stream_count++;
dc->priv->current_info->stream_list =
g_list_append (dc->priv->current_info->stream_list, res);
} else {
else
dc->priv->current_info->live = TRUE;
- if (dc->priv->current_topology)
+ if (dc->priv->current_topology) {
+ dc->priv->current_info->stream_count = 1;
dc->priv->current_info->stream_info = parse_stream_topology (dc,
dc->priv->current_topology, NULL);
+ if (dc->priv->current_info->stream_info)
+ dc->priv->current_info->stream_info->stream_number = 0;
+ }
/*
* Images need some special handling. They do not have a duration, have
_parse_common_stream_info (sinfo, g_variant_get_child_value (common, 0),
info);
- if (!GST_IS_DISCOVERER_CONTAINER_INFO (sinfo))
+ if (!GST_IS_DISCOVERER_CONTAINER_INFO (sinfo)) {
info->stream_list = g_list_append (info->stream_list, sinfo);
+ }
if (!info->stream_info) {
info->stream_info = sinfo;
GST_PBUTILS_API
const gchar * gst_discoverer_stream_info_get_stream_type_nick(GstDiscovererStreamInfo* info);
+GST_PBUTILS_API
+gint gst_discoverer_stream_info_get_stream_number(GstDiscovererStreamInfo *info);
+
/**
* GstDiscovererContainerInfo:
*
GstToc *toc;
gchar *stream_id;
GstStructure *misc;
+ gint stream_number;
};
struct _GstDiscovererContainerInfo {
gboolean seekable;
GPtrArray *missing_elements_details;
+ gint stream_count;
+
gchar *cachefile;
gpointer from_cache;
};
gst_caps_unref (caps);
}
- g_print ("%*s%s: %s\n", 2 * GPOINTER_TO_INT (depth), " ",
+ g_print ("%*s%s #%d: %s\n", 2 * GPOINTER_TO_INT (depth), " ",
gst_discoverer_stream_info_get_stream_type_nick (info),
- GST_STR_NULL (desc));
+ gst_discoverer_stream_info_get_stream_number (info), GST_STR_NULL (desc));
if (desc) {
g_free (desc);