[FFmpeg-devel] [PATCH 2/5] metadata: add new conversion API

Baptiste Coudurier baptiste.coudurier
Mon Oct 4 00:52:54 CEST 2010


On 10/3/10 12:51 PM, Michael Niedermayer wrote:
> On Sun, Oct 03, 2010 at 09:14:23PM +0200, Anton Khirnov wrote:
>> From: Anton Khirnov <wyskas at gmail.com>
>>
>> Track current metadata format in AVMetadata and add av_metadata_clone()
>> function for copying/replacing metadata.
> [...]
>> index 362a056..a9fb39f 100644
>> --- a/libavformat/avformat.h
>> +++ b/libavformat/avformat.h
>> @@ -198,6 +198,22 @@ void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv,
>>                                                     const AVMetadataConv *s_conv);
>>  
>>  /**
>> + * Copy metadata from src to dst, converting between their respective formats.
>> + * dst may be equal to src -- for in-place conversion -- or empty (i.e. a
>> + * pointer to NULL), in both cases it is initialized to dst_fmt format.
>> + * Otherwise dst_fmt is ignored. src may be a pointer to NULL, in which case
>> + * dst is initialized, but nothing is copied.
>> + *
>> + * @param pattern Used to copy only some keys. If non-NULL, it is passed
>> + *                directly to av_metadata_get().
>> + * @param flags   Passed directly to av_metadata_get/set. If pattern is NULL,
>> + *                defaults to AV_METADATA_IGNORE_SUFFIX|AV_METADATA_DONT_OVERWRITE.
>> + * @return >= 0 on success otherwise an error code <0
>> + */
>> +int av_metadata_clone(AVMetadata **src, AVMetadata **dst, const AVMetadataConv *dst_fmt,
>> +                      const char *pattern, int flags);
> 
> in all calls src==dst
> 
> where would that not be so?

You want to print "intelligible" metadata in dump_format, this is not
done currently, but should.

The easiest way is to create a new AVMetadata and translate.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list