int len; ///< size of the tag written so far
} ID3v2EncContext;
-typedef struct ID3v2ExtraMeta {
- const char *tag;
- void *data;
- struct ID3v2ExtraMeta *next;
-} ID3v2ExtraMeta;
-
typedef struct ID3v2ExtraMetaGEOB {
uint32_t datasize;
uint8_t *mime_type;
AVDictionary *meta;
} ID3v2ExtraMetaCHAP;
+typedef struct ID3v2ExtraMeta {
+ const char *tag;
+ struct ID3v2ExtraMeta *next;
+ union {
+ ID3v2ExtraMetaAPIC apic;
+ ID3v2ExtraMetaCHAP chap;
+ ID3v2ExtraMetaGEOB geob;
+ ID3v2ExtraMetaPRIV priv;
+ } data;
+} ID3v2ExtraMeta;
+
/**
* Detect ID3v2 Header.
* @param buf must be ID3v2_HEADER_SIZE byte long
* Create a stream for each APIC (attached picture) extracted from the
* ID3v2 header.
*/
-int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
+int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta *extra_meta);
/**
* Create chapters for all CHAP tags found in the ID3v2 header.
*/
-int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
+int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *extra_meta);
/**
* Parse PRIV tags into a dictionary. The PRIV owner is the metadata key. The
* PRIV data is the value, with non-printable characters escaped.
*/
-int ff_id3v2_parse_priv_dict(AVDictionary **d, ID3v2ExtraMeta **extra_meta);
+int ff_id3v2_parse_priv_dict(AVDictionary **d, ID3v2ExtraMeta *extra_meta);
/**
* Add metadata for all PRIV tags in the ID3v2 header. The PRIV owner is the
* metadata key. The PRIV data is the value, with non-printable characters
* escaped.
*/
-int ff_id3v2_parse_priv(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
+int ff_id3v2_parse_priv(AVFormatContext *s, ID3v2ExtraMeta *extra_meta);
extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
extern const AVMetadataConv ff_id3v2_4_metadata_conv[];