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 34
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         ,MPG123_AUTO_RESAMPLE = 0x8000 
00178 };
00179 
00181 enum mpg123_param_rva
00182 {
00183          MPG123_RVA_OFF   = 0 
00184         ,MPG123_RVA_MIX   = 1 
00185         ,MPG123_RVA_ALBUM = 2 
00186         ,MPG123_RVA_MAX   = MPG123_RVA_ALBUM 
00187 };
00188 
00189 /* TODO: Assess the possibilities and troubles of changing parameters during playback. */
00190 
00193 EXPORT int mpg123_param(mpg123_handle *mh, enum mpg123_parms type, long value, double fvalue);
00194 
00197 EXPORT int mpg123_getparam(mpg123_handle *mh, enum mpg123_parms type, long *val, double *fval);
00198 
00200 enum mpg123_feature_set
00201 {
00202          MPG123_FEATURE_ABI_UTF8OPEN = 0     
00203         ,MPG123_FEATURE_OUTPUT_8BIT          
00204         ,MPG123_FEATURE_OUTPUT_16BIT         
00205         ,MPG123_FEATURE_OUTPUT_32BIT         
00206         ,MPG123_FEATURE_INDEX                
00207         ,MPG123_FEATURE_PARSE_ID3V2          
00208         ,MPG123_FEATURE_DECODE_LAYER1        
00209         ,MPG123_FEATURE_DECODE_LAYER2        
00210         ,MPG123_FEATURE_DECODE_LAYER3        
00211         ,MPG123_FEATURE_DECODE_ACCURATE      
00212         ,MPG123_FEATURE_DECODE_DOWNSAMPLE    
00213         ,MPG123_FEATURE_DECODE_NTOM          
00214         ,MPG123_FEATURE_PARSE_ICY            
00215         ,MPG123_FEATURE_TIMEOUT_READ         
00216 };
00217 
00219 EXPORT int mpg123_feature(const enum mpg123_feature_set key);
00220 
00221 /* @} */
00222 
00223 
00237 enum mpg123_errors
00238 {
00239         MPG123_DONE=-12,        
00240         MPG123_NEW_FORMAT=-11,  
00241         MPG123_NEED_MORE=-10,   
00242         MPG123_ERR=-1,                  
00243         MPG123_OK=0,                    
00244         MPG123_BAD_OUTFORMAT,   
00245         MPG123_BAD_CHANNEL,             
00246         MPG123_BAD_RATE,                
00247         MPG123_ERR_16TO8TABLE,  
00248         MPG123_BAD_PARAM,               
00249         MPG123_BAD_BUFFER,              
00250         MPG123_OUT_OF_MEM,              
00251         MPG123_NOT_INITIALIZED, 
00252         MPG123_BAD_DECODER,             
00253         MPG123_BAD_HANDLE,              
00254         MPG123_NO_BUFFERS,              
00255         MPG123_BAD_RVA,                 
00256         MPG123_NO_GAPLESS,              
00257         MPG123_NO_SPACE,                
00258         MPG123_BAD_TYPES,               
00259         MPG123_BAD_BAND,                
00260         MPG123_ERR_NULL,                
00261         MPG123_ERR_READER,              
00262         MPG123_NO_SEEK_FROM_END,
00263         MPG123_BAD_WHENCE,              
00264         MPG123_NO_TIMEOUT,              
00265         MPG123_BAD_FILE,                
00266         MPG123_NO_SEEK,                 
00267         MPG123_NO_READER,               
00268         MPG123_BAD_PARS,                
00269         MPG123_BAD_INDEX_PAR,   
00270         MPG123_OUT_OF_SYNC,     
00271         MPG123_RESYNC_FAIL,     
00272         MPG123_NO_8BIT, 
00273         MPG123_BAD_ALIGN,       
00274         MPG123_NULL_BUFFER,     
00275         MPG123_NO_RELSEEK,      
00276         MPG123_NULL_POINTER, 
00277         MPG123_BAD_KEY, 
00278         MPG123_NO_INDEX,        
00279         MPG123_INDEX_FAIL,      
00280         MPG123_BAD_DECODER_SETUP,       
00281         MPG123_MISSING_FEATURE  
00282         ,MPG123_BAD_VALUE 
00283         ,MPG123_LSEEK_FAILED 
00284         ,MPG123_BAD_CUSTOM_IO 
00285         ,MPG123_LFS_OVERFLOW 
00286         ,MPG123_INT_OVERFLOW 
00287 };
00288 
00290 EXPORT const char* mpg123_plain_strerror(int errcode);
00291 
00296 EXPORT const char* mpg123_strerror(mpg123_handle *mh);
00297 
00299 EXPORT int mpg123_errcode(mpg123_handle *mh);
00300 
00313 EXPORT const char **mpg123_decoders(void);
00314 
00316 EXPORT const char **mpg123_supported_decoders(void);
00317 
00319 EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
00320 
00326 EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
00327 
00363 enum mpg123_enc_enum
00364 {
00365          MPG123_ENC_8      = 0x00f  
00366         ,MPG123_ENC_16     = 0x040  
00367         ,MPG123_ENC_24     = 0x4000 
00368         ,MPG123_ENC_32     = 0x100  
00369         ,MPG123_ENC_SIGNED = 0x080  
00370         ,MPG123_ENC_FLOAT  = 0xe00  
00371         ,MPG123_ENC_SIGNED_16   = (MPG123_ENC_16|MPG123_ENC_SIGNED|0x10) 
00372         ,MPG123_ENC_UNSIGNED_16 = (MPG123_ENC_16|0x20)                   
00373         ,MPG123_ENC_UNSIGNED_8  = 0x01                                   
00374         ,MPG123_ENC_SIGNED_8    = (MPG123_ENC_SIGNED|0x02)               
00375         ,MPG123_ENC_ULAW_8      = 0x04                                   
00376         ,MPG123_ENC_ALAW_8      = 0x08                                   
00377         ,MPG123_ENC_SIGNED_32   = MPG123_ENC_32|MPG123_ENC_SIGNED|0x1000 
00378         ,MPG123_ENC_UNSIGNED_32 = MPG123_ENC_32|0x2000                   
00379         ,MPG123_ENC_SIGNED_24   = MPG123_ENC_24|MPG123_ENC_SIGNED|0x1000 
00380         ,MPG123_ENC_UNSIGNED_24 = MPG123_ENC_24|0x2000                   
00381         ,MPG123_ENC_FLOAT_32    = 0x200                                  
00382         ,MPG123_ENC_FLOAT_64    = 0x400                                  
00383         ,MPG123_ENC_ANY = ( MPG123_ENC_SIGNED_16  | MPG123_ENC_UNSIGNED_16 | MPG123_ENC_UNSIGNED_8 
00384                           | MPG123_ENC_SIGNED_8   | MPG123_ENC_ULAW_8      | MPG123_ENC_ALAW_8
00385                           | MPG123_ENC_SIGNED_32  | MPG123_ENC_UNSIGNED_32
00386                           | MPG123_ENC_SIGNED_24  | MPG123_ENC_UNSIGNED_24
00387                           | MPG123_ENC_FLOAT_32   | MPG123_ENC_FLOAT_64 ) 
00388 };
00389 
00391 enum mpg123_channelcount
00392 {
00393          MPG123_MONO   = 1
00394         ,MPG123_STEREO = 2
00395 };
00396 
00402 EXPORT void mpg123_rates(const long **list, size_t *number);
00403 
00408 EXPORT void mpg123_encodings(const int **list, size_t *number);
00409 
00413 EXPORT int mpg123_encsize(int encoding);
00414 
00417 EXPORT int mpg123_format_none(mpg123_handle *mh);
00418 
00421 EXPORT int mpg123_format_all(mpg123_handle *mh);
00422 
00429 EXPORT int mpg123_format(mpg123_handle *mh, long rate, int channels, int encodings);
00430 
00435 EXPORT int mpg123_format_support(mpg123_handle *mh, long rate, int encoding);
00436 
00438 EXPORT int mpg123_getformat(mpg123_handle *mh, long *rate, int *channels, int *encoding);
00439 
00450 /* reading samples / triggering decoding, possible return values: */
00457 EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
00458 
00462 EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
00463 
00468 EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
00469 
00473 EXPORT int mpg123_open_feed(mpg123_handle *mh);
00474 
00476 EXPORT int mpg123_close(mpg123_handle *mh);
00477 
00483 EXPORT int mpg123_read(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done);
00484 
00490 EXPORT int mpg123_feed(mpg123_handle *mh, const unsigned char *in, size_t size);
00491 
00506 EXPORT int mpg123_decode(mpg123_handle *mh, const unsigned char *inmemory, size_t inmemsize, unsigned char *outmemory, size_t outmemsize, size_t *done);
00507 
00514 EXPORT int mpg123_decode_frame(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
00515 
00523 EXPORT int mpg123_framebyframe_decode(mpg123_handle *mh, off_t *num, unsigned char **audio, size_t *bytes);
00524 
00529 EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
00530 
00542 EXPORT int mpg123_framedata(mpg123_handle *mh, unsigned long *header, unsigned char **bodydata, size_t *bodybytes);
00543 
00547 EXPORT off_t mpg123_framepos(mpg123_handle *mh);
00548 
00573 EXPORT off_t mpg123_tell(mpg123_handle *mh);
00574 
00576 EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
00577 
00579 EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
00580 
00584 EXPORT off_t mpg123_seek(mpg123_handle *mh, off_t sampleoff, int whence);
00585 
00591 EXPORT off_t mpg123_feedseek(mpg123_handle *mh, off_t sampleoff, int whence, off_t *input_offset);
00592 
00596 EXPORT off_t mpg123_seek_frame(mpg123_handle *mh, off_t frameoff, int whence);
00597 
00601 EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
00602 
00609 EXPORT int mpg123_index(mpg123_handle *mh, off_t **offsets, off_t *step, size_t *fill);
00610 
00617 EXPORT int mpg123_set_index(mpg123_handle *mh, off_t *offsets, off_t step, size_t fill);
00618 
00625 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);
00626 
00635 enum mpg123_channels
00636 {
00637          MPG123_LEFT=0x1        
00638         ,MPG123_RIGHT=0x2       
00639         ,MPG123_LR=0x3  
00640 };
00641 
00646 EXPORT int mpg123_eq(mpg123_handle *mh, enum mpg123_channels channel, int band, double val);
00647 
00652 EXPORT double mpg123_geteq(mpg123_handle *mh, enum mpg123_channels channel, int band);
00653 
00655 EXPORT int mpg123_reset_eq(mpg123_handle *mh);
00656 
00659 EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
00660 
00662 EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
00663 
00668 EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
00669 
00670 /* TODO: Set some preamp in addition / to replace internal RVA handling? */
00671 
00681 enum mpg123_vbr {
00682         MPG123_CBR=0,   
00683         MPG123_VBR,             
00684         MPG123_ABR              
00685 };
00686 
00688 enum mpg123_version {
00689         MPG123_1_0=0,   
00690         MPG123_2_0,             
00691         MPG123_2_5              
00692 };
00693 
00694 
00697 enum mpg123_mode {
00698         MPG123_M_STEREO=0,      
00699         MPG123_M_JOINT,         
00700         MPG123_M_DUAL,          
00701         MPG123_M_MONO           
00702 };
00703 
00704 
00706 enum mpg123_flags {
00707         MPG123_CRC=0x1,                 
00708         MPG123_COPYRIGHT=0x2,   
00709         MPG123_PRIVATE=0x4,             
00710         MPG123_ORIGINAL=0x8     
00711 };
00712 
00714 struct mpg123_frameinfo
00715 {
00716         enum mpg123_version version;    
00717         int layer;                                              
00718         long rate;                                              
00719         enum mpg123_mode mode;                  
00720         int mode_ext;                                   
00721         int framesize;                                  
00722         enum mpg123_flags flags;                
00723         int emphasis;                                   
00724         int bitrate;                                    
00725         int abr_rate;                                   
00726         enum mpg123_vbr vbr;                    
00727 };
00728 
00730 EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
00731 
00733 EXPORT size_t mpg123_safe_buffer(void); 
00734 
00741 EXPORT int mpg123_scan(mpg123_handle *mh);
00742 
00745 EXPORT off_t mpg123_length(mpg123_handle *mh);
00746 
00750 EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
00751 
00753 EXPORT double mpg123_tpf(mpg123_handle *mh);
00754 
00756 EXPORT int mpg123_spf(mpg123_handle *mh);
00757 
00759 EXPORT long mpg123_clip(mpg123_handle *mh);
00760 
00761 
00763 enum mpg123_state
00764 {
00765          MPG123_ACCURATE = 1 
00766         ,MPG123_BUFFERFILL   
00767 };
00768 
00775 EXPORT int mpg123_getstate(mpg123_handle *mh, enum mpg123_state key, long *val, double *fval);
00776 
00790 typedef struct 
00791 {
00792         char* p;     
00793         size_t size; 
00794         size_t fill; 
00795 } mpg123_string;
00796 
00798 EXPORT void mpg123_init_string(mpg123_string* sb);
00799 
00801 EXPORT void mpg123_free_string(mpg123_string* sb);
00802 
00805 EXPORT int  mpg123_resize_string(mpg123_string* sb, size_t news);
00806 
00811 EXPORT int  mpg123_grow_string(mpg123_string* sb, size_t news);
00812 
00815 EXPORT int  mpg123_copy_string(mpg123_string* from, mpg123_string* to);
00816 
00819 EXPORT int  mpg123_add_string(mpg123_string* sb, const char* stuff);
00820 
00825 EXPORT int  mpg123_add_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
00826 
00829 EXPORT int  mpg123_set_string(mpg123_string* sb, const char* stuff);
00830 
00835 EXPORT int  mpg123_set_substring(mpg123_string *sb, const char *stuff, size_t from, size_t count);
00836 
00843 EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
00844 
00846 enum mpg123_text_encoding
00847 {
00848          mpg123_text_unknown  = 0 
00849         ,mpg123_text_utf8     = 1 
00850         ,mpg123_text_latin1   = 2 
00851         ,mpg123_text_icy      = 3 
00852         ,mpg123_text_cp1252   = 4 
00853         ,mpg123_text_utf16    = 5 
00857         ,mpg123_text_utf16bom = 6 
00858         ,mpg123_text_utf16be  = 7 
00862         ,mpg123_text_max      = 7 
00863 };
00864 
00866 enum mpg123_id3_enc
00867 {
00868          mpg123_id3_latin1   = 0 
00869         ,mpg123_id3_utf16bom = 1 
00870         ,mpg123_id3_utf16be  = 2 
00871         ,mpg123_id3_utf8     = 3 
00872         ,mpg123_id3_enc_max  = 3 
00873 };
00874 
00876 EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
00877 
00888 EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
00889 
00894 typedef struct
00895 {
00896         char lang[3]; 
00897         char id[4];   
00898         mpg123_string description; 
00899         mpg123_string text;        
00900 } mpg123_text;
00901 
00907 typedef struct
00908 {
00909         unsigned char version; 
00910         mpg123_string *title;   
00911         mpg123_string *artist;  
00912         mpg123_string *album;   
00913         mpg123_string *year;    
00914         mpg123_string *genre;   
00915         mpg123_string *comment; 
00916         /* Encountered ID3v2 fields are appended to these lists.
00917            There can be multiple occurences, the pointers above always point to the last encountered data. */
00918         mpg123_text    *comment_list; 
00919         size_t          comments;     
00920         mpg123_text    *text;         
00921         size_t          texts;        
00922         mpg123_text    *extra;        
00923         size_t          extras;       
00924 } mpg123_id3v2;
00925 
00930 typedef struct
00931 {
00932         char tag[3];         
00933         char title[30];      
00934         char artist[30];     
00935         char album[30];      
00936         char year[4];        
00937         char comment[30];    
00938         unsigned char genre; 
00939 } mpg123_id3v1;
00940 
00941 #define MPG123_ID3     0x3 
00942 #define MPG123_NEW_ID3 0x1 
00943 #define MPG123_ICY     0xc 
00944 #define MPG123_NEW_ICY 0x4 
00948 EXPORT int mpg123_meta_check(mpg123_handle *mh); /* On error (no valid handle) just 0 is returned. */
00949 
00953 EXPORT int mpg123_id3(mpg123_handle *mh, mpg123_id3v1 **v1, mpg123_id3v2 **v2);
00954 
00957 EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta); /* same for ICY meta string */
00958 
00963 EXPORT char* mpg123_icy2utf8(const char* icy_text);
00964 
00965 
00966 /* @} */
00967 
00968 
00985 struct mpg123_pars_struct;
00986 
00988 typedef struct mpg123_pars_struct   mpg123_pars;
00989 
00991 EXPORT mpg123_handle *mpg123_parnew(mpg123_pars *mp, const char* decoder, int *error);
00992 
00994 EXPORT mpg123_pars *mpg123_new_pars(int *error);
00995 
00997 EXPORT void         mpg123_delete_pars(mpg123_pars* mp);
00998 
01001 EXPORT int mpg123_fmt_none(mpg123_pars *mp);
01002 
01005 EXPORT int mpg123_fmt_all(mpg123_pars *mp);
01006 
01013 EXPORT int mpg123_fmt(mpg123_pars *mh, long rate, int channels, int encodings); /* 0 is good, -1 is error */
01014 
01019 EXPORT int mpg123_fmt_support(mpg123_pars *mh,   long rate, int encoding);
01020 
01023 EXPORT int mpg123_par(mpg123_pars *mp, enum mpg123_parms type, long value, double fvalue);
01024 
01027 EXPORT int mpg123_getpar(mpg123_pars *mp, enum mpg123_parms type, long *val, double *fval);
01028 
01029 /* @} */
01030 
01031 
01039 EXPORT int mpg123_replace_buffer(mpg123_handle *mh, unsigned char *data, size_t size);
01040 
01043 EXPORT size_t mpg123_outblock(mpg123_handle *mh);
01044 
01052 EXPORT int mpg123_replace_reader(mpg123_handle *mh, ssize_t (*r_read) (int, void *, size_t), off_t (*r_lseek)(int, off_t, int));
01053 
01063 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*));
01064 
01065 /* @} */
01066 
01067 #ifdef __cplusplus
01068 }
01069 #endif
01070 
01071 #endif

Generated on Mon Feb 6 01:07:20 2012 for libmpg123 by  doxygen 1.5.6