diff options
author | Anssi Hannula <anssi.hannula@iki.fi> | 2013-12-30 10:02:59 +0200 |
---|---|---|
committer | Anssi Hannula <anssi.hannula@iki.fi> | 2013-12-31 05:15:19 +0200 |
commit | 7fdf245ab9cb06b7195b8554e0b56f0835d1a142 (patch) | |
tree | e91badc5330c75886bd492ecfce3b43bd665d1ea /libavformat/id3v2.h | |
parent | d52882faef368264f9fe5a595274ec84d3446132 (diff) | |
download | ffmpeg-7fdf245ab9cb06b7195b8554e0b56f0835d1a142.tar.gz |
avformat/id3v2: allow ID3 parsing without AVFormatContext
Add ff_id3v2_read_dict() for parsing without AVFormatContext, but
instead with AVIOContext and AVDictionary.
AVFormatContext is still used for logging, if available.
Chapter parsing is the only non-logging functionality that actually
needs AVFormatContext, and AFAICS it should be modified to write the
data to ID3v2ExtraMeta first, from where it can be implanted to
AVFormatContext by a separate function (like it is done with
read_apic() and ff_id3v2_parse_apic()). That is outside the scope of
this patch, though.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Diffstat (limited to 'libavformat/id3v2.h')
-rw-r--r-- | libavformat/id3v2.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h index 58970a1bb7..935e934311 100644 --- a/libavformat/id3v2.h +++ b/libavformat/id3v2.h @@ -95,7 +95,21 @@ int ff_id3v2_match(const uint8_t *buf, const char *magic); int ff_id3v2_tag_len(const uint8_t *buf); /** - * Read an ID3v2 tag, including supported extra metadata + * Read an ID3v2 tag into specified dictionary and retrieve supported extra metadata. + * + * Chapters are not currently read by this variant. + * + * @param metadata Parsed metadata is stored here + * @param extra_meta If not NULL, extra metadata is parsed into a list of + * ID3v2ExtraMeta structs and *extra_meta points to the head of the list + */ +void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta); + +/** + * Read an ID3v2 tag, including supported extra metadata and chapters. + * + * Data is read from and stored to AVFormatContext. + * * @param extra_meta If not NULL, extra metadata is parsed into a list of * ID3v2ExtraMeta structs and *extra_meta points to the head of the list */ |