On date Sunday 2011-06-05 09:07:58 +0200, Anton Khirnov encoded:
> Rename it to AVDictionary, since it will be used as such. Tags
> documentation and metadata conversion API is lavf-specific, so remains
> there.
> ---
> doc/APIchanges | 5 ++
> libavformat/avformat.h | 52 +++++++++++++----------
> libavformat/metadata.c | 103 +++++++++------------------------------------
> libavformat/metadata.h | 6 +--
> libavutil/Makefile | 2 +
> libavutil/avutil.h | 2 +-
> libavutil/dict.c | 110
> ++++++++++++++++++++++++++++++++++++++++++++++++
> libavutil/dict.h | 78 ++++++++++++++++++++++++++++++++++
> libavutil/internal.h | 6 +++
> 9 files changed, 252 insertions(+), 112 deletions(-)
> create mode 100644 libavutil/dict.c
> create mode 100644 libavutil/dict.h
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index a55b152..f9dc40a 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,11 @@ libavutil: 2011-04-18
>
> API changes, most recent first:
>
> +2011-06-xx - xxxxxxx - lavu 51.3.0 - AVMetadata
> + Move AVMetadata from lavf to lavu and rename it to
> + AVDictionary -- new installed header dict.h.
> + All av_metadata_* functions renamed to av_dict_*.
> +
> 2011-05-28 - 0420bd7 - lavu 51.2.0 - pixdesc.h
> Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
> avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 5b67211..5c82847 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 AVDictEntry AVMetadataTag;
Nit: I prefer:
AVDictionary -> AVDictionaryEntry
rather than
AVDictionary -> AVDictEntry
avoiding contractions in this case allows to show better the
relationship between the two structs, as it is done with:
AVMetadata -> AVMetadataTag
(alternatively, you could use AVDict -> AVDictEntry, though I have a
preference for the long form).
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel