2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-23 14:15:30 +00:00
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2011-10-09 15:18:09 +00:00
|
|
|
* Copyright (C) <2011> Tim-Philipp Müller <tim centricular net>
|
2001-12-23 14:15:30 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#ifndef __GST_FLAC_DEC_H__
|
|
|
|
#define __GST_FLAC_DEC_H__
|
2001-12-23 14:15:30 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2011-10-09 15:18:09 +00:00
|
|
|
#include <gst/audio/gstaudiodecoder.h>
|
2001-12-23 14:15:30 +00:00
|
|
|
|
|
|
|
#include <FLAC/all.h>
|
|
|
|
|
2006-03-24 19:41:03 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-12-23 14:15:30 +00:00
|
|
|
|
ext/flac/gstflacdec.*: Rewrite flacdec a bit, so that even seeking might work now. Most importantly, don't act upon a...
Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_dec_base_init),
(gst_flac_dec_class_init), (gst_flac_dec_init),
(gst_flac_dec_metadata_callback), (gst_flac_dec_error_callback),
(gst_flac_dec_eof), (gst_flac_dec_write), (gst_flac_dec_loop),
(gst_flac_dec_convert_src), (gst_flac_dec_get_src_query_types),
(gst_flac_dec_src_query), (gst_flac_dec_send_newsegment),
(gst_flac_dec_handle_seek_event), (gst_flac_dec_src_event),
(gst_flac_dec_change_state):
* ext/flac/gstflacdec.h:
Rewrite flacdec a bit, so that even seeking might work now. Most
importantly, don't act upon any flow return values we get, just tell
the decoder everything's dandy and act on the flow return values
later on in the loop function. We don't want to mess up the internal
decoder state for non-fatal things like flushing pads etc. Other
than that, use GstSegment (segment seeks don't work yet though, but
should be easy to add), use boilerplate macros, drop the superfluous
'flacdec:' from debug messages, use gst_util_uint64_scale_int, and
lots of other things.
2005-12-10 20:26:33 +00:00
|
|
|
#define GST_TYPE_FLAC_DEC gst_flac_dec_get_type()
|
2005-12-09 19:51:03 +00:00
|
|
|
#define GST_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_DEC, GstFlacDec)
|
2006-05-06 09:01:34 +00:00
|
|
|
#define GST_FLAC_DEC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLAC_DEC, GstFlacDecClass)
|
2005-12-09 19:51:03 +00:00
|
|
|
#define GST_IS_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_FLAC_DEC)
|
2006-05-06 09:01:34 +00:00
|
|
|
#define GST_IS_FLAC_DEC_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_FLAC_DEC)
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
typedef struct _GstFlacDec GstFlacDec;
|
|
|
|
typedef struct _GstFlacDecClass GstFlacDecClass;
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
struct _GstFlacDec {
|
2011-10-09 15:18:09 +00:00
|
|
|
GstAudioDecoder audiodecoder;
|
2008-08-06 15:34:55 +00:00
|
|
|
|
2011-10-09 15:18:09 +00:00
|
|
|
/*< private >*/
|
2009-12-23 16:50:34 +00:00
|
|
|
FLAC__StreamDecoder *decoder;
|
ext/flac/: Support chain-based operation, should make flac-over-DAAP work (#340492).
Original commit message from CVS:
* ext/flac/Makefile.am:
* ext/flac/gstflacdec.c: (gst_flac_dec_init),
(gst_flac_dec_reset_decoders),
(gst_flac_dec_setup_seekable_decoder),
(gst_flac_dec_setup_stream_decoder), (gst_flac_dec_finalize),
(gst_flac_dec_metadata_callback),
(gst_flac_dec_metadata_callback_seekable),
(gst_flac_dec_metadata_callback_stream),
(gst_flac_dec_error_callback),
(gst_flac_dec_error_callback_seekable),
(gst_flac_dec_error_callback_stream), (gst_flac_dec_read_seekable),
(gst_flac_dec_read_stream), (gst_flac_dec_write),
(gst_flac_dec_write_seekable), (gst_flac_dec_write_stream),
(gst_flac_dec_loop), (gst_flac_dec_sink_event),
(gst_flac_dec_chain), (gst_flac_dec_convert_sink),
(gst_flac_dec_get_sink_query_types), (gst_flac_dec_sink_query),
(gst_flac_dec_get_src_query_types), (gst_flac_dec_src_query),
(gst_flac_dec_handle_seek_event), (gst_flac_dec_sink_activate),
(gst_flac_dec_sink_activate_push),
(gst_flac_dec_sink_activate_pull), (gst_flac_dec_change_state):
* ext/flac/gstflacdec.h:
Support chain-based operation, should make flac-over-DAAP
work (#340492).
2006-06-20 19:40:29 +00:00
|
|
|
GstAdapter *adapter;
|
2011-03-28 22:46:47 +00:00
|
|
|
|
2011-10-30 18:45:45 +00:00
|
|
|
gboolean got_headers; /* have we received all the header buffers yet? */
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2011-10-09 15:18:09 +00:00
|
|
|
GstFlowReturn last_flow; /* to marshal flow return from finis_frame to
|
|
|
|
* handle_frame via flac callbacks */
|
ext/flac/gstflacdec.*: Rewrite flacdec a bit, so that even seeking might work now. Most importantly, don't act upon a...
Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_dec_base_init),
(gst_flac_dec_class_init), (gst_flac_dec_init),
(gst_flac_dec_metadata_callback), (gst_flac_dec_error_callback),
(gst_flac_dec_eof), (gst_flac_dec_write), (gst_flac_dec_loop),
(gst_flac_dec_convert_src), (gst_flac_dec_get_src_query_types),
(gst_flac_dec_src_query), (gst_flac_dec_send_newsegment),
(gst_flac_dec_handle_seek_event), (gst_flac_dec_src_event),
(gst_flac_dec_change_state):
* ext/flac/gstflacdec.h:
Rewrite flacdec a bit, so that even seeking might work now. Most
importantly, don't act upon any flow return values we get, just tell
the decoder everything's dandy and act on the flow return values
later on in the loop function. We don't want to mess up the internal
decoder state for non-fatal things like flushing pads etc. Other
than that, use GstSegment (segment seeks don't work yet though, but
should be easy to add), use boilerplate macros, drop the superfluous
'flacdec:' from debug messages, use gst_util_uint64_scale_int, and
lots of other things.
2005-12-10 20:26:33 +00:00
|
|
|
|
|
|
|
gint channels;
|
|
|
|
gint depth;
|
|
|
|
gint width;
|
|
|
|
gint sample_rate;
|
2006-04-07 18:15:08 +00:00
|
|
|
|
|
|
|
/* from the stream info, needed for scanning */
|
|
|
|
guint16 min_blocksize;
|
|
|
|
guint16 max_blocksize;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
struct _GstFlacDecClass {
|
2011-10-09 15:18:09 +00:00
|
|
|
GstAudioDecoderClass audiodecoder;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
2001-12-23 14:15:30 +00:00
|
|
|
|
ext/flac/gstflacdec.*: Rewrite flacdec a bit, so that even seeking might work now. Most importantly, don't act upon a...
Original commit message from CVS:
* ext/flac/gstflacdec.c: (gst_flac_dec_base_init),
(gst_flac_dec_class_init), (gst_flac_dec_init),
(gst_flac_dec_metadata_callback), (gst_flac_dec_error_callback),
(gst_flac_dec_eof), (gst_flac_dec_write), (gst_flac_dec_loop),
(gst_flac_dec_convert_src), (gst_flac_dec_get_src_query_types),
(gst_flac_dec_src_query), (gst_flac_dec_send_newsegment),
(gst_flac_dec_handle_seek_event), (gst_flac_dec_src_event),
(gst_flac_dec_change_state):
* ext/flac/gstflacdec.h:
Rewrite flacdec a bit, so that even seeking might work now. Most
importantly, don't act upon any flow return values we get, just tell
the decoder everything's dandy and act on the flow return values
later on in the loop function. We don't want to mess up the internal
decoder state for non-fatal things like flushing pads etc. Other
than that, use GstSegment (segment seeks don't work yet though, but
should be easy to add), use boilerplate macros, drop the superfluous
'flacdec:' from debug messages, use gst_util_uint64_scale_int, and
lots of other things.
2005-12-10 20:26:33 +00:00
|
|
|
GType gst_flac_dec_get_type (void);
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2006-03-24 19:41:03 +00:00
|
|
|
G_END_DECLS
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#endif /* __GST_FLAC_DEC_H__ */
|