Example #1
0
static void
print_hierarchy (GType type, gint level, gint * maxlevel)
{
  GType parent;
  gint i;

  parent = g_type_parent (type);

  *maxlevel = *maxlevel + 1;
  level++;

  if (parent)
    print_hierarchy (parent, level, maxlevel);

  if (_name)
    g_print ("%s", _name);

  for (i = 1; i < *maxlevel - level; i++)
    g_print ("      ");
  if (*maxlevel - level)
    g_print (" +----");

  g_print ("%s\n", g_type_name (type));

  if (level == 1)
    n_print ("\n");
}
Example #2
0
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;
}
Example #3
0
	/* Report failure */
	void failure(const std::string& err, const std::string& name) {
		std::stringstream ss;
		throw compare_fails_exception((ss
			<< "Files are different at " 
			<< history.back().first
			<< "."
			<< name
			<< ".\nError is: "
			<< err
			<< ".\nCurrent position in scene hierarchy is "
			<< print_hierarchy(),ss.str().c_str()
			));
	}