diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-03-21 00:10:18 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-05-31 20:05:19 -0400 |
commit | b473fdcde329dfbe6d099247f65f51436a49e8c6 (patch) | |
tree | 2510741c228289c2c40fc61223df52109df0b047 | |
parent | db52f056c3d26c59feb9156a9deeaf8e0089b86e (diff) | |
download | ffmpeg-b473fdcde329dfbe6d099247f65f51436a49e8c6.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>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org
(cherry picked from commit de9d2705f61ef569487ec5f8974a9c7ce34ec783)
-rw-r--r-- | libavcodec/bytestream.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 68146200ae..091cab8c8e 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -198,6 +198,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) |