1 /* GStreamer 2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> 3 * Copyright (C) <2011> Tim-Philipp Müller <tim centricular net> 4 * 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. 9 * 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. 14 * 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. 19 */ 20 21 22 #ifndef __GST_FLAC_DEC_H__ 23 #define __GST_FLAC_DEC_H__ 24 25 #include <gst/gst.h> 26 #include <gst/audio/audio.h> 27 #include <gst/audio/gstaudiodecoder.h> 28 29 #include <FLAC/all.h> 30 31 G_BEGIN_DECLS 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) 38 39 typedef struct _GstFlacDec GstFlacDec; 40 typedef struct _GstFlacDecClass GstFlacDecClass; 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? */ 50 51 GstFlowReturn last_flow; /* to marshal flow return from finis_frame to 52 * handle_frame via flac callbacks */ 53 54 GstAudioInfo info; 55 gint channel_reorder_map[8]; 56 gint depth; 57 58 /* from the stream info, needed for scanning */ 59 guint16 min_blocksize; 60 guint16 max_blocksize; 61 62 gboolean do_resync; 63 gint error_count; 64 }; 65 66 struct _GstFlacDecClass { 67 GstAudioDecoderClass audiodecoder; 68 }; 69 70 GType gst_flac_dec_get_type (void); 71 72 G_END_DECLS 73 74 #endif /* __GST_FLAC_DEC_H__ */ 75