[FFmpeg-cvslog] avformat: add av_stream_get_parser() to access avformat AVParser

Michael Niedermayer git at videolan.org
Fri Nov 14 19:28:30 CET 2014


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Mon Jul 14 21:03:43 2014 +0200| [c2af6b500bcf5bf59380c404b77edeb0c6eb46a2] | committer: Michael Niedermayer

avformat: add av_stream_get_parser() to access avformat AVParser

The AVStream.parser field is considered private and its location cannot be
preserved while preserving also ABI compatibility to libav, as libav added fields
before it.
Some tools like ffmpeg.c access this field though

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 62227a70f0a4c07d7ead5775d8bad64797f8ef80)

Conflicts:

	RELEASE_NOTES
	doc/APIchanges
	libavformat/utils.c
	libavformat/version.h
(cherry picked from commit a78e6363e9a7ef90bd1ff4aeceee8e5501cbc6d4)

Conflicts:

	libavformat/utils.c

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

 libavformat/avformat.h |    1 +
 libavformat/utils.c    |    5 +++++
 2 files changed, 6 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 04fad94..2adcae2 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -892,6 +892,7 @@ typedef struct AVStream {
 
 AVRational av_stream_get_r_frame_rate(const AVStream *s);
 void       av_stream_set_r_frame_rate(AVStream *s, AVRational r);
+struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
 
 #define AV_PROGRAM_RUNNING 1
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3280a0d..4cb0adf 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -103,6 +103,11 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp)
 
 MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
 
+struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
+{
+    return st->parser;
+}
+
 /* an arbitrarily chosen "sane" max packet size -- 50M */
 #define SANE_CHUNK_SIZE (50000000)
 



More information about the ffmpeg-cvslog mailing list