From 0ee5be4ee480c59d5f0e384566992795a5bb7ff8 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 21 Mar 2012 00:10:18 +0000 Subject: bytestream: add functions for accessing size of buffer Signed-off-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- libavcodec/bytestream.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libavcodec/bytestream.h') 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) -- cgit v1.2.3