faad

faad — Free MPEG-2/4 AAC decoder

Synopsis

                    GstFaad;

Description

faad decodes AAC (MPEG-4 part 3) stream.

Example launch lines

1
gst-launch filesrc location=example.mp4 ! qtdemux ! faad ! audioconvert ! audioresample ! autoaudiosink
Play aac from mp4 file.
1
gst-launch filesrc location=example.adts ! faad ! audioconvert ! audioresample ! autoaudiosink
Play standalone aac bitstream.

Synopsis

Element Information

plugin

faad

author

Ronald Bultje <rbultje@ronald.bitfreak.net>

class

Codec/Decoder/Audio

Element Pads

name

sink

direction

sink

presence

always

details

audio/mpeg, mpegversion=(int){ 2, 4 }

name

src

direction

source

presence

always

details

audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)[ 8000, 96000 ], channels=(int)[ 1, 8 ]

Details

GstFaad

typedef struct {
  GstElement element;

  GstPad    *srcpad;
  GstPad    *sinkpad;

  guint      samplerate; /* sample rate of the last MPEG frame    */
  guint      channels;   /* number of channels of the last frame  */
  guint      bps;        /* bytes per sample                      */
  guchar    *channel_positions;

  guint8     fake_codec_data[2];

  GstAdapter *adapter;

  /* FAAD object */
  faacDecHandle handle;
  gboolean init;

  gboolean packetised; /* We must differentiate between raw and packetised streams */

  gint64  prev_ts;     /* timestamp of previous buffer                    */
  gint64  next_ts;     /* timestamp of next buffer                        */
  guint64 bytes_in;    /* bytes received                                  */
  guint64 sum_dur_out; /* sum of durations of decoded buffers we sent out */
  gint    error_count;
  gboolean discont;
  gint    sync_flush;

  /* segment handling */
  GstSegment segment;

  /* list of raw output buffers for reverse playback */
  GList *queued;
  /* gather/decode queues for reverse playback */
  GList *gather;
  GList *decode;
} GstFaad;