aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnshul Maheshwari <anshul.ffmpeg@gmail.com>2015-01-16 02:00:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-16 02:24:08 +0100
commita47c9331ef13c4af01de582f159ac6e59fe990ed (patch)
treeac62741a5228b4490c1e802c630a940d087080d8
parentba97cf2c4562b60fbef89103b61516891e31845e (diff)
downloadffmpeg-a47c9331ef13c4af01de582f159ac6e59fe990ed.tar.gz
avformat: Improve data streams/codec support
This adds data codec/stream handling where previously there was only audio/video/subtitles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/avformat.h17
-rw-r--r--libavformat/format.c2
-rw-r--r--libavformat/utils.c1
-rw-r--r--libavformat/version.h4
4 files changed, 22 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index a62a9ef5a9..db72c1801b 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -551,6 +551,7 @@ typedef struct AVOutputFormat {
* @see avdevice_capabilities_free() for more details.
*/
int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
+ enum AVCodecID data_codec; /**< default data codec */
} AVOutputFormat;
/**
* @}
@@ -1705,6 +1706,14 @@ typedef struct AVFormatContext {
AVCodec *subtitle_codec;
/**
+ * Forced data codec.
+ * This allows forcing a specific decoder, even when there are multiple with
+ * the same codec_id.
+ * Demuxing: Set by user via av_format_set_data_codec (NO direct access).
+ */
+ AVCodec *data_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.
@@ -1755,6 +1764,12 @@ typedef struct AVFormatContext {
* - demuxing: Set by user.
*/
uint8_t *dump_separator;
+
+ /**
+ * Forced Data codec_id.
+ * Demuxing: Set by user.
+ */
+ enum AVCodecID data_codec_id;
} AVFormatContext;
int av_format_get_probe_score(const AVFormatContext *s);
@@ -1764,6 +1779,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);
+AVCodec * av_format_get_data_codec(const AVFormatContext *s);
+void av_format_set_data_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);
void * av_format_get_opaque(const AVFormatContext *s);
diff --git a/libavformat/format.c b/libavformat/format.c
index 97f5657141..fa94b7d3b5 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -151,6 +151,8 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
return fmt->audio_codec;
else if (type == AVMEDIA_TYPE_SUBTITLE)
return fmt->subtitle_codec;
+ else if (type == AVMEDIA_TYPE_DATA)
+ return fmt->data_codec;
else
return AV_CODEC_ID_NONE;
}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cb8b42b9c9..11247838ea 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -110,6 +110,7 @@ MAKE_ACCESSORS(AVStream, stream, char *, recommended_encoder_configuration)
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, AVCodec *, data_codec)
MAKE_ACCESSORS(AVFormatContext, format, int, metadata_header_padding)
MAKE_ACCESSORS(AVFormatContext, format, void *, opaque)
MAKE_ACCESSORS(AVFormatContext, format, av_format_control_message, control_message_cb)
diff --git a/libavformat/version.h b/libavformat/version.h
index 5e449bb510..9a38df9a0a 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR 18
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR 19
+#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \