From 811ddb9cdcb3add5625c85d34f7c20be4f09732c Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 30 Apr 2009 00:06:36 +0300 Subject: [PATCH] [MOVED FROM BAD 24/28] x264enc: add preset support Add preset iface and a (dummy) preset file as a starting point. --- ext/x264/GstX264Enc.prs | 13 +++++++++++++ ext/x264/Makefile.am | 6 ++++++ ext/x264/gstx264enc.c | 16 +++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ext/x264/GstX264Enc.prs diff --git a/ext/x264/GstX264Enc.prs b/ext/x264/GstX264Enc.prs new file mode 100644 index 0000000000..daf60a7796 --- /dev/null +++ b/ext/x264/GstX264Enc.prs @@ -0,0 +1,13 @@ +[_presets_] +version=0.10 +element-name=GstX264Enc + +# see http://mewiki.project357.com/wiki/X264_Settings for x264 properties + +# lower default bitrate +# turn of cabac for devices that do not support main-profile +[just-an-example] +_meta/comment=use for mobile pocket video player +_meta/device=pocketvideo +bitrate=1024 +cabac=false diff --git a/ext/x264/Makefile.am b/ext/x264/Makefile.am index 891e3fca4e..6c4d4cf62f 100644 --- a/ext/x264/Makefile.am +++ b/ext/x264/Makefile.am @@ -13,3 +13,9 @@ libgstx264_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstx264_la_LIBTOOLFLAGS = --tag=disable-static noinst_HEADERS = gstx264enc.h + +presetdir = $(datadir)/gstreamer-$(GST_MAJORMINOR)/presets +preset_DATA = GstX264Enc.prs + +EXTRA_DIST = $(preset_DATA) + diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 207ceb6e08..37f53ccec2 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -238,7 +238,21 @@ static void gst_x264_enc_set_property (GObject * object, guint prop_id, static void gst_x264_enc_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -GST_BOILERPLATE (GstX264Enc, gst_x264_enc, GstElement, GST_TYPE_ELEMENT); +static void +_do_init (GType object_type) +{ + const GInterfaceInfo preset_interface_info = { + NULL, /* interface_init */ + NULL, /* interface_finalize */ + NULL /* interface_data */ + }; + + g_type_add_interface_static (object_type, GST_TYPE_PRESET, + &preset_interface_info); +} + +GST_BOILERPLATE_FULL (GstX264Enc, gst_x264_enc, GstElement, GST_TYPE_ELEMENT, + _do_init); static void gst_x264_enc_base_init (gpointer g_class)