mpg123 logo
download : svn :: features :: sf.net project - bug tracker :: news archive
libmpg123 API :: hacking :: testing :: benchmarking :: FAQ :: links :: contact
Note: This API doc is automatically generated from the current development version that you can get via Subversion or as a daily snapshot from http://mpg123.org/snapshot. There may be differences (additions) compared to the latest stable release. See NEWS.libmpg123 and the overall NEWS file on libmpg123 versions and important changes between them.
Let me emphasize that the policy for libmpg123 is to always stay backwards compatible -- only additions are planned (and it's not yet planned to change the plans;-).

mpg123.h

Go to the documentation of this file.
00001 /*
00002         libmpg123: MPEG Audio Decoder library (version 1.14.0)
00003 
00004         copyright 1995-2010 by the mpg123 project - free software under the terms of the LGPL 2.1
00005         see COPYING and AUTHORS files in distribution or http://mpg123.org
00006 */
00007 
00008 #ifndef MPG123_LIB_H
00009 #define MPG123_LIB_H
00010 
00013 /* A macro to check at compile time which set of API functions to expect.
00014    This should be incremented at least each time a new symbol is added to the header. */
00015 #define MPG123_API_VERSION 33
00016 
00017 /* These aren't actually in use... seems to work without using libtool. */
00018 #ifdef BUILD_MPG123_DLL
00019 /* The dll exports. */
00020 #define EXPORT __declspec(dllexport)
00021 #else
00022 #ifdef LINK_MPG123_DLL
00023 /* The exe imports. */
00024 #define EXPORT __declspec(dllimport)
00025 #else
00026 /* Nothing on normal/UNIX builds */
00027 #define EXPORT
00028 #endif
00029 #endif
00030 
00031 #ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */
00032 #include <stdlib.h>
00033 #include <sys/types.h>
00034 
00035 /* Simplified large file handling.
00036         I used to have a check here that prevents building for a library with conflicting large file setup
00037         (application that uses 32 bit offsets with library that uses 64 bits).
00038         While that was perfectly fine in an environment where there is one incarnation of the library,
00039         it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
00040         correct header matching the 32 bit library (where large files need explicit support) or
00041         the 64 bit library (where there is no distinction).
00042 
00043         New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
00044         and thus functions with added suffix (mpg123_open_64).
00045         Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
00046         building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
00047         Link failure is not the expected outcome of any half-sane usage anymore.
00048 
00049         More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
00050 */
00051 
00052 /*
00053         Now, the renaming of large file aware functions.
00054         By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
00055 */
00056 #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
00057 
00058 /* Need some trickery to concatenate the value(s) of the given macro(s). */
00059 #define MPG123_MACROCAT_REALLY(a, b) a ## b
00060 #define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b)
00061 #ifndef MPG123_LARGESUFFIX
00062 #define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS)
00063 #endif
00064 #define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX)
00065 
00066 #define mpg123_open         MPG123_LARGENAME(mpg123_open)
00067 #define mpg123_open_fd      MPG123_LARGENAME(mpg123_open_fd)
00068 #define mpg123_open_handle  MPG123_LARGENAME(mpg123_open_handle)
00069 #define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode)
00070 #define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame)
00071 #define mpg123_tell         MPG123_LARGENAME(mpg123_tell)
00072 #define mpg123_tellframe    MPG123_LARGENAME(mpg123_tellframe)
00073 #define mpg123_tell_stream  MPG123_LARGENAME(mpg123_tell_stream)
00074 #define mpg123_seek         MPG123_LARGENAME(mpg123_seek)
00075 #define mpg123_feedseek     MPG123_LARGENAME(mpg123_feedseek)
00076 #define mpg123_seek_frame   MPG123_LARGENAME(mpg123_seek_frame)
00077 #define mpg123_timeframe    MPG123_LARGENAME(mpg123_timeframe)
00078 #define mpg123_index        MPG123_LARGENAME(mpg123_index)
00079 #define mpg123_set_index    MPG123_LARGENAME(mpg123_set_index)
00080 #define mpg123_position     MPG123_LARGENAME(mpg123_position)
00081 #define mpg123_length       MPG123_LARGENAME(mpg123_length)
00082 #define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize)
00083 #define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader)
00084 #define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle)
00085 #define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
00086 
00087 #endif /* largefile hackery */
00088 
00089 #endif /* MPG123_NO_CONFIGURE */
00090 
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094 
00105 struct mpg123_handle_struct;
00106 
00110 typedef struct mpg123_handle_struct mpg123_handle;
00111 
00117 EXPORT int  mpg123_init(void);
00118 
00121 EXPORT void mpg123_exit(void);
00122 
00129 EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
00130 
00132 EXPORT void mpg123_delete(mpg123_handle *mh);
00133 
00135 enum mpg123_parms
00136 {
00137         MPG123_VERBOSE,        
00138         MPG123_FLAGS,          
00139         MPG123_ADD_FLAGS,      
00140         MPG123_FORCE_RATE,     
00141         MPG123_DOWN_SAMPLE,    
00142         MPG123_RVA,            
00143         MPG123_DOWNSPEED,      
00144         MPG123_UPSPEED,        
00145         MPG123_START_FRAME,    
00146         MPG123_DECODE_FRAMES,  
00147         MPG123_ICY_INTERVAL,   
00148         MPG123_OUTSCALE,       
00149         MPG123_TIMEOUT,        
00150         MPG123_REMOVE_FLAGS,   
00151         MPG123_RESYNC_LIMIT,   
00152         MPG123_INDEX_SIZE      
00153         ,MPG123_PREFRAMES 
00154         ,MPG123_FEEDPOOL  
00155         ,MPG123_FEEDBUFFER 
00156 };
00157 
00159 enum mpg123_param_flags
00160 {
00161          MPG123_FORCE_MONO   = 0x7  
00162         ,MPG123_MONO_LEFT    = 0x1  
00163         ,MPG123_MONO_RIGHT   = 0x2  
00164         ,MPG123_MONO_MIX     = 0x4  
00165         ,MPG123_FORCE_STEREO = 0x8  
00166         ,MPG123_FORCE_8BIT   = 0x10 
00167         ,MPG123_QUIET        = 0x20 
00168         ,MPG123_GAPLESS      = 0x40 
00169         ,MPG123_NO_RESYNC    = 0x80 
00170         ,MPG123_SEEKBUFFER   = 0x100 
00171         ,MPG123_FUZZY        = 0x200 
00172         ,MPG123_FORCE_FLOAT  = 0x400 
00173         ,MPG123_PLAIN_ID3TEXT = 0x800 
00174         ,MPG123_IGNORE_STREAMLENGTH = 0x1000 
00175         ,MPG123_SKIP_ID3V2 = 0x2000 
00176         ,MPG123_IGNORE_INFOFRAME = 0x4000 
00177 };
00178 
00180 enum mpg123_param_rva
00181 {
00182          MPG123_RVA_OFF   = 0 
00183         ,MPG123_RVA_MIX   = 1 
00184         ,MPG123_RVA_ALBUM = 2 
00185         ,MPG123_RVA_MAX   = MPG123_RVA_ALBUM 
00186 };
00187 
00188 /* TODO: Assess the possibilities and troubles of changing parameters during playback. */
00189 
00192 EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue);
00193 
00196 EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval);
00197 
00199 enum mpg123_feature_set
00200 {
00201          MPG123_FEATURE_ABI_UTF8OPEN = 0     
00202         ,MPG123_FEATURE_OUTPUT_8BIT          
00203         ,MPG123_FEATURE_OUTPUT_16BIT         
00204         ,MPG123_FEATURE_OUTPUT_32BIT         
00205         ,MPG123_FEATURE_INDEX                
00206         ,MPG123_FEATURE_PARSE_ID3V2          
00207         ,MPG123_FEATURE_DECODE_LAYER1        
00208         ,MPG123_FEATURE_DECODE_LAYER2        
00209         ,MPG123_FEATURE_DECODE_LAYER3        
00210         ,MPG123_FEATURE_DECODE_ACCURATE      
00211         ,MPG123_FEATURE_DECODE_DOWNSAMPLE    
00212         ,MPG123_FEATURE_DECODE_NTOM          
00213         ,MPG123_FEATURE_PARSE_ICY            
00214         ,MPG123_FEATURE_TIMEOUT_READ         
00215 };
00216 
00218 EXPORT int mpg123_feature(const enum mpg123_feature_set key);
00219 
00220 /* @} */
00221 
00222 
00236 enum mpg123_errors
00237 {
00238         MPG123_DONE=-12,        
00239         MPG123_NEW_FORMAT=-11,  
00240         MPG123_NEED_MORE=-10,   
00241         MPG123_ERR=-1,                  
00242         MPG123_OK=0,                    
00243         MPG123_BAD_OUTFORMAT,   
00244         MPG123_BAD_CHANNEL,             
00245         MPG123_BAD_RATE,                
00246         MPG123_ERR_16TO8TABLE,  
00247         MPG123_BAD_PARAM,               
00248         MPG123_BAD_BUFFER,              
00249         MPG123_OUT_OF_MEM,              
00250         MPG123_NOT_INITIALIZED, 
00251         MPG123_BAD_DECODER,             
00252         MPG123_BAD_HANDLE,              
00253         MPG123_NO_BUFFERS,              
00254         MPG123_BAD_RVA,                 
00255         MPG123_NO_GAPLESS,              
00256         MPG123_NO_SPACE,                
00257         MPG123_BAD_TYPES,               
00258         MPG123_BAD_BAND,                
00259         MPG123_ERR_NULL,                
00260         MPG123_ERR_READER,              
00261         MPG123_NO_SEEK_FROM_END,
00262         MPG123_BAD_WHENCE,              
00263         MPG123_NO_TIMEOUT,              
00264         MPG123_BAD_FILE,                
00265         MPG123_NO_SEEK,                 
00266         MPG123_NO_READER,               
00267         MPG123_BAD_PARS,                
00268         MPG123_BAD_INDEX_PAR,   
00269         MPG123_OUT_OF_SYNC,     
00270         MPG123_RESYNC_FAIL,     
00271         MPG123_NO_8BIT, 
00272         MPG123_BAD_ALIGN,       
00273         MPG123_NULL_BUFFER,     
00274         MPG123_NO_RELSEEK,      
00275         MPG123_NULL_POINTER, 
00276         MPG123_BAD_KEY, 
00277         MPG123_NO_INDEX,        
00278         MPG123_INDEX_FAIL,      
00279         MPG123_BAD_DECODER_SETUP,       
00280         MPG123_MISSING_FEATURE  
00281         ,MPG123_BAD_VALUE 
00282         ,MPG123_LSEEK_FAILED 
00283         ,MPG123_BAD_CUSTOM_IO 
00284         ,MPG123_LFS_OVERFLOW 
00285         ,MPG123_INT_OVERFLOW 
00286 };
00287 
00289 EXPORT const char* mpg123_plain_strerror(int errcode);
00290 
00295 EXPORT const char* mpg123_strerror(mpg123_handle *mh);
00296 
00298 EXPORT int mpg123_errcode(mpg123_handle *mh);
00299 
00312 EXPORT const char **mpg123_decoders(void);
00313 
00315 EXPORT const char **mpg123_supported_decoders(void);
00316 
00318 EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
00319 
00325 EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
00326 
00362 enum mpg123_enc_enum
00363 {
00364          MPG123_ENC_8      = 0x00f  
00365         ,MPG123_ENC_16     = 0x040  
00366         ,MPG123_ENC_24     = 0x4000 
00367         ,MPG123_ENC_32     = 0x100  
00368         ,MPG123_ENC_SIGNED = 0x080  
00369         ,MPG123_ENC_FLOAT  = 0xe00  
00370         ,MPG123_ENC_SIGNED_16   = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) 
00371         ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)                   
00372         ,MPG123_ENC_UNSIGNED_8  = 0x01                                   
00373         ,MPG123_ENC_SIGNED_8    = (MPG123_ENC_SIGNED|0x02)               
00374         ,MPG123_ENC_ULAW_8      = 0x04                                   
00375         ,MPG123_ENC_ALAW_8      = 0x08                                   
00376         ,MPG123_ENC_SIGNED_32   = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 
00377         ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000                   
00378         ,MPG123_ENC_SIGNED_24   = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 
00379         ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000                   
00380         ,MPG123_ENC_FLOAT_32    = 0x200                                  
00381         ,MPG123_ENC_FLOAT_64    = 0x400                                  
00382         ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16  | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 
00383                           | MPG123_ENC_SIGNED_8   | MPG123_ENC_ULAW_8      | MPG123_ENC_ALAW_8
00384                           | MPG123_ENC_SIGNED_32  | MPG123_ENC_UNSIGNED_32
00385                           | MPG123_ENC_SIGNED_24  | MPG123_ENC_UNSIGNED_24
00386                           | MPG123_ENC_FLOAT_32   | MPG123_ENC_FLOAT_64 ) 
00387 };
00388 
00390 enum mpg123_channelcount
00391 {
00392          MPG123_MONO   = 1
00393         ,MPG123_STEREO = 2
00394 };
00395 
00401 EXPORT void mpg123_rates(const long **list, size_t *number);
00402 
00407 EXPORT void mpg123_encodings(const int **list, size_t *number);
00408 
00412 EXPORT int mpg123_encsize(int encoding);
00413 
00416 EXPORT int mpg123_format_none(mpg123_handle *mh);
00417 
00420 EXPORT int mpg123_format_all(mpg123_handle *mh);
00421 
00428 EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings);
00429 
00434 EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding);
00435 
00437 EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding);
00438 
00449 /* reading samples / triggering decoding, possible return values: */
00456 EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
00457 
00461 EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
00462 
00467 EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
00468 
00472 EXPORT int mpg123_open_feed(mpg123_handle *mh);
00473 
00475 EXPORT int mpg123_close(mpg123_handle *mh);
00476 
00482 EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done);
00483 
00489 EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size);
00490 
00505 EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done);
00506 
00513 EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
00514 
00522 EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
00523 
00528 EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
00529 
00541 EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes);
00542 
00546 EXPORT off_t mpg123_framepos(mpg123_handle *mh);
00547 
00572 EXPORT off_t mpg123_tell(mpg123_handle *mh);
00573 
00575 EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
00576 
00578 EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
00579 
00583 EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence);
00584 
00590 EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset);
00591 
00595 EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence);
00596 
00600 EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
00601 
00608 EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill);
00609 
00616 EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill);
00617 
00624 EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
00625 
00634 enum mpg123_channels
00635 {
00636          MPG123_LEFT=0x1        
00637         ,MPG123_RIGHT=0x2       
00638         ,MPG123_LR=0x3  
00639 };
00640 
00645 EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val);
00646 
00651 EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band);
00652 
00654 EXPORT int mpg123_reset_eq(mpg123_handle *mh);
00655 
00658 EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
00659 
00661 EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
00662 
00667 EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
00668 
00669 /* TODO: Set some preamp in addition / to replace internal RVA handling? */
00670 
00680 enum mpg123_vbr {
00681         MPG123_CBR=0,   
00682         MPG123_VBR,             
00683         MPG123_ABR              
00684 };
00685 
00687 enum mpg123_version {
00688         MPG123_1_0=0,   
00689         MPG123_2_0,             
00690         MPG123_2_5              
00691 };
00692 
00693 
00696 enum mpg123_mode {
00697         MPG123_M_STEREO=0,      
00698         MPG123_M_JOINT,         
00699         MPG123_M_DUAL,          
00700         MPG123_M_MONO           
00701 };
00702 
00703 
00705 enum mpg123_flags {
00706         MPG123_CRC=0x1,                 
00707         MPG123_COPYRIGHT=0x2,   
00708         MPG123_PRIVATE=0x4,             
00709         MPG123_ORIGINAL=0x8     
00710 };
00711 
00713 struct mpg123_frameinfo
00714 {
00715         enum mpg123_version version;    
00716         int layer;                                              
00717         long rate;                                              
00718         enum mpg123_mode mode;                  
00719         int mode_ext;                                   
00720         int framesize;                                  
00721         enum mpg123_flags flags;                
00722         int emphasis;                                   
00723         int bitrate;                                    
00724         int abr_rate;                                   
00725         enum mpg123_vbr vbr;                    
00726 };
00727 
00729 EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
00730 
00732 EXPORT size_t mpg123_safe_buffer(void); 
00733 
00740 EXPORT int mpg123_scan(mpg123_handle *mh);
00741 
00744 EXPORT off_t mpg123_length(mpg123_handle *mh);
00745 
00749 EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
00750 
00752 EXPORT double mpg123_tpf(mpg123_handle *mh);
00753 
00755 EXPORT int mpg123_spf(mpg123_handle *mh);
00756 
00758 EXPORT long mpg123_clip(mpg123_handle *mh);
00759 
00760 
00762 enum mpg123_state
00763 {
00764          MPG123_ACCURATE = 1 
00765         ,MPG123_BUFFERFILL   
00766 };
00767 
00774 EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval);
00775 
00789 typedef struct 
00790 {
00791         char* p;     
00792         size_t size; 
00793         size_t fill; 
00794 } mpg123_string;
00795 
00797 EXPORT void mpg123_init_string(mpg123_string* sb);
00798 
00800 EXPORT void mpg123_free_string(mpg123_string* sb);
00801 
00804 EXPORT int  mpg123_resize_string(mpg123_string* sb, size_t news);
00805 
00810 EXPORT int  mpg123_grow_string(mpg123_string* sb, size_t news);
00811 
00814 EXPORT int  mpg123_copy_string(mpg123_string* from, mpg123_string* to);
00815 
00818 EXPORT int  mpg123_add_string(mpg123_string* sb, const char* stuff);
00819 
00824 EXPORT int  mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
00825 
00828 EXPORT int  mpg123_set_string(mpg123_string* sb, const char* stuff);
00829 
00834 EXPORT int  mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
00835 
00842 EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
00843 
00845 enum mpg123_text_encoding
00846 {
00847          mpg123_text_unknown  = 0 
00848         ,mpg123_text_utf8     = 1 
00849         ,mpg123_text_latin1   = 2 
00850         ,mpg123_text_icy      = 3 
00851         ,mpg123_text_cp1252   = 4 
00852         ,mpg123_text_utf16    = 5 
00856         ,mpg123_text_utf16bom = 6 
00857         ,mpg123_text_utf16be  = 7 
00861         ,mpg123_text_max      = 7 
00862 };
00863 
00865 enum mpg123_id3_enc
00866 {
00867          mpg123_id3_latin1   = 0 
00868         ,mpg123_id3_utf16bom = 1 
00869         ,mpg123_id3_utf16be  = 2 
00870         ,mpg123_id3_utf8     = 3 
00871         ,mpg123_id3_enc_max  = 3 
00872 };
00873 
00875 EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
00876 
00887 EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
00888 
00893 typedef struct
00894 {
00895         char lang[3]; 
00896         char id[4];   
00897         mpg123_string description; 
00898         mpg123_string text;        
00899 } mpg123_text;
00900 
00906 typedef struct
00907 {
00908         unsigned char version; 
00909         mpg123_string *title;   
00910         mpg123_string *artist;  
00911         mpg123_string *album;   
00912         mpg123_string *year;    
00913         mpg123_string *genre;   
00914         mpg123_string *comment; 
00915         /* Encountered ID3v2 fields are appended to these lists.
00916            There can be multiple occurences, the pointers above always point to the last encountered data. */
00917         mpg123_text    *comment_list; 
00918         size_t          comments;     
00919         mpg123_text    *text;         
00920         size_t          texts;        
00921         mpg123_text    *extra;        
00922         size_t          extras;       
00923 } mpg123_id3v2;
00924 
00929 typedef struct
00930 {
00931         char tag[3];         
00932         char title[30];      
00933         char artist[30];     
00934         char album[30];      
00935         char year[4];        
00936         char comment[30];    
00937         unsigned char genre; 
00938 } mpg123_id3v1;
00939 
00940 #define MPG123_ID3     0x3 
00941 #define MPG123_NEW_ID3 0x1 
00942 #define MPG123_ICY     0xc 
00943 #define MPG123_NEW_ICY 0x4 
00947 EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */
00948 
00952 EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2);
00953 
00956 EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */
00957 
00962 EXPORT char* mpg123_icy2utf8(const char* icy_text);
00963 
00964 
00965 /* @} */
00966 
00967 
00984 struct mpg123_pars_struct;
00985 
00987 typedef struct mpg123_pars_struct   mpg123_pars;
00988 
00990 EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error);
00991 
00993 EXPORT mpg123_pars *mpg123_new_pars(int *error);
00994 
00996 EXPORT void         mpg123_delete_pars(mpg123_pars* mp);
00997 
01000 EXPORT int mpg123_fmt_none(mpg123_pars *mp);
01001 
01004 EXPORT int mpg123_fmt_all(mpg123_pars *mp);
01005 
01012 EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */
01013 
01018 EXPORT int mpg123_fmt_support(mpg123_pars *mh,   long rate, int encoding);
01019 
01022 EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue);
01023 
01026 EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval);
01027 
01028 /* @} */
01029 
01030 
01038 EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size);
01039 
01042 EXPORT size_t mpg123_outblock(mpg123_handle *mh);
01043 
01051 EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int));
01052 
01062 EXPORT int mpg123_replace_reader_handle(mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*));
01063 
01064 /* @} */
01065 
01066 #ifdef __cplusplus
01067 }
01068 #endif
01069 
01070 #endif

Generated on Wed Aug 24 22:40:37 2011 for libmpg123 by  doxygen 1.5.6