comparison avformat.h @ 4617:f04bc8b70940 libavformat

add a metadata conversion API
author aurel
date Sat, 28 Feb 2009 23:34:16 +0000
parents af7b24671b7d
children 5b9eddbee9c4
comparison
equal deleted inserted replaced
4616:5315c722e61e 4617:f04bc8b70940
43 #include <time.h> 43 #include <time.h>
44 #include <stdio.h> /* FILE */ 44 #include <stdio.h> /* FILE */
45 #include "libavcodec/avcodec.h" 45 #include "libavcodec/avcodec.h"
46 46
47 #include "avio.h" 47 #include "avio.h"
48
49 struct AVFormatContext;
48 50
49 51
50 /* 52 /*
51 * Public Metadata API. 53 * Public Metadata API.
52 * !!WARNING!! This is a work in progress. Don't use outside FFmpeg for now. 54 * !!WARNING!! This is a work in progress. Don't use outside FFmpeg for now.
75 char *key; 77 char *key;
76 char *value; 78 char *value;
77 }AVMetadataTag; 79 }AVMetadataTag;
78 80
79 typedef struct AVMetadata AVMetadata; 81 typedef struct AVMetadata AVMetadata;
82 typedef struct AVMetadataConv AVMetadataConv;
80 83
81 /** 84 /**
82 * Gets a metadata element with matching key. 85 * Gets a metadata element with matching key.
83 * @param prev Set to the previous matching element to find the next. 86 * @param prev Set to the previous matching element to find the next.
84 * @param flags Allows case as well as suffix-insensitive comparisons. 87 * @param flags Allows case as well as suffix-insensitive comparisons.
92 * @param key tag key to add to m (will be av_strduped) 95 * @param key tag key to add to m (will be av_strduped)
93 * @param value tag value to add to m (will be av_strduped) 96 * @param value tag value to add to m (will be av_strduped)
94 * @return >= 0 on success otherwise an error code <0 97 * @return >= 0 on success otherwise an error code <0
95 */ 98 */
96 int av_metadata_set(AVMetadata **pm, const char *key, const char *value); 99 int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
100
101 /**
102 * Convert all the metadata sets from ctx according to the source and
103 * destination conversion tables.
104 * @param d_conv destination tags format conversion table
105 * @param s_conv source tags format conversion table
106 */
107 void av_metadata_conv(struct AVFormatContext *ctx,const AVMetadataConv *d_conv,
108 const AVMetadataConv *s_conv);
97 109
98 /** 110 /**
99 * Frees all the memory allocated for an AVMetadata struct. 111 * Frees all the memory allocated for an AVMetadata struct.
100 */ 112 */
101 void av_metadata_free(AVMetadata **m); 113 void av_metadata_free(AVMetadata **m);
217 229
218 /*************************************************/ 230 /*************************************************/
219 /* input/output formats */ 231 /* input/output formats */
220 232
221 struct AVCodecTag; 233 struct AVCodecTag;
222
223 struct AVFormatContext;
224 234
225 /** This structure contains the data a format has to probe a file. */ 235 /** This structure contains the data a format has to probe a file. */
226 typedef struct AVProbeData { 236 typedef struct AVProbeData {
227 const char *filename; 237 const char *filename;
228 unsigned char *buf; 238 unsigned char *buf;
297 */ 307 */
298 const struct AVCodecTag * const *codec_tag; 308 const struct AVCodecTag * const *codec_tag;
299 309
300 enum CodecID subtitle_codec; /**< default subtitle codec */ 310 enum CodecID subtitle_codec; /**< default subtitle codec */
301 311
312 AVMetadataConv *metadata_conv;
313
302 /* private fields */ 314 /* private fields */
303 struct AVOutputFormat *next; 315 struct AVOutputFormat *next;
304 } AVOutputFormat; 316 } AVOutputFormat;
305 317
306 typedef struct AVInputFormat { 318 typedef struct AVInputFormat {
375 * Seeking will be done so that the point from which all active streams 387 * Seeking will be done so that the point from which all active streams
376 * can be presented successfully will be closest to ts and within min/max_ts. 388 * can be presented successfully will be closest to ts and within min/max_ts.
377 * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. 389 * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
378 */ 390 */
379 int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); 391 int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
392
393 AVMetadataConv *metadata_conv;
380 394
381 /* private fields */ 395 /* private fields */
382 struct AVInputFormat *next; 396 struct AVInputFormat *next;
383 } AVInputFormat; 397 } AVInputFormat;
384 398