static int print_element_info (GstElementFactory * factory, gboolean print_names) { GstElement *element; gint maxlevel = 0; factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE (factory))); if (!factory) { g_print ("element plugin couldn't be loaded\n"); return -1; } element = gst_element_factory_create (factory, NULL); if (!element) { g_print ("couldn't construct element for some reason\n"); return -1; } if (print_names) _name = g_strdup_printf ("%s: ", GST_PLUGIN_FEATURE (factory)->name); else _name = NULL; print_factory_details_info (factory); if (GST_PLUGIN_FEATURE (factory)->plugin_name) { GstPlugin *plugin; plugin = gst_registry_find_plugin (gst_registry_get_default (), GST_PLUGIN_FEATURE (factory)->plugin_name); if (plugin) { print_plugin_info (plugin); } } print_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel); print_interfaces (G_OBJECT_TYPE (element)); print_pad_templates_info (element, factory); print_element_flag_info (element); print_implementation_info (element); print_clocking_info (element); print_index_info (element); print_uri_handler_info (element); print_pad_info (element); print_element_properties_info (element); print_signal_info (element); print_children_info (element); gst_object_unref (element); gst_object_unref (factory); g_free (_name); return 0; }
void mmcli_modem_signal_run_synchronous (GDBusConnection *connection) { GError *error = NULL; /* Initialize context */ ctx = g_new0 (Context, 1); ctx->object = mmcli_get_modem_sync (connection, mmcli_get_common_modem_string (), &ctx->manager); ctx->modem_signal = mm_object_get_modem_signal (ctx->object); /* Setup operation timeout */ if (ctx->modem_signal) mmcli_force_operation_timeout (G_DBUS_PROXY (ctx->modem_signal)); ensure_modem_signal (); /* Request to get signal info? */ if (get_flag) { print_signal_info (); return; } /* Request to set rate? */ if (setup_str) { guint rate; gboolean result; if (!mm_get_uint_from_str (setup_str, &rate)) { g_printerr ("error: invalid rate value '%s'", setup_str); exit (EXIT_FAILURE); } g_debug ("Synchronously setting up extended signal quality information retrieval..."); result = mm_modem_signal_setup_sync (ctx->modem_signal, rate, NULL, &error); setup_process_reply (result, error); return; } g_warn_if_reached (); }