45
46
ID3v2_ENCODING_UTF8 = 3,
49
typedef struct ID3v2EncContext {
50
int version; ///< ID3v2 minor version, either 3 or 4
51
int64_t size_pos; ///< offset of the tag total size
52
int len; ///< size of the tag written so far
48
55
typedef struct ID3v2ExtraMeta {
75
90
int ff_id3v2_tag_len(const uint8_t *buf);
78
* Read an ID3v2 tag (text tags only)
80
void ff_id3v2_read(AVFormatContext *s, const char *magic);
83
* Read an ID3v2 tag, including supported extra metadata (currently only GEOB)
93
* Read an ID3v2 tag, including supported extra metadata
84
94
* @param extra_meta If not NULL, extra metadata is parsed into a list of
85
95
* ID3v2ExtraMeta structs and *extra_meta points to the head of the list
87
void ff_id3v2_read_all(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
97
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
100
* Initialize an ID3v2 tag.
102
void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version,
106
* Convert and write all global metadata from s into an ID3v2 tag.
108
int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3);
111
* Write an attached picture from pkt into an ID3v2 tag.
113
int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt);
116
* Finalize an opened ID3v2 tag.
118
void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb);
121
* Write an ID3v2 tag containing all global metadata from s.
91
122
* @param id3v2_version Subversion of ID3v2; supported values are 3 and 4
92
123
* @param magic magic bytes to identify the header
93
124
* If in doubt, use ID3v2_DEFAULT_MAGIC.
95
int ff_id3v2_write(struct AVFormatContext *s, int id3v2_version, const char *magic);
126
int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version, const char *magic);
98
129
* Free memory allocated parsing special (non-text) metadata.
101
132
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta);
135
* Create a stream for each APIC (attached picture) extracted from the
138
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
103
140
extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
104
141
extern const AVMetadataConv ff_id3v2_4_metadata_conv[];