Lines Matching refs:id3
66 static int id3v2_put_ttag(ID3v2EncContext *id3, AVIOContext *avioc, const char *str1, const char *s… in id3v2_put_ttag() argument
89 if (id3->version == 3) in id3v2_put_ttag()
105 static int id3v2_put_priv(ID3v2EncContext *id3, AVIOContext *avioc, const char *key, const char *da… in id3v2_put_priv() argument
141 if (id3->version == 3) in id3v2_put_priv()
153 static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t, in id3v2_check_write_tag() argument
164 return id3v2_put_ttag(id3, pb, t->value, NULL, tag, enc); in id3v2_check_write_tag()
206 void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, in ff_id3v2_start() argument
209 id3->version = id3v2_version; in ff_id3v2_start()
216 id3->size_pos = avio_tell(pb); in ff_id3v2_start()
221 ID3v2EncContext *id3, int enc) in write_metadata() argument
227 if (id3->version == 3) in write_metadata()
229 else if (id3->version == 4) in write_metadata()
233 if ((ret = id3v2_check_write_tag(id3, pb, t, ff_id3v2_tags, enc)) > 0) { in write_metadata()
234 id3->len += ret; in write_metadata()
237 if ((ret = id3v2_check_write_tag(id3, pb, t, id3->version == 3 ? in write_metadata()
239 id3->len += ret; in write_metadata()
243 if ((ret = id3v2_put_priv(id3, pb, t->key, t->value)) > 0) { in write_metadata()
244 id3->len += ret; in write_metadata()
251 if ((ret = id3v2_put_ttag(id3, pb, t->key, t->value, MKBETAG('T', 'X', 'X', 'X'), enc)) < 0) in write_metadata()
253 id3->len += ret; in write_metadata()
259 static int write_ctoc(AVFormatContext *s, ID3v2EncContext *id3, int enc) in write_ctoc() argument
280 id3->len += len + ID3v2_HEADER_SIZE; in write_ctoc()
292 static int write_chapter(AVFormatContext *s, ID3v2EncContext *id3, int id, int enc) in write_chapter() argument
308 id3->len += avio_put_str(dyn_bc, name); in write_chapter()
314 if ((ret = write_metadata(dyn_bc, &ch->metadata, id3, enc)) < 0) in write_chapter()
318 id3->len += 16 + ID3v2_HEADER_SIZE; in write_chapter()
331 int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3) in ff_id3v2_write_metadata() argument
333 int enc = id3->version == 3 ? ID3v2_ENCODING_UTF16BOM : in ff_id3v2_write_metadata()
338 if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0) in ff_id3v2_write_metadata()
341 if ((ret = write_ctoc(s, id3, enc)) < 0) in ff_id3v2_write_metadata()
345 if ((ret = write_chapter(s, id3, i, enc)) < 0) in ff_id3v2_write_metadata()
352 int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt) in ff_id3v2_write_apic() argument
361 int enc = id3->version == 3 ? ID3v2_ENCODING_UTF16BOM : in ff_id3v2_write_apic()
408 if (id3->version == 3) in ff_id3v2_write_apic()
416 id3->len += len + ID3v2_HEADER_SIZE; in ff_id3v2_write_apic()
421 void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb, in ff_id3v2_finish() argument
435 padding_bytes = av_clip(padding_bytes, 10, 268435455 - id3->len); in ff_id3v2_finish()
437 id3->len += padding_bytes; in ff_id3v2_finish()
440 avio_seek(pb, id3->size_pos, SEEK_SET); in ff_id3v2_finish()
441 id3v2_put_size(pb, id3->len); in ff_id3v2_finish()
448 ID3v2EncContext id3 = { 0 }; in ff_id3v2_write_simple() local
451 ff_id3v2_start(&id3, s->pb, id3v2_version, magic); in ff_id3v2_write_simple()
452 if ((ret = ff_id3v2_write_metadata(s, &id3)) < 0) in ff_id3v2_write_simple()
454 ff_id3v2_finish(&id3, s->pb, s->metadata_header_padding); in ff_id3v2_write_simple()