aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bytestream.h
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-03-21 00:10:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2012-03-21 03:05:19 +0100
commit0ee5be4ee480c59d5f0e384566992795a5bb7ff8 (patch)
treef4c7ae60de39bfc6c8ef386719cf797ce99f3e87 /libavcodec/bytestream.h
parent841e669a39ce83a5b96b51b5774ebda7f216d326 (diff)
downloadffmpeg-0ee5be4ee480c59d5f0e384566992795a5bb7ff8.tar.gz
bytestream: add functions for accessing size of buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bytestream.h')
-rw-r--r--libavcodec/bytestream.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index 07463f1e3d..39a1e28a12 100644
--- a/libavcodec/bytestream.h
+++ b/libavcodec/bytestream.h
@@ -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)