static void
gst_discoverer_info_init (GstDiscovererInfo * info)
{
- /* Nothing needs initialization */
+ info->missing_elements_details = g_ptr_array_new_with_free_func (g_free);
}
static void
if (info->toc)
gst_toc_unref (info->toc);
+
+ g_ptr_array_unref (info->missing_elements_details);
}
static GstDiscovererInfo *
* gst_discoverer_stream_info_get_misc:
* @info: a #GstDiscovererStreamInfo
*
+ * Deprecated: This functions is deprecated since version 1.4, use
+ * gst_discoverer_stream_get_missing_elements_installer_details
+ *
* Returns: (transfer none): additional information regarding the stream (for
* example codec version, profile, etc..). If you wish to use the #GstStructure
* after the life-time of @info you will need to copy it.
* gst_discoverer_info_get_misc:
* @info: a #GstDiscovererInfo
*
+ * Deprecated: This functions is deprecated since version 1.4, use
+ * gst_discoverer_info_get_missing_elements_installer_details
+ *
* Returns: (transfer none): Miscellaneous information stored as a #GstStructure
* (for example: information about missing plugins). If you wish to use the
* #GstStructure after the life-time of @info, you will need to copy it.
*
* Decrements the reference count of @info.
*/
+
+
+/**
+ * gst_discoverer_info_get_missing_elements_installer_details:
+ * @info: a #GstDiscovererStreamInfo to retrieve installer detail
+ * for the missing element
+ *
+ * Get the installer details for missing elements
+ *
+ * Returns: (transfer full): (array zero-terminated=1): An array of strings
+ * containing informations about how to install the various missing elements
+ * for @info to be usable. Free with g_strfreev.
+ *
+ * Since: 1.4
+ */
+const gchar **
+gst_discoverer_info_get_missing_elements_installer_details (const
+ GstDiscovererInfo * info)
+{
+
+ if (info->result != GST_DISCOVERER_MISSING_PLUGINS) {
+ GST_WARNING_OBJECT (info, "Trying to get missing element installed details "
+ "but result is not 'MISSING_PLUGINS'");
+
+ return NULL;
+ }
+
+ if (info->missing_elements_details->pdata[info->missing_elements_details->
+ len]) {
+ GST_DEBUG ("Adding NULL pointer to the end of missing_elements_details");
+ g_ptr_array_add (info->missing_elements_details, NULL);
+ }
+
+ return (const gchar **) info->missing_elements_details->pdata;
+}
GST_DEBUG_OBJECT (GST_MESSAGE_SRC (msg),
"Setting result to MISSING_PLUGINS");
dc->priv->current_info->result = GST_DISCOVERER_MISSING_PLUGINS;
+ /* FIXME 2.0 Remove completely the ->misc
+ * Keep the old behaviour for now.
+ */
if (dc->priv->current_info->misc)
gst_structure_free (dc->priv->current_info->misc);
- dc->priv->current_info->misc = gst_structure_copy (structure);
+ g_ptr_array_add (dc->priv->current_info->missing_elements_details,
+ gst_missing_plugin_message_get_installer_detail (msg));
} else if (sttype == _STREAM_TOPOLOGY_QUARK) {
if (dc->priv->current_topology)
gst_structure_free (dc->priv->current_topology);
{
g_print ("Missing plugins\n");
if (verbose) {
- gchar *tmp =
- gst_structure_to_string (gst_discoverer_info_get_misc (info));
- g_print (" (%s)\n", tmp);
- g_free (tmp);
+ gint i = 0;
+ const gchar **installer_details =
+ gst_discoverer_info_get_missing_elements_installer_details (info);
+
+ while (installer_details[i]) {
+ g_print (" (%s)\n", installer_details[i]);
+
+ i++;
+ }
}
break;
}