ReactOS 0.4.16-dev-122-g325d74c
|
Modules | |
mpg123 advanced parameter API | |
Classes | |
struct | mpg123_string |
struct | mpg123_text |
struct | mpg123_picture |
struct | mpg123_id3v2 |
struct | mpg123_id3v1 |
Macros | |
#define | MPG123_ID3 0x3 |
#define | MPG123_NEW_ID3 0x1 |
#define | MPG123_ICY 0xc |
#define | MPG123_NEW_ICY 0x4 |
Functions to retrieve the metadata from MPEG Audio files and streams. Also includes string handling functions.
#define MPG123_ICY 0xc |
#define MPG123_ID3 0x3 |
#define MPG123_NEW_ICY 0x4 |
#define MPG123_NEW_ID3 0x1 |
The encoding byte values from ID3v2.
Enumerator | |
---|---|
mpg123_id3_latin1 | Note: This sometimes can mean anything in practice... |
mpg123_id3_utf16bom | UTF16, UCS-2 ... it's all the same for practical purposes. |
mpg123_id3_utf16be | Big-endian UTF-16, BOM see note for mpg123_text_utf16be. |
mpg123_id3_utf8 | Our lovely overly ASCII-compatible 8 byte encoding for the world. |
mpg123_id3_enc_max | Placeholder to check valid range of encoding byte. |
Definition at line 1342 of file mpg123.h.
The picture type values from ID3v2.
Definition at line 1384 of file mpg123.h.
The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info.
Definition at line 1322 of file mpg123.h.
MPG123_EXPORT int mpg123_add_string | ( | mpg123_string * | sb, |
const char * | stuff | ||
) |
Append a C-String to an mpg123_string
sb | string handle |
stuff | to append |
Definition at line 135 of file stringbuf.c.
Referenced by mpg123_set_string().
MPG123_EXPORT int mpg123_add_substring | ( | mpg123_string * | sb, |
const char * | stuff, | ||
size_t | from, | ||
size_t | count | ||
) |
Append a C-substring to an mpg123 string
sb | string handle |
stuff | content to copy |
from | offset to copy from |
count | number of characters to copy (a null-byte is always appended) |
Definition at line 141 of file stringbuf.c.
Referenced by mpg123_add_string(), and mpg123_set_substring().
MPG123_EXPORT int mpg123_chomp_string | ( | mpg123_string * | sb | ) |
Remove trailing \r and \n, if present.
sb | string handle |
Definition at line 218 of file stringbuf.c.
MPG123_EXPORT int mpg123_copy_string | ( | mpg123_string * | from, |
mpg123_string * | to | ||
) |
Copy the contents of one mpg123_string string to another. Yes the order of arguments is reversed compated to memcpy().
from | string handle |
to | string handle |
Definition at line 93 of file stringbuf.c.
MPG123_EXPORT void mpg123_delete_string | ( | mpg123_string * | sb | ) |
Free memory of contents and the string structure itself.
sb | string handle |
Definition at line 27 of file stringbuf.c.
MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3 | ( | unsigned char | id3_enc_byte | ) |
Convert ID3 encoding byte to mpg123 encoding index.
id3_enc_byte | the ID3 encoding code |
Definition at line 1591 of file libmpg123.c.
MPG123_EXPORT void mpg123_free_string | ( | mpg123_string * | sb | ) |
Free-up memory of the contents of an mpg123_string (not the struct itself). This also calls mpg123_init_string() and hence is safe to be called repeatedly.
sb | string handle |
Definition at line 43 of file stringbuf.c.
Referenced by free_mpg123_picture(), free_mpg123_text(), mpg123_delete_string(), mpg123_move_string(), mpg123_store_utf8(), process_comment(), process_extra(), and process_picture().
MPG123_EXPORT int mpg123_grow_string | ( | mpg123_string * | sb, |
size_t | news | ||
) |
Increase size of a mpg123_string if necessary (it may stay larger). Note that the functions for adding and setting in current libmpg123 use this instead of mpg123_resize_string(). That way, you can preallocate memory and safely work afterwards with pieces.
sb | string handle |
news | new minimum size |
Definition at line 51 of file stringbuf.c.
Referenced by convert_latin1(), convert_utf16bom(), convert_utf8(), mpg123_add_substring(), and store_id3_text().
MPG123_EXPORT int mpg123_icy | ( | mpg123_handle * | mh, |
char ** | icy_meta | ||
) |
Point icy_meta to existing data structure wich may change on any next read/decode function call.
mh | handle |
icy_meta | return address for ICY meta string (set to NULL if nothing there) |
Definition at line 1557 of file libmpg123.c.
MPG123_EXPORT char * mpg123_icy2utf8 | ( | const char * | icy_text | ) |
Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8. Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) .
icy_text | The input data in ICY encoding |
Definition at line 1581 of file libmpg123.c.
MPG123_EXPORT int mpg123_id3 | ( | mpg123_handle * | mh, |
mpg123_id3v1 ** | v1, | ||
mpg123_id3v2 ** | v2 | ||
) |
Point v1 and v2 to existing data structures wich may change on any next read/decode function call. v1 and/or v2 can be set to NULL when there is no corresponding data.
Definition at line 1517 of file libmpg123.c.
MPG123_EXPORT int mpg123_id3_raw | ( | mpg123_handle * | mh, |
unsigned char ** | v1, | ||
size_t * | v1_size, | ||
unsigned char ** | v2, | ||
size_t * | v2_size | ||
) |
Return pointers to and size of stored raw ID3 data if storage has been configured with MPG123_RAW_ID3 and stream parsing passed the metadata already. Null value with zero size is a possibility! The storage can change at any next API call.
v1 | address to store pointer to v1 tag |
v1_size | size of v1 data in bytes |
v2 | address to store pointer to v2 tag |
v2_size | size of v2 data in bytes |
Definition at line 1540 of file libmpg123.c.
MPG123_EXPORT void mpg123_init_string | ( | mpg123_string * | sb | ) |
Initialize an existing mpg123_string structure to {NULL, 0, 0}. If you hand in a NULL pointer here, your program should crash. The other string functions are more forgiving, but this one here is too basic.
sb | string handle (address of existing structure on your side) |
Definition at line 35 of file stringbuf.c.
Referenced by init_mpg123_picture(), init_mpg123_text(), mpg123_free_string(), mpg123_move_string(), mpg123_new_string(), mpg123_resize_string(), process_comment(), process_extra(), and process_picture().
MPG123_EXPORT int mpg123_meta_check | ( | mpg123_handle * | mh | ) |
Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
mh | handle |
Definition at line 1503 of file libmpg123.c.
MPG123_EXPORT void mpg123_meta_free | ( | mpg123_handle * | mh | ) |
Clean up meta data storage (ID3v2 and ICY), freeing memory.
mh | handle |
Definition at line 1509 of file libmpg123.c.
MPG123_EXPORT int mpg123_move_string | ( | mpg123_string * | from, |
mpg123_string * | to | ||
) |
Move the contents of one mpg123_string string to another. This frees any memory associated with the target and moves over the pointers from the source, leaving the source without content after that. The only possible error is that you hand in NULL pointers. If you handed in a valid source, its contents will be gone, even if there was no target to move to. If you hand in a valid target, its original contents will also always be gone, to be replaced with the source's contents if there was some.
from | source string handle |
to | target string handle |
Definition at line 122 of file stringbuf.c.
Referenced by process_comment(), process_extra(), and process_picture().
MPG123_EXPORT mpg123_string * mpg123_new_string | ( | const char * | val | ) |
Allocate and intialize a new string.
val | optional initial string value (can be NULL) |
Definition at line 17 of file stringbuf.c.
MPG123_EXPORT int mpg123_resize_string | ( | mpg123_string * | sb, |
size_t | news | ||
) |
Change the size of a mpg123_string
sb | string handle |
news | new size in bytes |
Definition at line 59 of file stringbuf.c.
Referenced by mpg123_copy_string(), and mpg123_grow_string().
MPG123_EXPORT int mpg123_same_string | ( | mpg123_string * | a, |
mpg123_string * | b | ||
) |
Determine if two strings contain the same data. This only returns 1 if both given handles are non-NULL and if they are filled with the same bytes.
a | first string handle |
b | second string handle |
Definition at line 241 of file stringbuf.c.
Referenced by add_id3_picture(), and add_id3_text().
MPG123_EXPORT int mpg123_set_string | ( | mpg123_string * | sb, |
const char * | stuff | ||
) |
Set the content of a mpg123_string to a C-string
sb | string handle |
stuff | content to copy |
Definition at line 178 of file stringbuf.c.
Referenced by mpg123_new_string(), and mpg123_store_utf8().
MPG123_EXPORT int mpg123_set_substring | ( | mpg123_string * | sb, |
const char * | stuff, | ||
size_t | from, | ||
size_t | count | ||
) |
Set the content of a mpg123_string to a C-substring
sb | string handle |
stuff | the future content |
from | offset to copy from |
count | number of characters to copy (a null-byte is always appended) |
Definition at line 170 of file stringbuf.c.
MPG123_EXPORT int mpg123_store_utf8 | ( | mpg123_string * | sb, |
enum mpg123_text_encoding | enc, | ||
const unsigned char * | source, | ||
size_t | source_size | ||
) |
Store text data in string, after converting to UTF-8 from indicated encoding A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing). Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
sb | target string |
enc | mpg123 text encoding value |
source | source buffer with plain unsigned bytes (you might need to cast from signed char) |
source_size | number of bytes in the source buffer |
Definition at line 1604 of file libmpg123.c.
MPG123_EXPORT size_t mpg123_strlen | ( | mpg123_string * | sb, |
int | utf8 | ||
) |
Count characters in a mpg123 string (non-null bytes or Unicode points). This function is of limited use, as it does just count code points encoded in an UTF-8 string, only loosely related to the count of visible characters. Get your full Unicode handling support elsewhere.
sb | string handle |
utf8 | a flag to tell if the string is in utf8 encoding |
Definition at line 186 of file stringbuf.c.