Mercurial > libavformat.hg
comparison id3v2.h @ 6121:81614e9b541b libavformat
Generalize ID3v2 functions to support ID3v2-like ID headers with a
different magic in the header (mainly targeted to Sony's .oma/.aa3
format).
Patch by Michael Karcher, ffmpeg A mkarcher dialup fu-berlin de
author | cehoyos |
---|---|
date | Fri, 11 Jun 2010 13:44:57 +0000 |
parents | 2568a59ac5fe |
children | fa244b4fe683 |
comparison
equal
deleted
inserted
replaced
6120:a2a55244ca6b | 6121:81614e9b541b |
---|---|
27 #include "metadata.h" | 27 #include "metadata.h" |
28 | 28 |
29 #define ID3v2_HEADER_SIZE 10 | 29 #define ID3v2_HEADER_SIZE 10 |
30 | 30 |
31 /** | 31 /** |
32 * Default magic bytes for ID3v2 header: "ID3" | |
33 */ | |
34 #define ID3v2_DEFAULT_MAGIC "ID3" | |
35 | |
36 /** | |
32 * Detects ID3v2 Header. | 37 * Detects ID3v2 Header. |
33 * @buf must be ID3v2_HEADER_SIZE byte long | 38 * @buf must be ID3v2_HEADER_SIZE byte long |
39 * @magic magic bytes to identify the header, machine byte order. | |
40 * If in doubt, use ID3v2_DEFAULT_MAGIC. | |
34 */ | 41 */ |
35 int ff_id3v2_match(const uint8_t *buf); | 42 int ff_id3v2_match(const uint8_t *buf, const char *magic); |
36 | 43 |
37 /** | 44 /** |
38 * Gets the length of an ID3v2 tag. | 45 * Gets the length of an ID3v2 tag. |
39 * @buf must be ID3v2_HEADER_SIZE bytes long and point to the start of an | 46 * @buf must be ID3v2_HEADER_SIZE bytes long and point to the start of an |
40 * already detected ID3v2 tag | 47 * already detected ID3v2 tag |
48 void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags); | 55 void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags); |
49 | 56 |
50 /** | 57 /** |
51 * Read an ID3v2 tag | 58 * Read an ID3v2 tag |
52 */ | 59 */ |
53 void ff_id3v2_read(AVFormatContext *s); | 60 void ff_id3v2_read(AVFormatContext *s, const char *magic); |
54 | 61 |
55 extern const AVMetadataConv ff_id3v2_metadata_conv[]; | 62 extern const AVMetadataConv ff_id3v2_metadata_conv[]; |
56 | 63 |
57 /** | 64 /** |
58 * A list of ID3v2.4 text information frames. | 65 * A list of ID3v2.4 text information frames. |