summaryrefslogtreecommitdiffstats
path: root/ext/flac/gstflacdec.h
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2005-12-10 20:26:33 +0000
committerTim-Philipp Müller <tim@centricular.net>2005-12-10 20:26:33 +0000
commit8db61ef0c74585922c712e48290f4675a09f663a (patch)
tree7189f06af697688b77d7900309fd3d944100f73d /ext/flac/gstflacdec.h
parentfc270aab7973d70841134fe8ad511312cc33de4f (diff)
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.
Diffstat (limited to 'ext/flac/gstflacdec.h')
-rw-r--r--ext/flac/gstflacdec.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/ext/flac/gstflacdec.h b/ext/flac/gstflacdec.h
index 0280370c..f40bcc37 100644
--- a/ext/flac/gstflacdec.h
+++ b/ext/flac/gstflacdec.h
@@ -31,7 +31,7 @@ extern "C" {
#endif /* __cplusplus */
-#define GST_TYPE_FLAC_DEC flacdec_get_type()
+#define GST_TYPE_FLAC_DEC gst_flac_dec_get_type()
#define GST_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_DEC, GstFlacDec)
#define GST_FLAC_DEC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLAC_DEC, GstFlacDec)
#define GST_IS_FLAC_DEC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_FLAC_DEC)
@@ -43,31 +43,37 @@ typedef struct _GstFlacDecClass GstFlacDecClass;
struct _GstFlacDec {
GstElement element;
- GstPad *sinkpad,*srcpad;
- guint64 offset;
-
FLAC__SeekableStreamDecoder *decoder;
- gint channels;
- gint depth;
- gint width;
- gint frequency;
- gboolean need_discont;
- gboolean seek_pending;
- gint64 seek_value;
+ GstPad *sinkpad;
+ GstPad *srcpad;
gboolean init;
- guint64 total_samples;
- guint64 stream_samples;
+ gboolean need_newsegment;
+
+ guint64 offset; /* current byte offset of input */
+
+ gboolean seeking; /* set to TRUE while seeking to make sure we
+ * don't push any buffers in the write callback
+ * until we are actually at the new position */
- gboolean eos;
+ GstSegment segment; /* the currently configured segment, in
+ * samples/audio frames (DEFAULT format) */
+
+ GstFlowReturn last_flow; /* the last flow return received from either
+ * gst_pad_push or gst_pad_buffer_alloc */
+
+ gint channels;
+ gint depth;
+ gint width;
+ gint sample_rate;
};
struct _GstFlacDecClass {
GstElementClass parent_class;
};
-GType flacdec_get_type (void);
+GType gst_flac_dec_get_type (void);
#ifdef __cplusplus