[FFmpeg-devel] [PATCH 1/5] bytestream: add functions for accessing size of buffer

Paul B Mahol onemda at gmail.com
Wed Mar 21 01:10:18 CET 2012


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/bytestream.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index 07463f1..39a1e28 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)
-- 
1.7.7



More information about the ffmpeg-devel mailing list