2001-12-23 00:07:59 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2001 Erik Walthinsen <omega@temple-baptist.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_BYTESTREAM_H__
|
|
|
|
#define __GST_BYTESTREAM_H__
|
|
|
|
|
2003-10-01 13:11:45 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gst/gstpad.h>
|
|
|
|
#include <gst/gstevent.h>
|
2001-12-23 00:07:59 +00:00
|
|
|
|
2002-10-22 19:49:52 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-12-23 00:07:59 +00:00
|
|
|
|
|
|
|
typedef struct _GstByteStream GstByteStream;
|
|
|
|
|
|
|
|
struct _GstByteStream {
|
2002-12-31 16:42:28 +00:00
|
|
|
GstPad *pad;
|
2001-12-23 00:07:59 +00:00
|
|
|
|
2002-12-31 16:42:28 +00:00
|
|
|
GstEvent *event;
|
2001-12-23 00:07:59 +00:00
|
|
|
|
|
|
|
GSList *buflist;
|
2002-12-31 16:42:28 +00:00
|
|
|
guint32 headbufavail;
|
|
|
|
guint32 listavail;
|
2001-12-23 00:07:59 +00:00
|
|
|
|
2002-02-02 13:23:07 +00:00
|
|
|
/* we keep state of assembled pieces */
|
2001-12-23 00:07:59 +00:00
|
|
|
guint8 *assembled;
|
2003-03-19 21:16:04 +00:00
|
|
|
guint32 assembled_len; /* only valid when assembled != NULL */
|
2002-05-15 18:52:08 +00:00
|
|
|
|
|
|
|
/* this is needed for gst_bytestream_tell */
|
2002-12-31 16:42:28 +00:00
|
|
|
guint64 offset;
|
|
|
|
guint64 last_ts;
|
2002-05-26 21:54:27 +00:00
|
|
|
|
|
|
|
/* if we are in the seek state (waiting for DISCONT) */
|
2002-12-31 16:42:28 +00:00
|
|
|
gboolean in_seek;
|
2003-10-07 21:58:42 +00:00
|
|
|
|
2003-12-09 03:48:12 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2001-12-23 00:07:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GstByteStream* gst_bytestream_new (GstPad *pad);
|
|
|
|
void gst_bytestream_destroy (GstByteStream *bs);
|
|
|
|
|
2003-03-19 21:16:04 +00:00
|
|
|
void gst_bytestream_reset (GstByteStream *bs);
|
2002-05-15 18:52:08 +00:00
|
|
|
guint32 gst_bytestream_read (GstByteStream *bs, GstBuffer** buf, guint32 len);
|
2002-02-02 13:23:07 +00:00
|
|
|
guint64 gst_bytestream_tell (GstByteStream *bs);
|
2002-06-07 21:52:16 +00:00
|
|
|
guint64 gst_bytestream_length (GstByteStream *bs);
|
2002-06-13 22:29:32 +00:00
|
|
|
gboolean gst_bytestream_size_hint (GstByteStream *bs, guint32 size);
|
2002-05-26 21:54:27 +00:00
|
|
|
gboolean gst_bytestream_seek (GstByteStream *bs, gint64 offset, GstSeekType type);
|
2002-05-15 18:52:08 +00:00
|
|
|
guint32 gst_bytestream_peek (GstByteStream *bs, GstBuffer** buf, guint32 len);
|
|
|
|
guint32 gst_bytestream_peek_bytes (GstByteStream *bs, guint8** data, guint32 len);
|
2001-12-23 00:07:59 +00:00
|
|
|
gboolean gst_bytestream_flush (GstByteStream *bs, guint32 len);
|
2002-02-02 13:23:07 +00:00
|
|
|
void gst_bytestream_flush_fast (GstByteStream *bs, guint32 len);
|
2001-12-23 00:07:59 +00:00
|
|
|
void gst_bytestream_get_status (GstByteStream *bs, guint32 *avail_out, GstEvent **event_out);
|
2002-05-10 08:16:18 +00:00
|
|
|
guint64 gst_bytestream_get_timestamp (GstByteStream *bs);
|
2001-12-23 00:07:59 +00:00
|
|
|
|
|
|
|
void gst_bytestream_print_status (GstByteStream *bs);
|
|
|
|
|
2002-10-22 19:49:52 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2001-12-23 00:07:59 +00:00
|
|
|
#endif /* __GST_BYTESTREAM_H__ */
|