summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRobert Swain <robert.swain@collabora.co.uk>2010-07-21 16:32:11 +0200
committerRobert Swain <robert.swain@collabora.co.uk>2010-07-25 13:37:47 +0200
commitac6b656ed31129b6810b9fbd757f6f6238902c31 (patch)
tree4908d9efab255abbd9dadb15221a9e7d33775f05 /ext
parentd6f766d10f2b7162bdcf45294a83260075261a3f (diff)
x264enc: Update available me types
Use the x264_motion_est_names[] array to populate the enum of ME types. This is now self-maintaining.
Diffstat (limited to 'ext')
-rw-r--r--ext/x264/gstx264enc.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index 4174a662..5a09f326 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -204,17 +204,26 @@ static GType
gst_x264_enc_me_get_type (void)
{
static GType me_type = 0;
- static const GEnumValue me_types[] = {
- {X264_ME_DIA, "diamond search, radius 1 (fast)", "dia"},
- {X264_ME_HEX, "hexagonal search, radius 2", "hex"},
- {X264_ME_UMH, "uneven multi-hexagon search", "umh"},
- {X264_ME_ESA, "exhaustive search (slow)", "esa"},
- {0, NULL, NULL}
- };
+ static GEnumValue *me_types;
+ int n, i;
+
+ if (me_type != 0)
+ return me_type;
+
+ n = 0;
+ while (x264_motion_est_names[n] != NULL)
+ n++;
+
+ me_types = g_new0 (GEnumValue, n + 1);
- if (!me_type) {
- me_type = g_enum_register_static ("GstX264EncMe", me_types);
+ for (i = 0; i < n; i++) {
+ me_types[i].value = i;
+ me_types[i].value_name = x264_motion_est_names[i];
+ me_types[i].value_nick = x264_motion_est_names[i];
}
+
+ me_type = g_enum_register_static ("GstX264EncMe", me_types);
+
return me_type;
}