bytestream: add functions for accessing size of buffer
authorPaul B Mahol <onemda@gmail.com>
Wed, 21 Mar 2012 00:10:18 +0000 (00:10 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Mar 2012 02:05:19 +0000 (03:05 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/bytestream.h

index 07463f1..39a1e28 100644 (file)
@@ -190,6 +190,16 @@ static av_always_inline int bytestream2_tell_p(PutByteContext *p)
     return (int)(p->buffer - p->buffer_start);
 }
 
+static av_always_inline int bytestream2_size(GetByteContext *g)
+{
+    return (int)(g->buffer_end - g->buffer_start);
+}
+
+static av_always_inline int bytestream2_size_p(PutByteContext *p)
+{
+    return (int)(p->buffer_end - p->buffer_start);
+}
+
 static av_always_inline int bytestream2_seek(GetByteContext *g,
                                              int offset,
                                              int whence)