diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2007-05-18 09:35:28 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2007-05-18 09:35:28 +0000 |
commit | d337dda7363352c89369fcae3bb0db898b092a5b (patch) | |
tree | 22fcdb0916c5445e7cb76d6dbec187ee61c63289 | |
parent | 0df2cb85cc918ceba8276c54a3d9803696fafe2b (diff) | |
download | gst-plugins-bad-d337dda7363352c89369fcae3bb0db898b092a5b.tar.gz gst-plugins-bad-d337dda7363352c89369fcae3bb0db898b092a5b.tar.bz2 gst-plugins-bad-d337dda7363352c89369fcae3bb0db898b092a5b.zip |
ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_in...
Original commit message from CVS:
* ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init):
* ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init):
* ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT,
_do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init):
First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS,
GST_DEBUG_FUNCPTR and add log-category.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ext/amrwb/gstamrwbdec.c | 35 | ||||
-rw-r--r-- | ext/amrwb/gstamrwbenc.c | 29 | ||||
-rw-r--r-- | ext/amrwb/gstamrwbparse.c | 36 |
4 files changed, 54 insertions, 57 deletions
@@ -1,3 +1,14 @@ +2007-05-18 Stefan Kost <ensonic@users.sf.net> + + * ext/amrwb/gstamrwbdec.c (gst_amrwbdec_debug, GST_CAT_DEFAULT, + _do_init, gst_amrwbdec_base_init, gst_amrwbdec_class_init): + * ext/amrwb/gstamrwbenc.c (gst_amrwbenc_debug, GST_CAT_DEFAULT, + _do_init, gst_amrwbenc_base_init, gst_amrwbenc_class_init): + * ext/amrwb/gstamrwbparse.c (gst_amrwbparse_debug, GST_CAT_DEFAULT, + _do_init, gst_amrwbparse_base_init, gst_amrwbparse_class_init): + First round of cleanups, that use GST_BOILERPLATE, GST_ELEMENT_DETAILS, + GST_DEBUG_FUNCPTR and add log-category. + 2007-05-17 Edward Hervey <edward@fluendo.com> * sys/osxvideo/osxvideosink.h: diff --git a/ext/amrwb/gstamrwbdec.c b/ext/amrwb/gstamrwbdec.c index b382e3c0..f4a48d64 100644 --- a/ext/amrwb/gstamrwbdec.c +++ b/ext/amrwb/gstamrwbdec.c @@ -18,8 +18,7 @@ */ /* - * - * gst-launch filesrc location=abc.amr ! audio/AMR-WB ! amrwbdec ! audioresample ! audioconvert ! alsasink + * gst-launch filesrc locationabc.amr ! audio/AMR-WB ! amrwbdec ! audioresample ! audioconvert ! alsasink */ #ifdef HAVE_CONFIG_H @@ -28,13 +27,6 @@ #include "gstamrwbdec.h" -static const GstElementDetails gst_amrwbdec_details = -GST_ELEMENT_DETAILS ("AMR-WB audio decoder", - "Codec/Decoder/Audio", - "Adaptive Multi-Rate Wideband audio decoder", - "Renato Araujo <renato.filho@indt.org.br>"); - - static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -53,12 +45,10 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", "rate = (int) 16000, " "channels = (int) 1") ); -extern const UWord8 block_size[]; +GST_DEBUG_CATEGORY_STATIC (gst_amrwbdec_debug); +#define GST_CAT_DEFAULT gst_amrwbdec_debug -static void gst_amrwbdec_base_init (gpointer klass); -static void gst_amrwbdec_class_init (GstAmrwbDecClass * klass); -static void gst_amrwbdec_init (GstAmrwbDec * amrwbdec, - GstAmrwbDecClass * klass); +extern const UWord8 block_size[]; static gboolean gst_amrwbdec_event (GstPad * pad, GstEvent * event); static GstFlowReturn gst_amrwbdec_chain (GstPad * pad, GstBuffer * buffer); @@ -66,20 +56,27 @@ static gboolean gst_amrwbdec_setcaps (GstPad * pad, GstCaps * caps); static GstStateChangeReturn gst_amrwbdec_state_change (GstElement * element, GstStateChange transition); -GST_BOILERPLATE (GstAmrwbDec, gst_amrwbdec, GstElement, GST_TYPE_ELEMENT); +#define _do_init(bla) \ + GST_DEBUG_CATEGORY_INIT (gst_amrwbdec_debug, "amrwbdec", 0, "AMR-WB audio decoder"); + +GST_BOILERPLATE_FULL (GstAmrwbDec, gst_amrwbdec, GstElement, GST_TYPE_ELEMENT, + _do_init); static void gst_amrwbdec_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstElementDetails details = GST_ELEMENT_DETAILS ("AMR-WB audio decoder", + "Codec/Decoder/Audio", + "Adaptive Multi-Rate Wideband audio decoder", + "Renato Araujo <renato.filho@indt.org.br>"); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_template)); - gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_template)); - gst_element_class_set_details (element_class, &gst_amrwbdec_details); + gst_element_class_set_details (element_class, &details); } static void @@ -87,9 +84,7 @@ gst_amrwbdec_class_init (GstAmrwbDecClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - - element_class->change_state = gst_amrwbdec_state_change; + element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbdec_state_change); } static void diff --git a/ext/amrwb/gstamrwbenc.c b/ext/amrwb/gstamrwbenc.c index 5319e899..0d8e91e0 100644 --- a/ext/amrwb/gstamrwbenc.c +++ b/ext/amrwb/gstamrwbenc.c @@ -23,13 +23,6 @@ #include "gstamrwbenc.h" -static const GstElementDetails gst_amrwbenc_details = -GST_ELEMENT_DETAILS ("AMR-WB audio encoder", - "Codec/Encoder/Audio", - "Adaptive Multi-Rate Wideband audio encoder", - "Renato Araujo <renato.filho@indt.org.br>"); - - static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, @@ -48,10 +41,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", "rate = (int) 16000, " "channels = (int) 1") ); -static void gst_amrwbenc_base_init (gpointer klass); -static void gst_amrwbenc_class_init (GstAmrwbEncClass * klass); -static void gst_amrwbenc_init (GstAmrwbEnc * amrwbenc, - GstAmrwbEncClass * klass); +GST_DEBUG_CATEGORY_STATIC (gst_amrwbenc_debug); +#define GST_CAT_DEFAULT gst_amrwbenc_debug + static void gst_amrwbenc_finalize (GObject * object); static GstFlowReturn gst_amrwbenc_chain (GstPad * pad, GstBuffer * buffer); @@ -59,20 +51,27 @@ static gboolean gst_amrwbenc_setcaps (GstPad * pad, GstCaps * caps); static GstStateChangeReturn gst_amrwbenc_state_change (GstElement * element, GstStateChange transition); +#define _do_init(bla) \ + GST_DEBUG_CATEGORY_INIT (gst_amrwbenc_debug, "amrwbenc", 0, "AMR-WB audio encoder"); -GST_BOILERPLATE (GstAmrwbEnc, gst_amrwbenc, GstElement, GST_TYPE_ELEMENT); +GST_BOILERPLATE_FULL (GstAmrwbEnc, gst_amrwbenc, GstElement, GST_TYPE_ELEMENT, + _do_init); static void gst_amrwbenc_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GstElementDetails details = GST_ELEMENT_DETAILS ("AMR-WB audio encoder", + "Codec/Encoder/Audio", + "Adaptive Multi-Rate Wideband audio encoder", + "Renato Araujo <renato.filho@indt.org.br>"); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_template)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_template)); - gst_element_class_set_details (element_class, &gst_amrwbenc_details); + gst_element_class_set_details (element_class, &details); } static void @@ -81,11 +80,9 @@ gst_amrwbenc_class_init (GstAmrwbEncClass * klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - object_class->finalize = gst_amrwbenc_finalize; - element_class->change_state = gst_amrwbenc_state_change; + element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbenc_state_change); } static void diff --git a/ext/amrwb/gstamrwbparse.c b/ext/amrwb/gstamrwbparse.c index 615b6390..56be92a5 100644 --- a/ext/amrwb/gstamrwbparse.c +++ b/ext/amrwb/gstamrwbparse.c @@ -22,20 +22,8 @@ #endif #include <string.h> - #include "gstamrwbparse.h" - -GST_DEBUG_CATEGORY_STATIC (amrwbparse_debug); -#define GST_CAT_DEFAULT amrwbparse_debug - -static const GstElementDetails gst_amrwbparse_details = -GST_ELEMENT_DETAILS ("AMR-WB parser", - "Codec/Parser/Audio", - "Adaptive Multi-Rate WideBand audio parser", - "Renato Filho <renato.filho@indt.org.br>"); - - static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, @@ -49,6 +37,9 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("audio/x-amr-wb-sh") ); +GST_DEBUG_CATEGORY_STATIC (gst_amrwbparse_debug); +#define GST_CAT_DEFAULT gst_amrwbparse_debug + extern const UWord8 block_size[]; static void gst_amrwbparse_base_init (gpointer klass); @@ -67,20 +58,28 @@ static gboolean gst_amrwbparse_sink_activate_pull (GstPad * sinkpad, static GstStateChangeReturn gst_amrwbparse_state_change (GstElement * element, GstStateChange transition); -GST_BOILERPLATE (GstAmrwbParse, gst_amrwbparse, GstElement, GST_TYPE_ELEMENT); +#define _do_init(bla) \ + GST_DEBUG_CATEGORY_INIT (gst_amrwbparse_debug, "amrwbparse", 0, "AMR-WB audio stream parser"); + +GST_BOILERPLATE_FULL (GstAmrwbParse, gst_amrwbparse, GstElement, + GST_TYPE_ELEMENT, _do_init); static void gst_amrwbparse_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - - gst_element_class_set_details (element_class, &gst_amrwbparse_details); + GstElementDetails details = GST_ELEMENT_DETAILS ("AMR-WB audio stream parser", + "Codec/Parser/Audio", + "Adaptive Multi-Rate WideBand audio parser", + "Renato Filho <renato.filho@indt.org.br>"); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&sink_template)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&src_template)); + gst_element_class_set_details (element_class, &details); + } static void @@ -88,12 +87,7 @@ gst_amrwbparse_class_init (GstAmrwbParseClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); - - element_class->change_state = gst_amrwbparse_state_change; - - GST_DEBUG_CATEGORY_INIT (amrwbparse_debug, - "amrwbparse", 0, "AMR-WB stream parsing"); + element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbparse_state_change); } static void |