diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
commit | 4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 (patch) | |
tree | 8f41b30e571aa6ed88b53f5471d5e38461136e60 /ext/faac | |
parent | 9f4226fe55f09cf5809376b467aa3f46dbf7b5c2 (diff) | |
download | gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.gz gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.bz2 gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.zip |
don't mix tabs and spaces
Original commit message from CVS:
don't mix tabs and spaces
Diffstat (limited to 'ext/faac')
-rw-r--r-- | ext/faac/gstfaac.c | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index 2241014b..cc66fd97 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -27,15 +27,15 @@ 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 ]") + "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]") + 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 @@ -88,7 +88,7 @@ gst_faac_get_type (void) }; gst_faac_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstFaac", &gst_faac_info, 0); + "GstFaac", &gst_faac_info, 0); } return gst_faac_type; @@ -129,7 +129,7 @@ gst_faac_profile_get_type (void) }; gst_faac_profile_type = g_enum_register_static ("GstFaacProfile", - gst_faac_profile); + gst_faac_profile); } return gst_faac_profile_type; @@ -150,7 +150,7 @@ gst_faac_shortctl_get_type (void) }; gst_faac_shortctl_type = g_enum_register_static ("GstFaacShortCtl", - gst_faac_shortctl); + gst_faac_shortctl); } return gst_faac_shortctl_type; @@ -167,20 +167,20 @@ 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)); + 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)); + 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)); + 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)); + 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)); + "Block type encorcing", + GST_TYPE_FAAC_SHORTCTL, MAIN, G_PARAM_READWRITE)); /* virtual functions */ gstelement_class->change_state = gst_faac_change_state; @@ -257,11 +257,11 @@ gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps) 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; } @@ -282,7 +282,7 @@ gst_faac_sinkconnect (GstPad * pad, const GstCaps * caps) /* 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; @@ -335,7 +335,7 @@ gst_faac_srcconnect (GstPad * pad, const GstCaps * caps) * 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"); @@ -343,19 +343,19 @@ gst_faac_srcconnect (GstPad * pad, const GstCaps * caps) } 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; } } @@ -374,33 +374,33 @@ gst_faac_chain (GstPad * pad, GstData * data) 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; + gst_pad_event_default (pad, event); + return; } } @@ -408,16 +408,16 @@ gst_faac_chain (GstPad * pad, GstData * data) 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; } @@ -433,27 +433,27 @@ gst_faac_chain (GstPad * pad, GstData * data) /* do we have enough data for one frame? */ 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); - gst_buffer_unref (faac->cache); - gst_buffer_unref (inbuf); - faac->cache = merge; + 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); + 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) * - (size - in_size) / size); - gst_buffer_unref (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); } else { - gst_buffer_unref (inbuf); + gst_buffer_unref (inbuf); } return; @@ -466,7 +466,7 @@ gst_faac_chain (GstPad * pad, GstData * data) /* 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); @@ -475,17 +475,17 @@ gst_faac_chain (GstPad * pad, GstData * data) } 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) * - (size - in_size) / size); + 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); @@ -495,14 +495,14 @@ gst_faac_chain (GstPad * pad, GstData * data) 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 { @@ -516,7 +516,7 @@ gst_faac_chain (GstPad * pad, GstData * data) 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); } @@ -589,12 +589,12 @@ gst_faac_change_state (GstElement * 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; |