Don't expose test source enum value table

This commit is contained in:
Brandon Lewis 2010-07-08 16:35:43 +02:00 committed by Edward Hervey
parent 318abee5fb
commit 66745d0695
3 changed files with 13 additions and 12 deletions

View file

@ -468,7 +468,7 @@ ges_text_halign_get_type (void)
}
/* table more-or-less copied from gstvideotestsrc.c */
GEnumValue vpattern_enum_values[] = {
static GEnumValue vpattern_enum_values[] = {
{GES_VIDEO_TEST_PATTERN_SMPTE, "SMPTE 100% color bars", "smpte"}
,
{GES_VIDEO_TEST_PATTERN_SNOW, "Random (television snow)", "snow"}

View file

@ -292,8 +292,6 @@ typedef enum {
#define GES_VIDEO_TEST_PATTERN_TYPE\
ges_video_test_pattern_get_type()
extern GEnumValue vpattern_enum_values[];
GType ges_video_test_pattern_get_type (void);
G_END_DECLS

View file

@ -309,16 +309,19 @@ GESTimelineTestSource *
ges_timeline_test_source_new_for_nick (gchar * nick)
{
GEnumValue *value;
int i;
GEnumClass *klass;
GESTimelineTestSource *ret = NULL;
for (i = 0, value = &vpattern_enum_values[i]; value->value_nick;
value = &vpattern_enum_values[i++]) {
if (!strcmp (nick, value->value_nick)) {
return g_object_new (GES_TYPE_TIMELINE_TEST_SOURCE, "vpattern",
(gint) value->value, NULL);
}
value++;
klass = G_ENUM_CLASS (g_type_class_ref (GES_VIDEO_TEST_PATTERN_TYPE));
if (!klass)
return NULL;
value = g_enum_get_value_by_nick (klass, nick);
if (value) {
ret = g_object_new (GES_TYPE_TIMELINE_TEST_SOURCE, "vpattern",
(gint) value->value, NULL);
}
return NULL;
g_type_class_unref (klass);
return ret;
}