[FFmpeg-cvslog] bytestream: add functions for accessing size of buffer

Paul B Mahol git at videolan.org
Mon Apr 21 17:02:26 CEST 2014


ffmpeg | branch: release/1.1 | Paul B Mahol <onemda at gmail.com> | Wed Mar 21 00:10:18 2012 +0000| [0c5e6c542f5efffb4cd770e84967478b0076a6e5] | committer: Sean McGovern

bytestream: add functions for accessing size of buffer

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>

CC:libav-stable at libav.org
(cherry picked from commit de9d2705f61ef569487ec5f8974a9c7ce34ec783)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c5e6c542f5efffb4cd770e84967478b0076a6e5
---

 libavcodec/bytestream.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h
index 0f89558..63d61f1 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)



More information about the ffmpeg-cvslog mailing list