~oah-dev/oah/gst-plugins-bad

« back to all changes in this revision

Viewing changes to ext/faad/gstfaad.h

  • Committer: Haakon Sporsheim
  • Date: 2009-03-12 13:52:03 UTC
  • Revision ID: haakon.sporsheim@tandberg.com-20090312135203-i5k294hgkushb0mt
Initial import of git repository: git://anongit.freedesktop.org/gstreamer/gst-plugins-bad (tag: RELEASE-0_10_10)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GStreamer FAAD (Free AAC Decoder) plugin
 
2
 * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Library General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public
 
15
 * License along with this library; if not, write to the
 
16
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
 * Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
#ifndef __GST_FAAD_H__
 
21
#define __GST_FAAD_H__
 
22
 
 
23
#include <gst/gst.h>
 
24
#ifdef FAAD_IS_NEAAC
 
25
#include <neaacdec.h>
 
26
#else
 
27
#include <faad.h>
 
28
#endif
 
29
 
 
30
G_BEGIN_DECLS
 
31
 
 
32
#define GST_TYPE_FAAD \
 
33
  (gst_faad_get_type ())
 
34
#define GST_FAAD(obj) \
 
35
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_FAAD, GstFaad))
 
36
#define GST_FAAD_CLASS(klass) \
 
37
  (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_FAAD, GstFaadClass))
 
38
#define GST_IS_FAAD(obj) \
 
39
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FAAD))
 
40
#define GST_IS_FAAD_CLASS(klass) \
 
41
  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_FAAD))
 
42
 
 
43
typedef struct _GstFaad {
 
44
  GstElement element;
 
45
 
 
46
  GstPad    *srcpad;
 
47
  GstPad    *sinkpad;
 
48
 
 
49
  guint      samplerate; /* sample rate of the last MPEG frame    */
 
50
  guint      channels;   /* number of channels of the last frame  */
 
51
  guint      bps;        /* bytes per sample                      */
 
52
 
 
53
  guint8     fake_codec_data[2];
 
54
 
 
55
  GstBuffer *tempbuf;    /* used to keep input leftovers          */
 
56
 
 
57
  /* FAAD object */
 
58
  faacDecHandle handle;
 
59
  gboolean init;
 
60
 
 
61
  /* FAAD channel setup */
 
62
  guchar *channel_positions;
 
63
  gboolean need_channel_setup;
 
64
  gboolean packetised; /* We must differentiate between raw and packetised streams */
 
65
 
 
66
  gint64  prev_ts;     /* timestamp of previous buffer                    */
 
67
  gint64  next_ts;     /* timestamp of next buffer                        */
 
68
  guint64 bytes_in;    /* bytes received                                  */
 
69
  guint64 sum_dur_out; /* sum of durations of decoded buffers we sent out */
 
70
  gint    error_count;
 
71
  gboolean discont;
 
72
 
 
73
  /* segment handling */
 
74
  GstSegment * segment;
 
75
 
 
76
  /* list of raw output buffers for reverse playback */
 
77
  GList *queued;
 
78
  /* gather/decode queues for reverse playback */
 
79
  GList *gather;
 
80
  GList *decode;
 
81
} GstFaad;
 
82
 
 
83
typedef struct _GstFaadClass {
 
84
  GstElementClass parent_class;
 
85
} GstFaadClass;
 
86
 
 
87
GType gst_faad_get_type (void);
 
88
 
 
89
G_END_DECLS
 
90
 
 
91
#endif /* __GST_FAAD_H__ */