52 printf(
"chapter=%u time_base=%d/%d start=%"PRId64
" end=%"PRId64
" title=%s\n",
54 title ? title->
value :
"(missing)");
74 int size, chap_pos = -1,
ret = 1;
76 memset(long_title,
'L',
sizeof(long_title) - 1);
77 long_title[
sizeof(long_title) - 1] = 0;
96 for (
int i = 0;
i + 10 <=
size;
i++) {
97 if (!memcmp(buf +
i,
"CHAP", 4)) {
99 printf(
"CHAP size bytes=%02x %02x %02x %02x\n",
100 buf[
i + 4], buf[
i + 5], buf[
i + 6], buf[
i + 7]);
111 for (
int i = chap_pos + 10;
i + 10 <=
size;
i++) {
112 if (!memcmp(buf +
i,
"TIT2", 4)) {
113 memset(buf +
i + 4, 0x7f, 4);
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for reading.
#define i(width, name, range_min, range_max)
__device__ int printf(const char *,...)
AVChapter * avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base, int64_t start, int64_t end, const char *title)
Add a new chapter.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static AVRational av_make_q(int num, int den)
Create an AVRational.
int ff_id3v2_tag_len(const uint8_t *buf)
Get the length of an ID3v2 tag.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *cur)
Create chapters for all CHAP tags found in the ID3v2 header.
void ff_id3v2_read_dict(AVFormatContext *s, AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta)
Read an ID3v2 tag into specified dictionary and retrieve supported extra metadata.
void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, const char *magic)
Initialize the encoding context and write the header for a new ID3v2 tag.
void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb, int padding_bytes)
Finalize an opened ID3v2 tag.
#define ID3v2_DEFAULT_MAGIC
Default magic bytes for ID3v2 header: "ID3".
#define ID3v2_HEADER_SIZE
int ff_id3v2_write_metadata(AVFormatContext *s, AVIOContext *pb, ID3v2EncContext *id3)
Convert and write all global metadata from s into an ID3v2 tag.
static int readback(const uint8_t *buf, int size)
static int roundtrip(int version)
Memory handling functions.
int64_t end
chapter start/end time in time_base units
AVRational time_base
time base in which the start/end timestamps are specified
unsigned int nb_chapters
Number of chapters in AVChapter array.