summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ae62fa)
raw | patch | inline | side by side (parent: 7ae62fa)
author | Wim Taymans <wim.taymans@gmail.com> | |
Fri, 7 Jun 2002 21:52:16 +0000 (21:52 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Fri, 7 Jun 2002 21:52:16 +0000 (21:52 +0000) |
Original commit message from CVS:
Added _length method for peer pads that can answer the query
Added _length method for peer pads that can answer the query
libs/gst/bytestream/bytestream.c | patch | blob | history | |
libs/gst/bytestream/bytestream.h | patch | blob | history |
index 91265777fe8d83d5d25f712c6ffe530601bb8343..00ba66f9c46f9d38bcc0588bdabab808df3544a7 100644 (file)
GstFormat format;
gint64 value;
- g_return_val_if_fail (bs != NULL, 0);
+ g_return_val_if_fail (bs != NULL, -1);
format = GST_FORMAT_BYTES;
return -1;
}
+guint64
+gst_bytestream_length (GstByteStream *bs)
+{
+ GstFormat format;
+ gint64 value;
+
+ g_return_val_if_fail (bs != NULL, -1);
+
+ format = GST_FORMAT_BYTES;
+
+ if (gst_pad_query (GST_PAD_PEER (bs->pad), GST_PAD_QUERY_TOTAL, &format, &value))
+ return value;
+
+ return -1;
+}
+
guint32
gst_bytestream_read (GstByteStream * bs, GstBuffer** buf, guint32 len)
{
index cbc88946caf5598725f866d39d2dbca7671ee4f6..380c18829bf98737dc3cf16d11c4ad80f7e298e9 100644 (file)
guint32 gst_bytestream_read (GstByteStream *bs, GstBuffer** buf, guint32 len);
guint64 gst_bytestream_tell (GstByteStream *bs);
+guint64 gst_bytestream_length (GstByteStream *bs);
gboolean gst_bytestream_seek (GstByteStream *bs, gint64 offset, GstSeekType type);
guint32 gst_bytestream_peek (GstByteStream *bs, GstBuffer** buf, guint32 len);
guint32 gst_bytestream_peek_bytes (GstByteStream *bs, guint8** data, guint32 len);