1 /* GStreamer FAAC (Free AAC Encoder) plugin
2 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3 * Copyright (C) 2009 Mark Nauwelaerts <mnauw@users.sourceforge.net>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
22 * SECTION:element-faac
26 * faac encodes raw audio to AAC (MPEG-4 part 3) streams.
28 * ## Example launch line
30 * gst-launch-1.0 audiotestsrc wave=sine num-buffers=100 ! audioconvert ! faac ! matroskamux ! filesink location=sine.mkv
31 * ]| Encode a sine beep as aac and write to matroska container.
41 #include <gst/audio/audio.h>
42 #include <gst/pbutils/codec-utils.h>
46 #define SAMPLE_RATES " 8000, " \
59 /* these don't seem to work? */
62 "endianness = (int) BYTE_ORDER, "
63 "signed = (boolean) true, "
65 "depth = (int) { 24, 32 }, "
66 "rate = (int) [ 8000, 96000], "
67 "channels = (int) [ 1, 6]; "
69 "endianness = (int) BYTE_ORDER, "
71 "rate = (int) [ 8000, 96000], " "channels = (int) [ 1, 6]"
75 "mpegversion = (int) 4, " \
76 "channels = (int) [ 1, 6 ], " \
77 "rate = (int) {" SAMPLE_RATES "}, " \
78 "stream-format = (string) { adts, raw }, " \
79 "base-profile = (string) { main, lc, ssr, ltp }, " \
80 "framed = (boolean) true; " \
82 "mpegversion = (int) 2, " \
83 "channels = (int) [ 1, 6 ], " \
84 "rate = (int) {" SAMPLE_RATES "}, " \
85 "stream-format = (string) { adts, raw }, " \
86 "profile = (string) { main, lc }," \
87 "framed = (boolean) true; "
88 static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
91 GST_STATIC_CAPS (SRC_CAPS));
111 static void gst_faac_set_property (GObject * object,
112 guint prop_id, const GValue * value, GParamSpec * pspec);
113 static void gst_faac_get_property (GObject * object,
114 guint prop_id, GValue * value, GParamSpec * pspec);
116 static GstCaps *gst_faac_enc_generate_sink_caps (void);
117 static gboolean gst_faac_configure_source_pad (GstFaac * faac,
118 GstAudioInfo * info);
120 static gboolean gst_faac_stop (GstAudioEncoder * enc);
121 static gboolean gst_faac_set_format (GstAudioEncoder * enc,
122 GstAudioInfo * info);
123 static GstFlowReturn gst_faac_handle_frame (GstAudioEncoder * enc,
126 GST_DEBUG_CATEGORY_STATIC (faac_debug);
127 #define GST_CAT_DEFAULT faac_debug
129 #define FAAC_DEFAULT_QUALITY 100
130 #define FAAC_DEFAULT_BITRATE 128 * 1000
131 #define FAAC_DEFAULT_RATE_CONTROL VBR
132 #define FAAC_DEFAULT_TNS FALSE
133 #define FAAC_DEFAULT_MIDSIDE TRUE
134 #define FAAC_DEFAULT_SHORTCTL SHORTCTL_NORMAL
136 #define gst_faac_parent_class parent_class
137 G_DEFINE_TYPE (GstFaac, gst_faac, GST_TYPE_AUDIO_ENCODER);
138 GST_ELEMENT_REGISTER_DEFINE (faac, "faac", GST_RANK_SECONDARY, GST_TYPE_FAAC);
140 #define GST_TYPE_FAAC_RATE_CONTROL (gst_faac_brtype_get_type ())
142 gst_faac_brtype_get_type (void)
144 static GType gst_faac_brtype_type = 0;
146 if (!gst_faac_brtype_type) {
147 static const GEnumValue gst_faac_brtype[] = {
148 {VBR, "VBR", "VBR encoding"},
149 {ABR, "ABR", "ABR encoding"},
153 gst_faac_brtype_type = g_enum_register_static ("GstFaacBrtype",
157 return gst_faac_brtype_type;
160 #define GST_TYPE_FAAC_SHORTCTL (gst_faac_shortctl_get_type ())
162 gst_faac_shortctl_get_type (void)
164 static GType gst_faac_shortctl_type = 0;
166 if (!gst_faac_shortctl_type) {
167 static const GEnumValue gst_faac_shortctl[] = {
168 {SHORTCTL_NORMAL, "SHORTCTL_NORMAL", "Normal block type"},
169 {SHORTCTL_NOSHORT, "SHORTCTL_NOSHORT", "No short blocks"},
170 {SHORTCTL_NOLONG, "SHORTCTL_NOLONG", "No long blocks"},
174 gst_faac_shortctl_type = g_enum_register_static ("GstFaacShortCtl",
178 return gst_faac_shortctl_type;
182 gst_faac_class_init (GstFaacClass * klass)
184 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
185 GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
186 GstAudioEncoderClass *base_class = GST_AUDIO_ENCODER_CLASS (klass);
188 GstPadTemplate *sink_templ;
190 gobject_class->set_property = gst_faac_set_property;
191 gobject_class->get_property = gst_faac_get_property;
193 GST_DEBUG_CATEGORY_INIT (faac_debug, "faac", 0, "AAC encoding");
195 gst_element_class_add_static_pad_template (gstelement_class, &src_template);
197 sink_caps = gst_faac_enc_generate_sink_caps ();
198 sink_templ = gst_pad_template_new ("sink",
199 GST_PAD_SINK, GST_PAD_ALWAYS, sink_caps);
200 gst_element_class_add_pad_template (gstelement_class, sink_templ);
201 gst_caps_unref (sink_caps);
203 gst_element_class_set_static_metadata (gstelement_class, "AAC audio encoder",
204 "Codec/Encoder/Audio",
205 "Free MPEG-2/4 AAC encoder",
206 "Ronald Bultje <rbultje@ronald.bitfreak.net>");
208 gst_type_mark_as_plugin_api (GST_TYPE_FAAC_RATE_CONTROL, 0);
209 gst_type_mark_as_plugin_api (GST_TYPE_FAAC_SHORTCTL, 0);
211 base_class->stop = GST_DEBUG_FUNCPTR (gst_faac_stop);
212 base_class->set_format = GST_DEBUG_FUNCPTR (gst_faac_set_format);
213 base_class->handle_frame = GST_DEBUG_FUNCPTR (gst_faac_handle_frame);
216 g_object_class_install_property (gobject_class, PROP_QUALITY,
217 g_param_spec_int ("quality", "Quality (%)",
218 "Variable bitrate (VBR) quantizer quality in %", 1, 1000,
219 FAAC_DEFAULT_QUALITY,
220 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
221 g_object_class_install_property (gobject_class, PROP_BITRATE,
222 g_param_spec_int ("bitrate", "Bitrate (bps)",
223 "Average Bitrate (ABR) in bits/sec", 8 * 1000, 320 * 1000,
224 FAAC_DEFAULT_BITRATE,
225 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
226 g_object_class_install_property (gobject_class, PROP_RATE_CONTROL,
227 g_param_spec_enum ("rate-control", "Rate Control (ABR/VBR)",
228 "Encoding bitrate type (VBR/ABR)", GST_TYPE_FAAC_RATE_CONTROL,
229 FAAC_DEFAULT_RATE_CONTROL,
230 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
231 g_object_class_install_property (gobject_class, PROP_TNS,
232 g_param_spec_boolean ("tns", "TNS", "Use temporal noise shaping",
234 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
235 g_object_class_install_property (gobject_class, PROP_MIDSIDE,
236 g_param_spec_boolean ("midside", "Midside", "Allow mid/side encoding",
237 FAAC_DEFAULT_MIDSIDE,
238 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
239 g_object_class_install_property (gobject_class, PROP_SHORTCTL,
240 g_param_spec_enum ("shortctl", "Block type",
241 "Block type encorcing",
242 GST_TYPE_FAAC_SHORTCTL, FAAC_DEFAULT_SHORTCTL,
243 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
247 gst_faac_init (GstFaac * faac)
249 GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (faac));
253 gst_faac_close_encoder (GstFaac * faac)
256 faacEncClose (faac->handle);
261 gst_faac_stop (GstAudioEncoder * enc)
263 GstFaac *faac = GST_FAAC (enc);
265 GST_DEBUG_OBJECT (faac, "stop");
266 gst_faac_close_encoder (faac);
270 static const GstAudioChannelPosition aac_channel_positions[][8] = {
271 {GST_AUDIO_CHANNEL_POSITION_MONO},
272 {GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
273 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT},
275 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
276 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
277 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
280 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
281 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
282 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
283 GST_AUDIO_CHANNEL_POSITION_REAR_CENTER},
285 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
286 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
287 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
288 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
289 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT},
291 GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
292 GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
293 GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
294 GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
295 GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
296 GST_AUDIO_CHANNEL_POSITION_LFE1}
300 gst_faac_enc_generate_sink_caps (void)
302 GstCaps *caps = gst_caps_new_empty ();
305 static const int rates[] = {
306 8000, 11025, 12000, 16000, 22050, 24000,
307 32000, 44100, 48000, 64000, 88200, 96000
309 GValue rates_arr = { 0, };
310 GValue tmp_v = { 0, };
312 g_value_init (&rates_arr, GST_TYPE_LIST);
313 g_value_init (&tmp_v, G_TYPE_INT);
314 for (i = 0; i < G_N_ELEMENTS (rates); i++) {
315 g_value_set_int (&tmp_v, rates[i]);
316 gst_value_list_append_value (&rates_arr, &tmp_v);
318 g_value_unset (&tmp_v);
320 s = gst_structure_new ("audio/x-raw",
321 "format", G_TYPE_STRING, GST_AUDIO_NE (S16),
322 "layout", G_TYPE_STRING, "interleaved", NULL);
323 gst_structure_set_value (s, "rate", &rates_arr);
325 t = gst_structure_copy (s);
326 gst_structure_set (t, "channels", G_TYPE_INT, 1, NULL);
327 gst_caps_append_structure (caps, t);
329 for (i = 2; i <= 6; i++) {
330 guint64 channel_mask = 0;
331 t = gst_structure_copy (s);
333 gst_structure_set (t, "channels", G_TYPE_INT, i, NULL);
334 for (c = 0; c < i; c++)
335 channel_mask |= G_GUINT64_CONSTANT (1) << aac_channel_positions[i - 1][c];
337 gst_structure_set (t, "channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
338 gst_caps_append_structure (caps, t);
340 gst_structure_free (s);
341 g_value_unset (&rates_arr);
343 GST_DEBUG ("Generated sinkcaps: %" GST_PTR_FORMAT, caps);
348 gst_faac_set_tags (GstFaac * faac)
352 /* create a taglist and add a bitrate tag to it */
353 taglist = gst_tag_list_new_empty ();
354 gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE,
355 GST_TAG_BITRATE, faac->bitrate, NULL);
357 gst_audio_encoder_merge_tags (GST_AUDIO_ENCODER (faac), taglist,
358 GST_TAG_MERGE_REPLACE);
360 gst_tag_list_unref (taglist);
364 gst_faac_set_format (GstAudioEncoder * enc, GstAudioInfo * info)
366 GstFaac *faac = GST_FAAC (enc);
369 gboolean result = FALSE;
371 /* base class takes care */
372 width = GST_AUDIO_INFO_WIDTH (info);
374 if (GST_AUDIO_INFO_IS_INTEGER (info)) {
377 fmt = FAAC_INPUT_16BIT;
381 fmt = FAAC_INPUT_32BIT;
384 g_return_val_if_reached (FALSE);
387 fmt = FAAC_INPUT_FLOAT;
393 result = gst_faac_configure_source_pad (faac, info);
397 gst_faac_set_tags (faac);
399 /* report needs to base class */
400 gst_audio_encoder_set_frame_samples_min (enc, faac->samples);
401 gst_audio_encoder_set_frame_samples_max (enc, faac->samples);
402 gst_audio_encoder_set_frame_max (enc, 1);
408 /* check downstream caps to configure format */
410 gst_faac_negotiate (GstFaac * faac)
416 faac->mpegversion = 4;
417 faac->outputformat = 0;
419 caps = gst_pad_get_allowed_caps (GST_AUDIO_ENCODER_SRC_PAD (faac));
421 GST_DEBUG_OBJECT (faac, "allowed caps: %" GST_PTR_FORMAT, caps);
423 if (caps && gst_caps_get_size (caps) > 0) {
424 GstStructure *s = gst_caps_get_structure (caps, 0);
425 const gchar *str = NULL;
428 if ((str = gst_structure_get_string (s, "stream-format"))) {
429 if (strcmp (str, "adts") == 0) {
430 GST_DEBUG_OBJECT (faac, "use ADTS format for output");
431 faac->outputformat = 1;
432 } else if (strcmp (str, "raw") == 0) {
433 GST_DEBUG_OBJECT (faac, "use RAW format for output");
434 faac->outputformat = 0;
436 GST_DEBUG_OBJECT (faac, "unknown stream-format: %s", str);
437 faac->outputformat = 0;
441 if ((str = gst_structure_get_string (s, "profile"))) {
442 if (strcmp (str, "main") == 0) {
443 faac->profile = MAIN;
444 } else if (strcmp (str, "lc") == 0) {
446 } else if (strcmp (str, "ssr") == 0) {
448 } else if (strcmp (str, "ltp") == 0) {
455 if (!gst_structure_get_int (s, "mpegversion", &i) || i == 4) {
456 faac->mpegversion = 4;
458 faac->mpegversion = 2;
463 gst_caps_unref (caps);
467 gst_faac_open_encoder (GstFaac * faac, GstAudioInfo * info)
469 faacEncHandle *handle;
470 faacEncConfiguration *conf;
472 gulong samples, bytes;
474 g_return_val_if_fail (info->rate != 0 && info->channels != 0, FALSE);
476 /* clean up in case of re-configure */
477 gst_faac_close_encoder (faac);
479 if (!(handle = faacEncOpen (info->rate, info->channels, &samples, &bytes)))
482 /* mind channel count */
483 samples /= info->channels;
486 faac->handle = handle;
487 faac->samples = samples;
490 GST_DEBUG_OBJECT (faac, "faac needs samples %d, output size %d",
491 faac->samples, faac->bytes);
493 /* we negotiated caps update current configuration */
494 conf = faacEncGetCurrentConfiguration (faac->handle);
495 conf->mpegVersion = (faac->mpegversion == 4) ? MPEG4 : MPEG2;
496 conf->aacObjectType = faac->profile;
497 conf->allowMidside = faac->midside;
499 conf->useTns = faac->tns;
501 if (faac->brtype == VBR) {
502 conf->quantqual = faac->quality;
503 } else if (faac->brtype == ABR) {
504 conf->bitRate = faac->bitrate / info->channels;
507 conf->inputFormat = faac->format;
508 conf->outputFormat = faac->outputformat;
509 conf->shortctl = faac->shortctl;
511 /* check, warn and correct if the max bitrate for the given samplerate is
512 * exceeded. Maximum of 6144 bit for a channel */
514 (unsigned int) (6144.0 * (double) info->rate / (double) 1024.0 + .5);
515 if (conf->bitRate > maxbitrate) {
516 GST_ELEMENT_WARNING (faac, RESOURCE, SETTINGS, (NULL),
517 ("bitrate %lu exceeds maximum allowed bitrate of %u for samplerate %d. "
518 "Setting bitrate to %u", conf->bitRate, maxbitrate,
519 info->rate, maxbitrate));
520 conf->bitRate = maxbitrate;
523 /* default 0 to start with, libfaac chooses based on bitrate */
526 if (!faacEncSetConfiguration (faac->handle, conf))
529 /* let's see what really happened,
530 * note that this may not really match desired rate */
531 GST_DEBUG_OBJECT (faac, "average bitrate: %lu kbps",
532 (conf->bitRate + 500) / 1000 * info->channels);
533 GST_DEBUG_OBJECT (faac, "quantization quality: %ld", conf->quantqual);
534 GST_DEBUG_OBJECT (faac, "bandwidth: %d Hz", conf->bandWidth);
541 GST_ELEMENT_ERROR (faac, LIBRARY, SETTINGS, (NULL), (NULL));
547 gst_faac_configure_source_pad (GstFaac * faac, GstAudioInfo * info)
552 /* negotiate stream format */
553 gst_faac_negotiate (faac);
555 if (!gst_faac_open_encoder (faac, info))
558 /* now create a caps for it all */
559 srccaps = gst_caps_new_simple ("audio/mpeg",
560 "mpegversion", G_TYPE_INT, faac->mpegversion,
561 "channels", G_TYPE_INT, info->channels,
562 "rate", G_TYPE_INT, info->rate,
563 "stream-format", G_TYPE_STRING, (faac->outputformat ? "adts" : "raw"),
564 "framed", G_TYPE_BOOLEAN, TRUE, NULL);
566 /* DecoderSpecificInfo is only available for mpegversion=4 */
567 if (faac->mpegversion == 4) {
568 guint8 *config = NULL;
569 gulong config_len = 0;
571 /* get the config string */
572 GST_DEBUG_OBJECT (faac, "retrieving decoder info");
573 faacEncGetDecoderSpecificInfo (faac->handle, &config, &config_len);
575 if (!gst_codec_utils_aac_caps_set_level_and_profile (srccaps, config,
578 gst_caps_unref (srccaps);
579 goto invalid_codec_data;
582 if (!faac->outputformat) {
583 GstBuffer *codec_data;
585 /* copy it into a buffer */
586 codec_data = gst_buffer_new_and_alloc (config_len);
587 gst_buffer_fill (codec_data, 0, config, config_len);
590 gst_caps_set_simple (srccaps,
591 "codec_data", GST_TYPE_BUFFER, codec_data, NULL);
593 gst_buffer_unref (codec_data);
598 const gchar *profile;
600 /* Add least add the profile to the caps */
601 switch (faac->profile) {
616 gst_caps_set_simple (srccaps, "profile", G_TYPE_STRING, profile, NULL);
617 /* FIXME: How to get the profile for mpegversion==2? */
620 GST_DEBUG_OBJECT (faac, "src pad caps: %" GST_PTR_FORMAT, srccaps);
622 ret = gst_audio_encoder_set_output_format (GST_AUDIO_ENCODER (faac), srccaps);
623 gst_caps_unref (srccaps);
630 GST_WARNING_OBJECT (faac, "Faac doesn't support the current configuration");
635 GST_ERROR_OBJECT (faac, "Invalid codec data");
641 gst_faac_handle_frame (GstAudioEncoder * enc, GstBuffer * in_buf)
643 GstFaac *faac = GST_FAAC (enc);
644 GstFlowReturn ret = GST_FLOW_OK;
646 gsize size, ret_size;
648 GstMapInfo map, omap;
651 gst_audio_encoder_get_audio_info (GST_AUDIO_ENCODER (faac));
653 out_buf = gst_buffer_new_and_alloc (faac->bytes);
654 gst_buffer_map (out_buf, &omap, GST_MAP_WRITE);
656 if (G_LIKELY (in_buf)) {
657 if (memcmp (info->position, aac_channel_positions[info->channels - 1],
658 sizeof (GstAudioChannelPosition) * info->channels) != 0) {
659 in_buf = gst_buffer_make_writable (in_buf);
660 gst_audio_buffer_reorder_channels (in_buf, info->finfo->format,
661 info->channels, info->position,
662 aac_channel_positions[info->channels - 1]);
664 gst_buffer_map (in_buf, &map, GST_MAP_READ);
672 if (G_UNLIKELY ((enc_ret = faacEncEncode (faac->handle, (gint32 *) data,
673 size / (info->finfo->width / 8), omap.data, omap.size)) < 0))
678 gst_buffer_unmap (in_buf, &map);
680 GST_LOG_OBJECT (faac, "encoder return: %" G_GSIZE_FORMAT, ret_size);
683 gst_buffer_unmap (out_buf, &omap);
684 gst_buffer_resize (out_buf, 0, ret_size);
685 ret = gst_audio_encoder_finish_frame (enc, out_buf, faac->samples);
687 gst_buffer_unmap (out_buf, &omap);
688 gst_buffer_unref (out_buf);
689 /* re-create encoder after final flush */
691 GST_DEBUG_OBJECT (faac, "flushed; recreating encoder");
692 gst_faac_close_encoder (faac);
693 if (!gst_faac_open_encoder (faac, gst_audio_encoder_get_audio_info (enc)))
694 ret = GST_FLOW_ERROR;
703 GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL));
705 gst_buffer_unmap (in_buf, &map);
706 gst_buffer_unmap (out_buf, &omap);
707 gst_buffer_unref (out_buf);
708 return GST_FLOW_ERROR;
713 gst_faac_set_property (GObject * object,
714 guint prop_id, const GValue * value, GParamSpec * pspec)
716 GstFaac *faac = GST_FAAC (object);
718 GST_OBJECT_LOCK (faac);
722 faac->quality = g_value_get_int (value);
725 faac->bitrate = g_value_get_int (value);
727 case PROP_RATE_CONTROL:
728 faac->brtype = g_value_get_enum (value);
731 faac->tns = g_value_get_boolean (value);
734 faac->midside = g_value_get_boolean (value);
737 faac->shortctl = g_value_get_enum (value);
740 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
744 GST_OBJECT_UNLOCK (faac);
748 gst_faac_get_property (GObject * object,
749 guint prop_id, GValue * value, GParamSpec * pspec)
751 GstFaac *faac = GST_FAAC (object);
753 GST_OBJECT_LOCK (faac);
757 g_value_set_int (value, faac->quality);
760 g_value_set_int (value, faac->bitrate);
762 case PROP_RATE_CONTROL:
763 g_value_set_enum (value, faac->brtype);
766 g_value_set_boolean (value, faac->tns);
769 g_value_set_boolean (value, faac->midside);
772 g_value_set_enum (value, faac->shortctl);
775 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
779 GST_OBJECT_UNLOCK (faac);
783 plugin_init (GstPlugin * plugin)
785 return GST_ELEMENT_REGISTER (faac, plugin);
788 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
791 "Free AAC Encoder (FAAC)",
792 plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)