ges-launch: Fix and cleanup enum listing

It wasn't displaying anything lately.
This commit is contained in:
Edward Hervey 2011-01-12 17:45:23 +01:00
parent c9677f9e71
commit 0f42801985

View file

@ -37,8 +37,6 @@ static gboolean seenerrors = FALSE;
gboolean pattern_source_fill_func (GESTimelineObject * object, GESTrackObject gboolean pattern_source_fill_func (GESTimelineObject * object, GESTrackObject
* trobject, GstElement * gnlobj, gpointer user_data); * trobject, GstElement * gnlobj, gpointer user_data);
void print_transition_list (void);
gboolean check_path (char *path); gboolean check_path (char *path);
GESTimelineObject *pattern_source_new (guint pattern); GESTimelineObject *pattern_source_new (guint pattern);
@ -47,8 +45,6 @@ gboolean check_time (char *time);
guint64 str_to_time (char *time); guint64 str_to_time (char *time);
void print_pattern_list (void);
gboolean thumbnail_cb (gpointer pipeline); gboolean thumbnail_cb (gpointer pipeline);
static gchar * static gchar *
@ -380,58 +376,31 @@ bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop)
} }
} }
void static void
print_transition_list (void) print_enum (GType enum_type)
{ {
GEnumClass *smpte_class; GEnumClass *enum_class = G_ENUM_CLASS (g_type_class_ref (enum_type));
GESTimelineStandardTransition *tr; guint i;
GESTimelineStandardTransitionClass *klass;
GParamSpec *pspec;
GEnumValue *v;
tr = ges_timeline_standard_transition_new GST_ERROR ("%d", enum_class->n_values);
(GES_VIDEO_STANDARD_TRANSITION_TYPE_CROSSFADE);
klass = GES_TIMELINE_STANDARD_TRANSITION_GET_CLASS (tr);
if ((pspec = g_object_class_find_property (G_OBJECT_CLASS (klass), "vtype"))) { for (i = 0; i < enum_class->n_values; i++) {
g_print ("%s\n", enum_class->values[i].value_nick);
smpte_class = G_ENUM_CLASS (g_type_class_ref (pspec->value_type));
for (v = smpte_class->values; v->value != 0; v++) {
g_print ("%s\n", v->value_nick);
}
g_type_class_unref (smpte_class);
} }
g_object_unref (tr); g_type_class_unref (enum_class);
} }
void static void
print_transition_list (void)
{
print_enum (GES_VIDEO_STANDARD_TRANSITION_TYPE_TYPE);
}
static void
print_pattern_list (void) print_pattern_list (void)
{ {
GEnumClass *enum_class; print_enum (GES_VIDEO_TEST_PATTERN_TYPE);
GESTimelineTestSource *tr;
GESTimelineTestSourceClass *klass;
GParamSpec *pspec;
GEnumValue *v;
tr = ges_timeline_test_source_new ();
klass = GES_TIMELINE_TEST_SOURCE_GET_CLASS (tr);
if ((pspec =
g_object_class_find_property (G_OBJECT_CLASS (klass), "vpattern"))) {
enum_class = G_ENUM_CLASS (g_type_class_ref (pspec->value_type));
for (v = enum_class->values; v->value_nick != NULL; v++) {
g_print ("%s\n", v->value_nick);
}
g_type_class_unref (enum_class);
}
g_object_unref (tr);
} }
int int
@ -506,6 +475,9 @@ main (int argc, gchar ** argv)
exit (1); exit (1);
} }
/* Initialize the GStreamer Editing Services */
ges_init ();
if (list_transitions) { if (list_transitions) {
print_transition_list (); print_transition_list ();
exit (0); exit (0);
@ -523,8 +495,6 @@ main (int argc, gchar ** argv)
} }
g_option_context_free (ctx); g_option_context_free (ctx);
/* Initialize the GStreamer Editing Services */
ges_init ();
/* Create the pipeline */ /* Create the pipeline */
pipeline = create_pipeline (load_path, save_path, argc - 1, argv + 1); pipeline = create_pipeline (load_path, save_path, argc - 1, argv + 1);