From 7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sun, 14 Mar 2004 22:34:33 +0000 Subject: gst-indent Original commit message from CVS: gst-indent --- ext/faac/gstfaac.c | 356 +++++++++++++++++++++++------------------------------ ext/faac/gstfaac.h | 23 ++-- 2 files changed, 160 insertions(+), 219 deletions(-) (limited to 'ext/faac') diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index 7f536275..2241014b 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -23,82 +23,50 @@ #include "gstfaac.h" -static GstStaticPadTemplate src_template = -GST_STATIC_PAD_TEMPLATE ( - "src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "audio/mpeg, " - "mpegversion = (int) { 4, 2 }, " - "channels = (int) [ 1, 6 ], " - "rate = (int) [ 8000, 96000 ]" - ) -); - -static GstStaticPadTemplate sink_template = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 8000, 96000 ], " - "channels = (int) [ 1, 6]; " - "audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 32, " - "depth = (int) 24, " - "rate = (int) [ 8000, 96000], " - "channels = (int) [ 1, 6]; " - "audio/x-raw-float, " - "endianness = (int) BYTE_ORDER, " - "depth = (int) 32, " /* sizeof (gfloat) */ - "rate = (int) [ 8000, 96000], " - "channels = (int) [ 1, 6]" - ) -); - -enum { +static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/mpeg, " + "mpegversion = (int) { 4, 2 }, " + "channels = (int) [ 1, 6 ], " "rate = (int) [ 8000, 96000 ]") + ); + +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 6]; " "audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 32, " "depth = (int) 24, " "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]; " "audio/x-raw-float, " "endianness = (int) BYTE_ORDER, " "depth = (int) 32, " /* sizeof (gfloat) */ + "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]") + ); + +enum +{ ARG_0, ARG_BITRATE, ARG_PROFILE, ARG_TNS, ARG_MIDSIDE, ARG_SHORTCTL - /* FILL ME */ + /* FILL ME */ }; -static void gst_faac_base_init (GstFaacClass *klass); -static void gst_faac_class_init (GstFaacClass *klass); -static void gst_faac_init (GstFaac *faac); +static void gst_faac_base_init (GstFaacClass * klass); +static void gst_faac_class_init (GstFaacClass * klass); +static void gst_faac_init (GstFaac * faac); -static void gst_faac_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gst_faac_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); +static void gst_faac_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec); +static void gst_faac_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec); static GstPadLinkReturn - gst_faac_sinkconnect (GstPad *pad, - const GstCaps *caps); +gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps); static GstPadLinkReturn - gst_faac_srcconnect (GstPad *pad, - const GstCaps *caps); -static void gst_faac_chain (GstPad *pad, - GstData *data); -static GstElementStateReturn - gst_faac_change_state (GstElement *element); +gst_faac_srcconnect (GstPad * pad, const GstCaps * caps); +static void gst_faac_chain (GstPad * pad, GstData * data); +static GstElementStateReturn gst_faac_change_state (GstElement * element); static GstElementClass *parent_class = NULL; + /* static guint gst_faac_signals[LAST_SIGNAL] = { 0 }; */ GType @@ -108,27 +76,26 @@ gst_faac_get_type (void) if (!gst_faac_type) { static const GTypeInfo gst_faac_info = { - sizeof (GstFaacClass), + sizeof (GstFaacClass), (GBaseInitFunc) gst_faac_base_init, NULL, (GClassInitFunc) gst_faac_class_init, NULL, NULL, - sizeof(GstFaac), + sizeof (GstFaac), 0, (GInstanceInitFunc) gst_faac_init, }; gst_faac_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstFaac", - &gst_faac_info, 0); + "GstFaac", &gst_faac_info, 0); } return gst_faac_type; } static void -gst_faac_base_init (GstFaacClass *klass) +gst_faac_base_init (GstFaacClass * klass) { GstElementDetails gst_faac_details = { "Free AAC Encoder (FAAC)", @@ -139,9 +106,9 @@ gst_faac_base_init (GstFaacClass *klass) GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&src_template)); + gst_static_pad_template_get (&src_template)); gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_template)); + gst_static_pad_template_get (&sink_template)); gst_element_class_set_details (element_class, &gst_faac_details); } @@ -154,15 +121,15 @@ gst_faac_profile_get_type (void) if (!gst_faac_profile_type) { static GEnumValue gst_faac_profile[] = { - { MAIN, "MAIN", "Main profile" }, - { LOW, "LOW", "Low complexity profile" }, - { SSR, "SSR", "Scalable sampling rate profile" }, - { LTP, "LTP", "Long term prediction profile" }, - { 0, NULL, NULL }, + {MAIN, "MAIN", "Main profile"}, + {LOW, "LOW", "Low complexity profile"}, + {SSR, "SSR", "Scalable sampling rate profile"}, + {LTP, "LTP", "Long term prediction profile"}, + {0, NULL, NULL}, }; gst_faac_profile_type = g_enum_register_static ("GstFaacProfile", - gst_faac_profile); + gst_faac_profile); } return gst_faac_profile_type; @@ -176,21 +143,21 @@ gst_faac_shortctl_get_type (void) if (!gst_faac_shortctl_type) { static GEnumValue gst_faac_shortctl[] = { - { SHORTCTL_NORMAL, "SHORTCTL_NORMAL", "Normal block type" }, - { SHORTCTL_NOSHORT, "SHORTCTL_NOSHORT", "No short blocks" }, - { SHORTCTL_NOLONG, "SHORTCTL_NOLONG", "No long blocks" }, - { 0, NULL, NULL }, + {SHORTCTL_NORMAL, "SHORTCTL_NORMAL", "Normal block type"}, + {SHORTCTL_NOSHORT, "SHORTCTL_NOSHORT", "No short blocks"}, + {SHORTCTL_NOLONG, "SHORTCTL_NOLONG", "No long blocks"}, + {0, NULL, NULL}, }; gst_faac_shortctl_type = g_enum_register_static ("GstFaacShortCtl", - gst_faac_shortctl); + gst_faac_shortctl); } return gst_faac_shortctl_type; } static void -gst_faac_class_init (GstFaacClass *klass) +gst_faac_class_init (GstFaacClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); @@ -199,21 +166,21 @@ gst_faac_class_init (GstFaacClass *klass) /* properties */ g_object_class_install_property (gobject_class, ARG_BITRATE, - g_param_spec_int ("bitrate", "Bitrate (bps)", "Bitrate in bits/sec", - 8 * 1024, 320 * 1024, 128 * 1024, G_PARAM_READWRITE)); + g_param_spec_int ("bitrate", "Bitrate (bps)", "Bitrate in bits/sec", + 8 * 1024, 320 * 1024, 128 * 1024, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PROFILE, - g_param_spec_enum ("profile", "Profile", "MPEG/AAC encoding profile", - GST_TYPE_FAAC_PROFILE, MAIN, G_PARAM_READWRITE)); + g_param_spec_enum ("profile", "Profile", "MPEG/AAC encoding profile", + GST_TYPE_FAAC_PROFILE, MAIN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_TNS, - g_param_spec_boolean ("tns", "TNS", "Use temporal noise shaping", - FALSE, G_PARAM_READWRITE)); + g_param_spec_boolean ("tns", "TNS", "Use temporal noise shaping", + FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_MIDSIDE, - g_param_spec_boolean ("midside", "Midside", "Allow mid/side encoding", - TRUE, G_PARAM_READWRITE)); + g_param_spec_boolean ("midside", "Midside", "Allow mid/side encoding", + TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_SHORTCTL, - g_param_spec_enum ("shortctl", "Block type", - "Block type encorcing", - GST_TYPE_FAAC_SHORTCTL, MAIN, G_PARAM_READWRITE)); + g_param_spec_enum ("shortctl", "Block type", + "Block type encorcing", + GST_TYPE_FAAC_SHORTCTL, MAIN, G_PARAM_READWRITE)); /* virtual functions */ gstelement_class->change_state = gst_faac_change_state; @@ -223,7 +190,7 @@ gst_faac_class_init (GstFaacClass *klass) } static void -gst_faac_init (GstFaac *faac) +gst_faac_init (GstFaac * faac) { faac->handle = NULL; faac->samplerate = -1; @@ -234,14 +201,16 @@ gst_faac_init (GstFaac *faac) GST_FLAG_SET (faac, GST_ELEMENT_EVENT_AWARE); - faac->sinkpad = gst_pad_new_from_template ( - gst_static_pad_template_get (&sink_template), "sink"); + faac->sinkpad = + gst_pad_new_from_template (gst_static_pad_template_get (&sink_template), + "sink"); gst_element_add_pad (GST_ELEMENT (faac), faac->sinkpad); gst_pad_set_chain_function (faac->sinkpad, gst_faac_chain); gst_pad_set_link_function (faac->sinkpad, gst_faac_sinkconnect); - faac->srcpad = gst_pad_new_from_template ( - gst_static_pad_template_get (&src_template), "src"); + faac->srcpad = + gst_pad_new_from_template (gst_static_pad_template_get (&src_template), + "src"); gst_element_add_pad (GST_ELEMENT (faac), faac->srcpad); gst_pad_set_link_function (faac->srcpad, gst_faac_srcconnect); @@ -254,8 +223,7 @@ gst_faac_init (GstFaac *faac) } static GstPadLinkReturn -gst_faac_sinkconnect (GstPad *pad, - const GstCaps *caps) +gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps) { GstFaac *faac = GST_FAAC (gst_pad_get_parent (pad)); GstStructure *structure = gst_caps_get_structure (caps, 0); @@ -280,8 +248,7 @@ gst_faac_sinkconnect (GstPad *pad, gst_structure_get_int (structure, "depth", &depth); /* open a new handle to the encoder */ - if (!(handle = faacEncOpen (samplerate, channels, - &samples, &bytes))) + if (!(handle = faacEncOpen (samplerate, channels, &samples, &bytes))) return GST_PAD_LINK_REFUSED; switch (depth) { @@ -290,11 +257,11 @@ gst_faac_sinkconnect (GstPad *pad, bps = 2; break; case 24: - fmt = FAAC_INPUT_32BIT; /* 24-in-32, actually */ + fmt = FAAC_INPUT_32BIT; /* 24-in-32, actually */ bps = 4; break; case 32: - fmt = FAAC_INPUT_FLOAT; /* see template, this is right */ + fmt = FAAC_INPUT_FLOAT; /* see template, this is right */ bps = 4; break; } @@ -315,27 +282,26 @@ gst_faac_sinkconnect (GstPad *pad, /* if the other side was already set-up, redo that */ if (GST_PAD_CAPS (faac->srcpad)) return gst_faac_srcconnect (faac->srcpad, - gst_pad_get_allowed_caps (faac->srcpad)); + gst_pad_get_allowed_caps (faac->srcpad)); /* else, that'll be done later */ return GST_PAD_LINK_OK; } static GstPadLinkReturn -gst_faac_srcconnect (GstPad *pad, - const GstCaps *caps) +gst_faac_srcconnect (GstPad * pad, const GstCaps * caps) { GstFaac *faac = GST_FAAC (gst_pad_get_parent (pad)); gint n; - if (!faac->handle || - (faac->samplerate == -1 || faac->channels == -1)) { + if (!faac->handle || (faac->samplerate == -1 || faac->channels == -1)) { return GST_PAD_LINK_DELAYED; } /* we do samplerate/channels ourselves */ for (n = 0; n < gst_caps_get_size (caps); n++) { GstStructure *structure = gst_caps_get_structure (caps, n); + gst_structure_remove_field (structure, "rate"); gst_structure_remove_field (structure, "channels"); } @@ -369,7 +335,7 @@ gst_faac_srcconnect (GstPad *pad, * that (that the next element is filesink or any element * that does want ADTS headers). */ - conf->outputFormat = 0; /* raw, no ADTS headers */ + conf->outputFormat = 0; /* raw, no ADTS headers */ conf->shortctl = faac->shortctl; if (!faacEncSetConfiguration (faac->handle, conf)) { GST_WARNING ("Faac doesn't support the current conf"); @@ -377,20 +343,19 @@ gst_faac_srcconnect (GstPad *pad, } newcaps = gst_caps_new_simple ("audio/mpeg", - "mpegversion", G_TYPE_INT, mpegversion, - "channels", G_TYPE_INT, faac->channels, - "rate", G_TYPE_INT, faac->samplerate, - NULL); + "mpegversion", G_TYPE_INT, mpegversion, + "channels", G_TYPE_INT, faac->channels, + "rate", G_TYPE_INT, faac->samplerate, NULL); ret = gst_pad_try_set_caps (faac->srcpad, newcaps); switch (ret) { case GST_PAD_LINK_OK: case GST_PAD_LINK_DONE: - return GST_PAD_LINK_DONE; + return GST_PAD_LINK_DONE; case GST_PAD_LINK_DELAYED: - return GST_PAD_LINK_DELAYED; + return GST_PAD_LINK_DELAYED; default: - break; + break; } } @@ -398,8 +363,7 @@ gst_faac_srcconnect (GstPad *pad, } static void -gst_faac_chain (GstPad *pad, - GstData *data) +gst_faac_chain (GstPad * pad, GstData * data) { GstFaac *faac = GST_FAAC (gst_pad_get_parent (pad)); GstBuffer *inbuf, *outbuf, *subbuf; @@ -410,35 +374,33 @@ gst_faac_chain (GstPad *pad, switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: - /* flush first */ - while (1) { - outbuf = gst_buffer_new_and_alloc (faac->bytes); - if ((ret_size = faacEncEncode (faac->handle, - NULL, 0, - GST_BUFFER_DATA (outbuf), - faac->bytes)) < 0) { - GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); - gst_event_unref (event); - gst_buffer_unref (outbuf); - return; - } - - if (ret_size > 0) { - GST_BUFFER_SIZE (outbuf) = ret_size; - GST_BUFFER_TIMESTAMP (outbuf) = 0; - GST_BUFFER_DURATION (outbuf) = 0; - gst_pad_push (faac->srcpad, GST_DATA (outbuf)); - } else { - break; - } - } - - gst_element_set_eos (GST_ELEMENT (faac)); - gst_pad_push (faac->srcpad, data); - return; + /* flush first */ + while (1) { + outbuf = gst_buffer_new_and_alloc (faac->bytes); + if ((ret_size = faacEncEncode (faac->handle, + NULL, 0, GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { + GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); + gst_event_unref (event); + gst_buffer_unref (outbuf); + return; + } + + if (ret_size > 0) { + GST_BUFFER_SIZE (outbuf) = ret_size; + GST_BUFFER_TIMESTAMP (outbuf) = 0; + GST_BUFFER_DURATION (outbuf) = 0; + gst_pad_push (faac->srcpad, GST_DATA (outbuf)); + } else { + break; + } + } + + gst_element_set_eos (GST_ELEMENT (faac)); + gst_pad_push (faac->srcpad, data); + return; default: gst_pad_event_default (pad, event); - return; + return; } } @@ -446,16 +408,16 @@ gst_faac_chain (GstPad *pad, if (!faac->handle) { GST_ELEMENT_ERROR (faac, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_buffer_unref (inbuf); return; } if (!GST_PAD_CAPS (faac->srcpad)) { if (gst_faac_srcconnect (faac->srcpad, - gst_pad_get_allowed_caps (faac->srcpad)) <= 0) { + gst_pad_get_allowed_caps (faac->srcpad)) <= 0) { GST_ELEMENT_ERROR (faac, CORE, NEGOTIATION, (NULL), - ("failed to negotiate MPEG/AAC format with next element")); + ("failed to negotiate MPEG/AAC format with next element")); gst_buffer_unref (inbuf); return; } @@ -472,38 +434,39 @@ gst_faac_chain (GstPad *pad, if (in_size / faac->bps < faac->samples) { if (in_size > size) { GstBuffer *merge; - /* this is panic! we got a buffer, but still don't have enough - * data. Merge them and retry in the next cycle... */ - merge = gst_buffer_merge (faac->cache, inbuf); + + /* this is panic! we got a buffer, but still don't have enough + * data. Merge them and retry in the next cycle... */ + merge = gst_buffer_merge (faac->cache, inbuf); gst_buffer_unref (faac->cache); gst_buffer_unref (inbuf); faac->cache = merge; } else if (in_size == size) { - /* this shouldn't happen, but still... */ - faac->cache = inbuf; + /* this shouldn't happen, but still... */ + faac->cache = inbuf; } else if (in_size > 0) { - faac->cache = gst_buffer_create_sub (inbuf, size - in_size, - in_size); - GST_BUFFER_DURATION (faac->cache) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (faac->cache) / size; - GST_BUFFER_TIMESTAMP (faac->cache) = - GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * + faac->cache = gst_buffer_create_sub (inbuf, size - in_size, in_size); + GST_BUFFER_DURATION (faac->cache) = + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (faac->cache) / size; + GST_BUFFER_TIMESTAMP (faac->cache) = + GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * (size - in_size) / size); - gst_buffer_unref (inbuf); + gst_buffer_unref (inbuf); } else { - gst_buffer_unref (inbuf); + gst_buffer_unref (inbuf); } - + return; } /* create the frame */ if (in_size > size) { GstBuffer *merge; + /* merge */ subbuf = gst_buffer_create_sub (inbuf, 0, frame_size - (in_size - size)); GST_BUFFER_DURATION (subbuf) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; merge = gst_buffer_merge (faac->cache, subbuf); gst_buffer_unref (faac->cache); gst_buffer_unref (subbuf); @@ -512,18 +475,17 @@ gst_faac_chain (GstPad *pad, } else { subbuf = gst_buffer_create_sub (inbuf, size - in_size, frame_size); GST_BUFFER_DURATION (subbuf) = - GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; + GST_BUFFER_DURATION (inbuf) * GST_BUFFER_SIZE (subbuf) / size; GST_BUFFER_TIMESTAMP (subbuf) = - GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * + GST_BUFFER_TIMESTAMP (inbuf) + (GST_BUFFER_DURATION (inbuf) * (size - in_size) / size); } outbuf = gst_buffer_new_and_alloc (faac->bytes); if ((ret_size = faacEncEncode (faac->handle, - (gint32 *) GST_BUFFER_DATA (subbuf), - GST_BUFFER_SIZE (subbuf) / faac->bps, - GST_BUFFER_DATA (outbuf), - faac->bytes)) < 0) { + (gint32 *) GST_BUFFER_DATA (subbuf), + GST_BUFFER_SIZE (subbuf) / faac->bps, + GST_BUFFER_DATA (outbuf), faac->bytes)) < 0) { GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); gst_buffer_unref (inbuf); gst_buffer_unref (subbuf); @@ -533,14 +495,14 @@ gst_faac_chain (GstPad *pad, if (ret_size > 0) { GST_BUFFER_SIZE (outbuf) = ret_size; if (faac->cache_time != GST_CLOCK_TIME_NONE) { - GST_BUFFER_TIMESTAMP (outbuf) = faac->cache_time; - faac->cache_time = GST_CLOCK_TIME_NONE; + GST_BUFFER_TIMESTAMP (outbuf) = faac->cache_time; + faac->cache_time = GST_CLOCK_TIME_NONE; } else - GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (subbuf); + GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (subbuf); GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (subbuf); if (faac->cache_duration) { - GST_BUFFER_DURATION (outbuf) += faac->cache_duration; - faac->cache_duration = 0; + GST_BUFFER_DURATION (outbuf) += faac->cache_duration; + faac->cache_duration = 0; } gst_pad_push (faac->srcpad, GST_DATA (outbuf)); } else { @@ -554,7 +516,7 @@ gst_faac_chain (GstPad *pad, gst_buffer_unref (outbuf); if (faac->cache_time != GST_CLOCK_TIME_NONE) - faac->cache_time = GST_BUFFER_TIMESTAMP (subbuf); + faac->cache_time = GST_BUFFER_TIMESTAMP (subbuf); faac->cache_duration += GST_BUFFER_DURATION (subbuf); } @@ -564,10 +526,8 @@ gst_faac_chain (GstPad *pad, } static void -gst_faac_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) +gst_faac_set_property (GObject * object, + guint prop_id, const GValue * value, GParamSpec * pspec) { GstFaac *faac = GST_FAAC (object); @@ -594,10 +554,8 @@ gst_faac_set_property (GObject *object, } static void -gst_faac_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) +gst_faac_get_property (GObject * object, + guint prop_id, GValue * value, GParamSpec * pspec) { GstFaac *faac = GST_FAAC (object); @@ -624,19 +582,19 @@ gst_faac_get_property (GObject *object, } static GstElementStateReturn -gst_faac_change_state (GstElement *element) +gst_faac_change_state (GstElement * element) { GstFaac *faac = GST_FAAC (element); switch (GST_STATE_TRANSITION (element)) { case GST_STATE_PAUSED_TO_READY: if (faac->handle) { - faacEncClose (faac->handle); - faac->handle = NULL; + faacEncClose (faac->handle); + faac->handle = NULL; } if (faac->cache) { - gst_buffer_unref (faac->cache); - faac->cache = NULL; + gst_buffer_unref (faac->cache); + faac->cache = NULL; } faac->cache_time = GST_CLOCK_TIME_NONE; faac->cache_duration = 0; @@ -654,21 +612,13 @@ gst_faac_change_state (GstElement *element) } static gboolean -plugin_init (GstPlugin *plugin) +plugin_init (GstPlugin * plugin) { - return gst_element_register (plugin, "faac", - GST_RANK_NONE, - GST_TYPE_FAAC); + return gst_element_register (plugin, "faac", GST_RANK_NONE, GST_TYPE_FAAC); } -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "faac", - "Free AAC Encoder (FAAC)", - plugin_init, - VERSION, - "LGPL", - GST_PACKAGE, - GST_ORIGIN -) +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "faac", + "Free AAC Encoder (FAAC)", + plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN) diff --git a/ext/faac/gstfaac.h b/ext/faac/gstfaac.h index 55daea67..b888ed34 100644 --- a/ext/faac/gstfaac.h +++ b/ext/faac/gstfaac.h @@ -24,7 +24,6 @@ #include G_BEGIN_DECLS - #define GST_TYPE_FAAC \ (gst_faac_get_type ()) #define GST_FAAC(obj) \ @@ -35,25 +34,17 @@ G_BEGIN_DECLS (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAC)) #define GST_IS_FAAC_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAC)) - -typedef struct _GstFaac { + typedef struct _GstFaac +{ GstElement element; /* pads */ GstPad *srcpad, *sinkpad; /* stream properties */ - gint samplerate, - channels, - format, - bps, - bitrate, - profile, - shortctl; - gboolean tns, - midside; - gulong bytes, - samples; + gint samplerate, channels, format, bps, bitrate, profile, shortctl; + gboolean tns, midside; + gulong bytes, samples; /* FAAC object */ faacEncHandle handle; @@ -63,12 +54,12 @@ typedef struct _GstFaac { guint64 cache_time, cache_duration; } GstFaac; -typedef struct _GstFaacClass { +typedef struct _GstFaacClass +{ GstElementClass parent_class; } GstFaacClass; GType gst_faac_get_type (void); G_END_DECLS - #endif /* __GST_FAAC_H__ */ -- cgit v1.2.1