Commit 7fdf245a authored by Anssi Hannula's avatar Anssi Hannula

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: 's avatarAnssi Hannula <anssi.hannula@iki.fi>
parent d52882fa
This diff is collapsed.
...@@ -95,7 +95,21 @@ int ff_id3v2_match(const uint8_t *buf, const char *magic); ...@@ -95,7 +95,21 @@ int ff_id3v2_match(const uint8_t *buf, const char *magic);
int ff_id3v2_tag_len(const uint8_t *buf); 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 * @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 * ID3v2ExtraMeta structs and *extra_meta points to the head of the list
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment