gstflacdec.h 2.28 KB
Newer Older
Andy Wingo's avatar
Andy Wingo committed
1
/* GStreamer
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
2
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3
 * Copyright (C) <2011> Tim-Philipp Müller <tim centricular net>
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
17 18
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
19 20 21
 */


22 23
#ifndef __GST_FLAC_DEC_H__
#define __GST_FLAC_DEC_H__
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
24 25

#include <gst/gst.h>
26
#include <gst/audio/audio.h>
27
#include <gst/audio/gstaudiodecoder.h>
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
28 29 30

#include <FLAC/all.h>

Wim Taymans's avatar
Wim Taymans committed
31
G_BEGIN_DECLS
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
32

33
#define GST_TYPE_FLAC_DEC gst_flac_dec_get_type()
34
#define GST_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_DEC, GstFlacDec)
35
#define GST_FLAC_DEC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLAC_DEC, GstFlacDecClass)
36
#define GST_IS_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_FLAC_DEC)
37
#define GST_IS_FLAC_DEC_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_FLAC_DEC)
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
38

39 40
typedef struct _GstFlacDec GstFlacDec;
typedef struct _GstFlacDecClass GstFlacDecClass;
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
41

42
struct _GstFlacDec {
43
  GstAudioDecoder  audiodecoder;
44

45
  /*< private >*/
46
  FLAC__StreamDecoder         *decoder;
47
  GstAdapter                  *adapter;
48

49
  gboolean       got_headers; /* have we received all the header buffers yet? */
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
50

51 52
  GstFlowReturn  last_flow;   /* to marshal flow return from finis_frame to
                               * handle_frame via flac callbacks */
53

54 55
  GstAudioInfo   info;
  gint           channel_reorder_map[8];
56
  gint           depth;
57 58 59 60

  /* from the stream info, needed for scanning */
  guint16        min_blocksize;
  guint16        max_blocksize;
61

62
  gint           error_count;
Johan Dahlin's avatar
Johan Dahlin committed
63
};
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
64

65
struct _GstFlacDecClass {
66
  GstAudioDecoderClass  audiodecoder;
Johan Dahlin's avatar
Johan Dahlin committed
67
};
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
68

69
GType gst_flac_dec_get_type (void);
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
70

Wim Taymans's avatar
Wim Taymans committed
71
G_END_DECLS
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
72

73
#endif /* __GST_FLAC_DEC_H__ */