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
This commit is contained in:
Paul B Mahol 2012-03-21 00:10:18 +00:00 committed by Justin Ruggles
parent 58bc38a5f2
commit de9d2705f6
1 changed files with 10 additions and 0 deletions

View 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)