diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-09 04:47:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-09 04:47:19 +0200 |
commit | f9ecb849ef39bc337d9439b829fe08da5c95cc3d (patch) | |
tree | 761e860a10084d8de4f07815911f697fe11610b9 /libavformat/avformat.h | |
parent | 7b8ed831eb8432d202dad16dedc1758b018bb1fa (diff) | |
parent | a71bcd1a7f66e210971c44452dc4cdae7bdbd98a (diff) | |
download | ffmpeg-f9ecb849ef39bc337d9439b829fe08da5c95cc3d.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
crypto: Use av_freep instead of av_free
lavf: don't try to free private options if priv_data is NULL.
swscale: fix types of assembly arguments.
swscale: move two macros that are only used once into caller.
swscale: remove unused function.
options: Add missing braces around struct initializer.
mov: Remove leftover crufty debug statement with references to a local file.
dvbsubdec: Fix compilation of debug code.
Remove all uses of now deprecated metadata functions.
Move metadata API from lavf to lavu.
Conflicts:
doc/APIchanges
libavformat/aiffdec.c
libavformat/asfdec.c
libavformat/avformat.h
libavformat/avidec.c
libavformat/cafdec.c
libavformat/matroskaenc.c
libavformat/mov.c
libavformat/mp3enc.c
libavformat/wtv.c
libavutil/avutil.h
libavutil/internal.h
libswscale/swscale.c
libswscale/x86/swscale_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7ef37f151a..f00fce4a38 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -40,6 +40,7 @@ const char *avformat_license(void); #include <time.h> #include <stdio.h> /* FILE */ #include "libavcodec/avcodec.h" +#include "libavutil/dict.h" #include "avio.h" #include "libavformat/version.h" @@ -106,21 +107,24 @@ struct AVFormatContext; * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of */ -#define AV_METADATA_MATCH_CASE 1 -#define AV_METADATA_IGNORE_SUFFIX 2 -#define AV_METADATA_DONT_STRDUP_KEY 4 -#define AV_METADATA_DONT_STRDUP_VAL 8 -#define AV_METADATA_DONT_OVERWRITE 16 ///< Don't overwrite existing tags. +#if FF_API_OLD_METADATA2 +/** + * @defgroup old_metadata Old metadata API + * The following functions are deprecated, use + * their equivalents from libavutil/dict.h instead. + * @{ + */ -typedef struct { - char *key; - char *value; -}AVMetadataTag; +#define AV_METADATA_MATCH_CASE AV_DICT_MATCH_CASE +#define AV_METADATA_IGNORE_SUFFIX AV_DICT_IGNORE_SUFFIX +#define AV_METADATA_DONT_STRDUP_KEY AV_DICT_DONT_STRDUP_KEY +#define AV_METADATA_DONT_STRDUP_VAL AV_DICT_DONT_STRDUP_VAL +#define AV_METADATA_DONT_OVERWRITE AV_DICT_DONT_OVERWRITE + +typedef attribute_deprecated AVDictionary AVMetadata; +typedef attribute_deprecated AVDictionaryEntry AVMetadataTag; -typedef struct AVMetadata AVMetadata; -#if FF_API_OLD_METADATA2 typedef struct AVMetadataConv AVMetadataConv; -#endif /** * Get a metadata element with matching key. @@ -130,8 +134,8 @@ typedef struct AVMetadataConv AVMetadataConv; * @param flags Allows case as well as suffix-insensitive comparisons. * @return Found tag or NULL, changing key or value leads to undefined behavior. */ -AVMetadataTag * -av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); +attribute_deprecated AVDictionaryEntry * +av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); /** * Set the given tag in *pm, overwriting an existing tag. @@ -143,30 +147,32 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f * Passing a NULL value will cause an existing tag to be deleted. * @return >= 0 on success otherwise an error code <0 */ -int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags); +attribute_deprecated int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags); -#if FF_API_OLD_METADATA2 /** * This function is provided for compatibility reason and currently does nothing. */ attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv); -#endif /** - * Copy metadata from one AVMetadata struct into another. - * @param dst pointer to a pointer to a AVMetadata struct. If *dst is NULL, + * Copy metadata from one AVDictionary struct into another. + * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVMetadata struct + * @param src pointer to source AVDictionary struct * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_METADATA_IGNORE_SUFFIX flag + * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag */ -void av_metadata_copy(AVMetadata **dst, AVMetadata *src, int flags); +attribute_deprecated void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags); /** - * Free all the memory allocated for an AVMetadata struct. + * Free all the memory allocated for an AVDictionary struct. */ -void av_metadata_free(AVMetadata **m); +attribute_deprecated void av_metadata_free(AVDictionary **m); +/** + * @} + */ +#endif /* packet functions */ @@ -563,7 +569,7 @@ typedef struct AVStream { */ AVRational sample_aspect_ratio; - AVMetadata *metadata; + AVDictionary *metadata; /* Intended mostly for av_read_frame() support. Not supposed to be used by */ /* external applications; try to use something else if at all possible. */ @@ -644,7 +650,7 @@ typedef struct AVProgram { enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller unsigned int *stream_index; unsigned int nb_stream_indexes; - AVMetadata *metadata; + AVDictionary *metadata; int program_num; int pmt_pid; @@ -658,7 +664,7 @@ typedef struct AVChapter { int id; ///< unique ID to identify the chapter AVRational time_base; ///< time base in which the start/end timestamps are specified int64_t start, end; ///< chapter start/end time in time_base units - AVMetadata *metadata; + AVDictionary *metadata; } AVChapter; /** @@ -824,7 +830,7 @@ typedef struct AVFormatContext { struct AVPacketList *packet_buffer_end; - AVMetadata *metadata; + AVDictionary *metadata; /** * Remaining size available for raw_packet_buffer, in bytes. |