[FFmpeg-devel] [PATCH 2/5] metadata: add new conversion API
Michael Niedermayer
michaelni
Mon Oct 4 12:40:48 CEST 2010
On Mon, Oct 04, 2010 at 08:37:23AM +0200, Anton Khirnov wrote:
> On Mon, Oct 04, 2010 at 02:07:04AM +0200, Michael Niedermayer wrote:
> > 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.
> iirc the original reason why the demuxers export metadata in native
> format is so it can be losslessly muxed to the same format --
> av_metadata_conv() with identical conv tables is a noop. if what you're
> proposing is done then it stops making sense to export the native format
> at all, so we might as well export only generic.
>
> which OTOH might be exactly what we should do. or is anybody aware of
> anyother reason to export native format?
some people simply might dislike not seeing exactly what is stored in the file
like auth:blah but rather Author:blah
iam not one of them and i dont really see the need myself ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/6e207eb6/attachment.pgp>
More information about the ffmpeg-devel
mailing list