}
#endif /* DISABLE_FAULT_HANDLER */
+#if 0
typedef struct _GstIndexStats
{
gint id;
gint i;
if (index_stats->len) {
- g_print (_("Index statistics\n"));
+ g_print ("%s:\n", _("Index statistics"));
}
for (i = 0; i < index_stats->len; i++) {
}
}
}
+#endif
+
+/* Kids, use the functions from libgstpbutils in gst-plugins-base in your
+ * own code (we can't do that here because it would introduce a circular
+ * dependency) */
+static gboolean
+gst_is_missing_plugin_message (GstMessage * msg)
+{
+ if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT
+ || gst_message_get_structure (msg) == NULL)
+ return FALSE;
+
+ return gst_structure_has_name (gst_message_get_structure (msg),
+ "missing-plugin");
+}
+
+static const gchar *
+gst_missing_plugin_message_get_description (GstMessage * msg)
+{
+ return gst_structure_get_string (gst_message_get_structure (msg), "name");
+}
static void
print_error_message (GstMessage * msg)
if (img) {
gchar *caps_str;
- caps_str = GST_BUFFER_CAPS (img) ?
- gst_caps_to_string (GST_BUFFER_CAPS (img)) : g_strdup ("unknown");
+ caps_str = g_strdup ("unknown");
str = g_strdup_printf ("buffer of %" G_GSIZE_FORMAT " bytes, type: %s",
gst_buffer_get_size (img), caps_str);
g_free (caps_str);
sigaction (SIGINT, &action, NULL);
}
-
-/* FIXME 0.11: remove SIGUSR handling (also from man page) */
-static void
-play_handler (int signum)
-{
- switch (signum) {
- case SIGUSR1:
- PRINT ("Caught SIGUSR1 - Play request.\n");
- gst_element_set_state (pipeline, GST_STATE_PLAYING);
- break;
- case SIGUSR2:
- PRINT ("Caught SIGUSR2 - Stop request.\n");
- gst_element_set_state (pipeline, GST_STATE_NULL);
- break;
- }
-}
-
-static void
-play_signal_setup (void)
-{
- struct sigaction action;
-
- memset (&action, 0, sizeof (action));
- action.sa_handler = play_handler;
- sigaction (SIGUSR1, &action, NULL);
- sigaction (SIGUSR2, &action, NULL);
-}
#endif /* DISABLE_FAULT_HANDLER */
/* returns ELR_ERROR if there was an error
res = ELR_INTERRUPT;
goto exit;
}
+ break;
+ }
+ case GST_MESSAGE_ELEMENT:{
+ if (gst_is_missing_plugin_message (message)) {
+ const gchar *desc;
+
+ desc = gst_missing_plugin_message_get_description (message);
+ PRINT (_("Missing element: %s\n"), desc ? desc : "(no description)");
+ }
+ break;
}
default:
/* just be quiet by default */
/* options */
gboolean verbose = FALSE;
gboolean no_fault = FALSE;
- gboolean no_sigusr_handler = FALSE;
gboolean trace = FALSE;
gboolean eos_on_shutdown = FALSE;
+#if 0
gboolean check_index = FALSE;
+#endif
gchar *savefile = NULL;
gchar *exclude_args = NULL;
#ifndef GST_DISABLE_OPTION_PARSING
N_("Do not output status information of TYPE"), N_("TYPE1,TYPE2,...")},
{"no-fault", 'f', 0, G_OPTION_ARG_NONE, &no_fault,
N_("Do not install a fault handler"), NULL},
- {"no-sigusr-handler", '\0', 0, G_OPTION_ARG_NONE, &no_sigusr_handler,
- N_("Do not install signal handlers for SIGUSR1 and SIGUSR2"), NULL},
{"trace", 'T', 0, G_OPTION_ARG_NONE, &trace,
N_("Print alloc trace (if enabled at compile time)"), NULL},
{"eos-on-shutdown", 'e', 0, G_OPTION_ARG_NONE, &eos_on_shutdown,
N_("Force EOS on sources before shutting the pipeline down"), NULL},
+#if 0
{"index", 'i', 0, G_OPTION_ARG_NONE, &check_index,
N_("Gather and print index statistics"), NULL},
+#endif
GST_TOOLS_GOPTION_VERSION,
{NULL}
};
GOptionContext *ctx;
GError *err = NULL;
#endif
+#if 0
GstIndex *index;
GPtrArray *index_stats = NULL;
+#endif
gchar **argvn;
GError *error = NULL;
gint res = 0;
textdomain (GETTEXT_PACKAGE);
#endif
+#if !GLIB_CHECK_VERSION (2, 31, 0)
g_thread_init (NULL);
+#endif
gst_tools_set_prgname ("gst-launch");
fault_setup ();
sigint_setup ();
-
- if (!no_sigusr_handler)
- play_signal_setup ();
#endif
if (trace) {
gst_bin_add (GST_BIN (real_pipeline), pipeline);
pipeline = real_pipeline;
}
-
+#if 0
if (check_index) {
/* gst_index_new() creates a null-index, it does not store anything, but
* the entry-added signal works and this is what we use to build the
gst_element_set_index (pipeline, index);
}
}
+#endif
bus = gst_element_get_bus (pipeline);
gst_bus_set_sync_handler (bus, bus_sync_handler, (gpointer) pipeline);
gst_element_set_state (pipeline, GST_STATE_READY);
gst_element_get_state (pipeline, &state, &pending, GST_CLOCK_TIME_NONE);
+#if 0
if (check_index) {
print_index_stats (index_stats);
g_ptr_array_free (index_stats, TRUE);
}
+#endif
end:
PRINT (_("Setting pipeline to NULL ...\n"));