ReactOS 0.4.15-dev-7842-g558ab78
Collaboration diagram for mpg123 decoder selection:

Modules

 mpg123 output audio format
 

Functions

MPG123_EXPORT const char ** mpg123_decoders (void)
 
MPG123_EXPORT const char ** mpg123_supported_decoders (void)
 
MPG123_EXPORT int mpg123_decoder (mpg123_handle *mh, const char *decoder_name)
 
MPG123_EXPORT const charmpg123_current_decoder (mpg123_handle *mh)
 

Detailed Description

Functions to list and select the available decoders. Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).

Function Documentation

◆ mpg123_current_decoder()

MPG123_EXPORT const char * mpg123_current_decoder ( mpg123_handle mh)

Get the currently active decoder name. The active decoder engine can vary depening on output constraints, mostly non-resampling, integer output is accelerated via 3DNow & Co. but for other modes a fallback engine kicks in. Note that this can return a decoder that is only active in the hidden and not available as decoder choice from the outside.

Parameters
mhhandle
Returns
The decoder name or NULL on error.

Definition at line 1163 of file optimize.c.

1164{
1165 if(mh == NULL) return NULL;
1166
1167 return decname[mh->cpu_opts.type];
1168}
#define NULL
Definition: types.h:112
struct mpg123_handle_struct::@3456 cpu_opts

◆ mpg123_decoder()

MPG123_EXPORT int mpg123_decoder ( mpg123_handle mh,
const char decoder_name 
)

Set the active decoder.

Parameters
mhhandle
decoder_namename of decoder
Returns
MPG123_OK on success

Definition at line 92 of file libmpg123.c.

93{
94 enum optdec dt = dectype(decoder);
95
96 if(mh == NULL) return MPG123_BAD_HANDLE;
97
98 if(dt == nodec)
99 {
101 return MPG123_ERR;
102 }
103 if(dt == mh->cpu_opts.type) return MPG123_OK;
104
105 /* Now really change. */
106 /* frame_exit(mh);
107 frame_init(mh); */
108 debug("cpu opt setting");
109 if(frame_cpu_opt(mh, decoder) != 1)
110 {
112 frame_exit(mh);
113 return MPG123_ERR;
114 }
115 /* New buffers for decoder are created in frame_buffers() */
116 if((frame_outbuffer(mh) != 0))
117 {
119 frame_exit(mh);
120 return MPG123_ERR;
121 }
122 /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */
123 mh->decoder_change = 1;
124 return MPG123_OK;
125}
@ MPG123_BAD_HANDLE
Definition: mpg123.h:393
@ MPG123_ERR
Definition: mpg123.h:382
@ MPG123_NO_BUFFERS
Definition: mpg123.h:394
@ MPG123_OK
Definition: mpg123.h:383
@ MPG123_BAD_DECODER
Definition: mpg123.h:392
#define frame_outbuffer
Definition: intsym.h:181
#define dectype
Definition: intsym.h:233
#define frame_cpu_opt
Definition: intsym.h:231
#define frame_exit
Definition: intsym.h:186
#define debug(msg)
Definition: key_call.c:71
optdec
Definition: optimize.h:95
@ nodec
Definition: optimize.h:116

◆ mpg123_decoders()

MPG123_EXPORT const char ** mpg123_decoders ( void  )

Get available decoder list.

Returns
NULL-terminated array of generally available decoder names (plain 8bit ASCII)

Definition at line 1170 of file optimize.c.

1170{ return mpg123_decoder_list; }
static const char * mpg123_decoder_list[]
Definition: optimize.c:1022

◆ mpg123_supported_decoders()

MPG123_EXPORT const char ** mpg123_supported_decoders ( void  )

Get supported decoder list.

Returns
NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII)

Definition at line 1171 of file optimize.c.

1172{
1173#ifdef OPT_MULTI
1174 return mpg123_supported_decoder_list;
1175#else
1176 return mpg123_decoder_list;
1177#endif
1178}