ReactOS  r75636
mpg123 decoder selection

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_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 }
struct mpg123_handle_struct::@3097 cpu_opts
smooth NULL
Definition: ftsmooth.c:513
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 90 of file libmpg123.c.

91 {
92  enum optdec dt = dectype(decoder);
93 
94  if(mh == NULL) return MPG123_BAD_HANDLE;
95 
96  if(dt == nodec)
97  {
98  mh->err = MPG123_BAD_DECODER;
99  return MPG123_ERR;
100  }
101  if(dt == mh->cpu_opts.type) return MPG123_OK;
102 
103  /* Now really change. */
104  /* frame_exit(mh);
105  frame_init(mh); */
106  debug("cpu opt setting");
107  if(frame_cpu_opt(mh, decoder) != 1)
108  {
109  mh->err = MPG123_BAD_DECODER;
110  frame_exit(mh);
111  return MPG123_ERR;
112  }
113  /* New buffers for decoder are created in frame_buffers() */
114  if((frame_outbuffer(mh) != 0))
115  {
116  mh->err = MPG123_NO_BUFFERS;
117  frame_exit(mh);
118  return MPG123_ERR;
119  }
120  /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */
121  mh->decoder_change = 1;
122  return MPG123_OK;
123 }
#define frame_exit
Definition: intsym.h:175
struct mpg123_handle_struct::@3097 cpu_opts
#define dectype
Definition: intsym.h:223
smooth NULL
Definition: ftsmooth.c:513
#define frame_outbuffer
Definition: intsym.h:170
optdec
Definition: optimize.h:94
#define debug(msg)
Definition: key_call.c:71
#define frame_cpu_opt
Definition: intsym.h:221
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_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 }
static const char * mpg123_decoder_list[]
Definition: optimize.c:1022