[FFmpeg-cvslog] AVFormatContext: add metadata_header_padding field
James Darnley
git at videolan.org
Fri Jan 24 23:19:10 CET 2014
ffmpeg | branch: master | James Darnley <james.darnley at gmail.com> | Sun Dec 29 22:42:33 2013 +0100| [86bee7984e30cf7df6ad353be7c5153f5988e797] | committer: Michael Niedermayer
AVFormatContext: add metadata_header_padding field
This field is used to store the number of bytes that should be written
as padding to a metadata header of a file. For example:
- The FLAC format's METADATA_BLOCK_PADDING [1]
- The ID3v2 tag format's padding [2]
[1] http://xiph.org/flac/format.html#metadata_block_padding
[2] http://id3.org/id3v2.3.0#ID3v2_overview
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86bee7984e30cf7df6ad353be7c5153f5988e797
---
libavformat/avformat.h | 9 +++++++++
libavformat/options_table.h | 1 +
libavformat/utils.c | 1 +
libavformat/version.h | 4 ++--
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 30fc8db..a495ee0 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1348,6 +1348,13 @@ typedef struct AVFormatContext {
* Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
*/
AVCodec *subtitle_codec;
+
+ /**
+ * Number of bytes to be written as padding in a metadata header.
+ * Demuxing: Unused.
+ * Muxing: Set by user via av_format_set_metadata_header_padding.
+ */
+ int metadata_header_padding;
} AVFormatContext;
int av_format_get_probe_score(const AVFormatContext *s);
@@ -1357,6 +1364,8 @@ AVCodec * av_format_get_audio_codec(const AVFormatContext *s);
void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c);
AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s);
void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c);
+int av_format_get_metadata_header_padding(const AVFormatContext *s);
+void av_format_set_metadata_header_padding(AVFormatContext *s, int c);
/**
* Returns the method used to set ctx->duration.
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 8145325..3221042 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -77,6 +77,7 @@ static const AVOption avformat_options[] = {
{"skip_initial_bytes", "set number of bytes to skip before reading header and frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, D},
{"correct_ts_overflow", "correct single timestamp overflows", OFFSET(correct_ts_overflow), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, D},
{"flush_packets", "enable flushing of the I/O context after each packet", OFFSET(flush_packets), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E},
+{"metadata_header_padding", "set number of bytes to be written as padding in a metadata header", OFFSET(metadata_header_padding), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, E},
{NULL},
};
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c530511..421dfef 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -103,6 +103,7 @@ MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, video_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, audio_codec)
MAKE_ACCESSORS(AVFormatContext, format, AVCodec *, subtitle_codec)
+MAKE_ACCESSORS(AVFormatContext, format, int, metadata_header_padding)
static AVCodec *find_decoder(AVFormatContext *s, AVStream *st, enum AVCodecID codec_id)
{
diff --git a/libavformat/version.h b/libavformat/version.h
index 4ad624d..a0e5a7c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 55
-#define LIBAVFORMAT_VERSION_MINOR 25
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR 26
+#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list