diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2020-11-04 14:26:55 +0100 |
---|---|---|
committer | Stéphane Cerveau <scerveau@collabora.com> | 2020-12-10 17:03:11 +0100 |
commit | d80bfacde35f027c6221516f9996c579df6d3ea7 (patch) | |
tree | 5ca38eb4250437d536b318a08822c276d82a5406 | |
parent | 68102a52e3db4825cbefa91407474b913d9d26ab (diff) |
gst-plugin: apply gst-indent
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-template/-/merge_requests/6>
-rw-r--r-- | gst-plugin/src/gstaudiofilter.c | 35 | ||||
-rw-r--r-- | gst-plugin/src/gstplugin.c | 44 | ||||
-rw-r--r-- | gst-plugin/src/gsttransform.c | 63 |
3 files changed, 62 insertions, 80 deletions
diff --git a/gst-plugin/src/gstaudiofilter.c b/gst-plugin/src/gstaudiofilter.c index 0c67a9f..2e4af9a 100644 --- a/gst-plugin/src/gstaudiofilter.c +++ b/gst-plugin/src/gstaudiofilter.c @@ -55,7 +55,7 @@ * ]| * </refsect2> */ - + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -70,7 +70,7 @@ GST_DEBUG_CATEGORY_STATIC (audiofiltertemplate_debug); #define GST_TYPE_AUDIO_FILTER_TEMPLATE (gst_audio_filter_template_get_type()) G_DECLARE_FINAL_TYPE (GstAudioFilterTemplate, gst_audio_filter_template, - GST, AUDIO_FILTER_TEMPLATE, GstAudioFilter) + GST, AUDIO_FILTER_TEMPLATE, GstAudioFilter); struct _GstAudioFilterTemplate { @@ -90,7 +90,7 @@ enum enum { ARG_0 - /* FILL ME */ + /* FILL ME */ }; G_DEFINE_TYPE (GstAudioFilterTemplate, gst_audio_filter_template, @@ -103,11 +103,11 @@ static void gst_audio_filter_template_get_property (GObject * object, static gboolean gst_audio_filter_template_setup (GstAudioFilter * filter, const GstAudioInfo * info); -static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * bt, - GstBuffer * outbuf, GstBuffer * inbuf); +static GstFlowReturn gst_audio_filter_template_filter (GstBaseTransform * + bt, GstBuffer * outbuf, GstBuffer * inbuf); static GstFlowReturn -gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform, - GstBuffer * buf); +gst_audio_filter_template_filter_inplace (GstBaseTransform * + base_transform, GstBuffer * buf); #if 0 /* This means we support signed 16-bit pcm and signed 32-bit pcm in native @@ -154,11 +154,9 @@ gst_audio_filter_template_class_init (GstAudioFilterTemplateClass * klass) btrans_class->transform = gst_audio_filter_template_filter; btrans_class->transform_ip = gst_audio_filter_template_filter_inplace; /* Set some basic metadata about your new element */ - gst_element_class_set_details_simple (element_class, - "Audio Filter Template", /* FIXME: short name */ - "Filter/Effect/Audio", - "Filters audio", /* FIXME: short description*/ - "Name <mail@example.com>"); /* FIXME: author */ + gst_element_class_set_details_simple (element_class, "Audio Filter Template", /* FIXME: short name */ + "Filter/Effect/Audio", "Filters audio", /* FIXME: short description */ + "Name <mail@example.com>"); /* FIXME: author */ caps = gst_caps_from_string (SUPPORTED_CAPS_STRING); gst_audio_filter_class_add_pad_templates (audio_filter_class, caps); @@ -275,7 +273,7 @@ gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform, #if 0 switch (GST_AUDIO_FILTER_FORMAT (filter)) { case GST_AUDIO_FORMAT_S16LE: - case GST_AUDIO_FORMAT_S16BE: { + case GST_AUDIO_FORMAT_S16BE:{ gint16 *samples = map.data; guint n_samples = map.size / sizeof (gint16); guint i; @@ -287,7 +285,7 @@ gst_audio_filter_template_filter_inplace (GstBaseTransform * base_transform, } default: g_warning ("Unexpected audio format %s!", - GST_AUDIO_INFO_NAME (GST_AUDIO_FILTER_INFO(filter))); + GST_AUDIO_INFO_NAME (GST_AUDIO_FILTER_INFO (filter))); flow = GST_FLOW_ERROR; break; } @@ -315,14 +313,9 @@ plugin_init (GstPlugin * plugin) * * FIXME:exchange the string 'Template plugin' with you plugin description */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, audiofilterexample, "Audio filter example plugin", plugin_init, - PACKAGE_VERSION, - GST_LICENSE, - GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN -); + PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN); diff --git a/gst-plugin/src/gstplugin.c b/gst-plugin/src/gstplugin.c index c561a53..3ee7e72 100644 --- a/gst-plugin/src/gstplugin.c +++ b/gst-plugin/src/gstplugin.c @@ -99,13 +99,16 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", #define gst_plugin_template_parent_class parent_class G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_ELEMENT); -static void gst_plugin_template_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec); -static void gst_plugin_template_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); -static gboolean gst_plugin_template_sink_event (GstPad * pad, GstObject * parent, GstEvent * event); -static GstFlowReturn gst_plugin_template_chain (GstPad * pad, GstObject * parent, GstBuffer * buf); +static void gst_plugin_template_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec); +static void gst_plugin_template_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec); + +static gboolean gst_plugin_template_sink_event (GstPad * pad, + GstObject * parent, GstEvent * event); +static GstFlowReturn gst_plugin_template_chain (GstPad * pad, + GstObject * parent, GstBuffer * buf); /* GObject vmethod implementations */ @@ -126,11 +129,10 @@ gst_plugin_template_class_init (GstPluginTemplateClass * klass) g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", FALSE, G_PARAM_READWRITE)); - gst_element_class_set_details_simple(gstelement_class, - "Plugin", - "FIXME:Generic", - "FIXME:Generic Template Element", - "AUTHOR_NAME AUTHOR_EMAIL"); + gst_element_class_set_details_simple (gstelement_class, + "Plugin", + "FIXME:Generic", + "FIXME:Generic Template Element", "AUTHOR_NAME AUTHOR_EMAIL"); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&src_factory)); @@ -148,9 +150,9 @@ gst_plugin_template_init (GstPluginTemplate * filter) { filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink"); gst_pad_set_event_function (filter->sinkpad, - GST_DEBUG_FUNCPTR(gst_plugin_template_sink_event)); + GST_DEBUG_FUNCPTR (gst_plugin_template_sink_event)); gst_pad_set_chain_function (filter->sinkpad, - GST_DEBUG_FUNCPTR(gst_plugin_template_chain)); + GST_DEBUG_FUNCPTR (gst_plugin_template_chain)); GST_PAD_SET_PROXY_CAPS (filter->sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); @@ -197,7 +199,8 @@ gst_plugin_template_get_property (GObject * object, guint prop_id, /* this function handles sink events */ static gboolean -gst_plugin_template_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) +gst_plugin_template_sink_event (GstPad * pad, GstObject * parent, + GstEvent * event) { GstPluginTemplate *filter; gboolean ret; @@ -210,7 +213,7 @@ gst_plugin_template_sink_event (GstPad * pad, GstObject * parent, GstEvent * eve switch (GST_EVENT_TYPE (event)) { case GST_EVENT_CAPS: { - GstCaps * caps; + GstCaps *caps; gst_event_parse_caps (event, &caps); /* do something with the caps */ @@ -251,7 +254,7 @@ gst_plugin_template_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) static gboolean plugin_init (GstPlugin * plugin) { - /* debug category for fltering log messages + /* debug category for filtering log messages * * exchange the string 'Template plugin' with your description */ @@ -275,14 +278,9 @@ plugin_init (GstPlugin * plugin) * * exchange the string 'Template plugin' with your plugin description */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, plugin, "Template plugin", plugin_init, - PACKAGE_VERSION, - GST_LICENSE, - GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN -) + PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/gst-plugin/src/gsttransform.c b/gst-plugin/src/gsttransform.c index 28793b7..9bbc3fa 100644 --- a/gst-plugin/src/gsttransform.c +++ b/gst-plugin/src/gsttransform.c @@ -62,32 +62,28 @@ enum * * FIXME:describe the real formats here. */ -static GstStaticPadTemplate sink_template = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("ANY") -); - -static GstStaticPadTemplate src_template = -GST_STATIC_PAD_TEMPLATE ( - "src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("ANY") -); +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("ANY") + ); + +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("ANY") + ); #define gst_plugin_template_parent_class parent_class G_DEFINE_TYPE (GstPluginTemplate, gst_plugin_template, GST_TYPE_BASE_TRANSFORM); -static void gst_plugin_template_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec); -static void gst_plugin_template_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); +static void gst_plugin_template_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec); +static void gst_plugin_template_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec); -static GstFlowReturn gst_plugin_template_transform_ip (GstBaseTransform * base, - GstBuffer * outbuf); +static GstFlowReturn gst_plugin_template_transform_ip (GstBaseTransform * + base, GstBuffer * outbuf); /* GObject vmethod implementations */ @@ -105,14 +101,13 @@ gst_plugin_template_class_init (GstPluginTemplateClass * klass) gobject_class->get_property = gst_plugin_template_get_property; g_object_class_install_property (gobject_class, PROP_SILENT, - g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", + g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?", FALSE, G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE)); gst_element_class_set_details_simple (gstelement_class, - "Plugin", - "Generic/Filter", - "FIXME:Generic Template Filter", - "AUTHOR_NAME AUTHOR_EMAIL"); + "Plugin", + "Generic/Filter", + "FIXME:Generic Template Filter", "AUTHOR_NAME AUTHOR_EMAIL"); gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&src_template)); @@ -126,14 +121,15 @@ gst_plugin_template_class_init (GstPluginTemplateClass * klass) * * FIXME:exchange the string 'Template plugin' with your description */ - GST_DEBUG_CATEGORY_INIT (gst_plugin_template_debug, "plugin", 0, "Template plugin"); + GST_DEBUG_CATEGORY_INIT (gst_plugin_template_debug, "plugin", 0, + "Template plugin"); } /* initialize the new element * initialize instance structure */ static void -gst_plugin_template_init (GstPluginTemplate *filter) +gst_plugin_template_init (GstPluginTemplate * filter) { filter->silent = FALSE; } @@ -184,7 +180,7 @@ gst_plugin_template_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) if (filter->silent == FALSE) g_print ("I'm plugged, therefore I'm in.\n"); - + /* FIXME: do something interesting here. This simply copies the source * to the destination. */ @@ -207,14 +203,9 @@ plugin_init (GstPlugin * plugin) * * FIXME:exchange the string 'Template plugin' with you plugin description */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, plugin, "Template plugin", plugin_init, - PACKAGE_VERSION, - GST_LICENSE, - GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN -) + PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) |