2 * Copyright (C) 2001 Erik Walthinsen <omega@temple-baptist.com>
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.
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.
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.
20 #ifndef __GST_BYTESTREAM_H__
21 #define __GST_BYTESTREAM_H__
24 #include <gst/gstpad.h>
25 #include <gst/gstevent.h>
29 typedef struct _GstByteStream GstByteStream;
31 struct _GstByteStream {
40 /* we keep state of assembled pieces */
42 guint32 assembled_len; /* only valid when assembled != NULL */
44 /* this is needed for gst_bytestream_tell */
48 /* if we are in the seek state (waiting for DISCONT) */
51 gpointer _gst_reserved[GST_PADDING];
54 GstByteStream* gst_bytestream_new (GstPad *pad);
55 void gst_bytestream_destroy (GstByteStream *bs);
57 void gst_bytestream_reset (GstByteStream *bs);
58 guint32 gst_bytestream_read (GstByteStream *bs, GstBuffer** buf, guint32 len);
59 guint64 gst_bytestream_tell (GstByteStream *bs);
60 guint64 gst_bytestream_length (GstByteStream *bs);
61 gboolean gst_bytestream_size_hint (GstByteStream *bs, guint32 size);
62 gboolean gst_bytestream_seek (GstByteStream *bs, gint64 offset, GstSeekType method);
64 guint32 gst_bytestream_peek (GstByteStream *bs, GstBuffer** buf, guint32 len);
65 guint32 gst_bytestream_peek_bytes (GstByteStream *bs, guint8** data, guint32 len);
66 gboolean gst_bytestream_flush (GstByteStream *bs, guint32 len);
67 void gst_bytestream_flush_fast (GstByteStream *bs, guint32 len);
68 void gst_bytestream_get_status (GstByteStream *bs, guint32 *avail_out, GstEvent **event_out);
69 guint64 gst_bytestream_get_timestamp (GstByteStream *bs);
71 void gst_bytestream_print_status (GstByteStream *bs);
75 #endif /* __GST_BYTESTREAM_H__ */