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

Michael Niedermayer michaelni
Mon Oct 4 02:07:04 CEST 2010


On Sun, Oct 03, 2010 at 03:52:54PM -0700, Baptiste Coudurier wrote:
> 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.

I imagined that the new metadata api would either
export 2 AVMetadata sets (one unchanged and one converted to generic tags)
OR
that there would be a flag that specifies which of the 2 variants should be
exported by a demuxer.

This is a consequence of the Convertion tables to have been found insufficient
by anton and i prefer not to have ugly callbacks if it can be avoided ...

Within that imaginagtion metadata translation would happen inside the
(de)muxers. And alot of complexity would become unneeded i think, this
function in that form too possibly

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101004/5b4f532b/attachment.pgp>



More information about the ffmpeg-devel mailing list