41 while (*str && *str < 128) str++;
104 if (t->
key[0] !=
'T' || strlen(t->
key) != 4)
107 for (i = 0; *table[i]; i++)
167 const char *mimetype =
NULL, *desc =
"";
170 int i,
len, type = 0;
175 mimetype = mime->
str;
182 "write an attached picture.\n", st->
index);
void avio_wl16(AVIOContext *s, unsigned int val)
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int len
size of the tag written so far
int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
Convert and write all global metadata from s into an ID3v2 tag.
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char ff_id3v2_4_tags[][4]
ID3v2.4-only text information frames.
#define FF_ARRAY_ELEMS(a)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, const char *magic)
Initialize an ID3v2 tag.
#define ID3v2_HEADER_SIZE
const AVMetadataConv ff_id3v2_34_metadata_conv[]
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
const AVMetadataConv ff_id3v2_4_metadata_conv[]
static int string_is_ascii(const uint8_t *str)
void av_log(void *avcl, int level, const char *fmt,...)
const char * ff_id3v2_picture_types[21]
AVCodecContext * codec
Codec context associated with this stream.
const CodecMime ff_id3v2_mime_tags[]
int64_t size_pos
offset of the tag total size
int av_strcasecmp(const char *a, const char *b)
if(ac->has_optimized_func)
int avio_put_str(AVIOContext *s, const char *str)
Write a NULL-terminated string.
const char ff_id3v2_tags[][4]
A list of text information frames allowed in both ID3 v2.3 and v2.4 http://www.id3.org/id3v2.4.0-frames http://www.id3.org/id3v2.4.0-changes.
AVIOContext * pb
I/O context.
static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t, const char table[][4], enum ID3v2Encoding enc)
void avio_w8(AVIOContext *s, int b)
int avio_put_str16le(AVIOContext *s, const char *str)
Convert an UTF-8 string to UTF-16LE and write it.
static void id3v2_encode_string(AVIOContext *pb, const uint8_t *str, enum ID3v2Encoding enc)
int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version, const char *magic)
Write an ID3v2 tag containing all global metadata from s.
void avio_wb16(AVIOContext *s, unsigned int val)
static int id3v2_put_ttag(ID3v2EncContext *id3, AVIOContext *avioc, const char *str1, const char *str2, uint32_t tag, enum ID3v2Encoding enc)
Write a text frame with one (normal frames) or two (TXXX frames) strings according to encoding (only ...
static void id3v2_put_size(AVIOContext *pb, int size)
#define MKBETAG(a, b, c, d)
const char ff_id3v2_3_tags[][4]
ID3v2.3-only text information frames.
int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt)
Write an attached picture from pkt into an ID3v2 tag.
void avio_wb32(AVIOContext *s, unsigned int val)
#define AV_DICT_IGNORE_SUFFIX
int version
ID3v2 minor version, either 3 or 4.
This structure stores compressed data.
void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb)
Finalize an opened ID3v2 tag.