GstByteStream *bs = g_new (GstByteStream, 1);
bs->pad = pad;
-
+ bs->event = NULL;
bs->buflist = NULL;
bs->headbufavail = 0;
bs->listavail = 0;
{
GSList *walk;
+ if (bs->event)
+ gst_event_free (bs->event);
+
walk = bs->buflist;
while (walk) {
gst_buffer_unref (GST_BUFFER (walk->data));
GstBuffer *nextbuf, *lastbuf;
GSList *end;
+ g_assert (!bs->event);
+
bs_print ("get_next_buf: pulling buffer\n");
nextbuf = gst_pad_pull (bs->pad);
+ if (GST_IS_EVENT (nextbuf))
+ {
+ bs->event = GST_EVENT (nextbuf);
+ return FALSE;
+ }
+
if (!nextbuf)
return FALSE;
return TRUE;
}
-
static gboolean
gst_bytestream_fill_bytes (GstByteStream * bs, guint32 len)
{
}
void
+gst_bytestream_get_status (GstByteStream *bs,
+ guint32 *avail_out,
+ GstEvent **event_out)
+{
+ if (avail_out)
+ *avail_out = bs->listavail;
+
+ if (event_out)
+ {
+ *event_out = bs->event;
+ bs->event = NULL;
+ }
+}
+
+void
gst_bytestream_print_status (GstByteStream * bs)
{
GSList *walk;
struct _GstByteStream {
GstPad *pad;
+ GstEvent * event;
+
GSList *buflist;
guint32 headbufavail;
guint32 listavail;
guint8* gst_bytestream_peek_bytes (GstByteStream *bs, guint32 len);
gboolean gst_bytestream_flush (GstByteStream *bs, guint32 len);
void gst_bytestream_flush_fast (GstByteStream * bs, guint32 len);
+void gst_bytestream_get_status (GstByteStream *bs, guint32 *avail_out, GstEvent **event_out);
void gst_bytestream_print_status (GstByteStream *bs);