ReactOS  r74622
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 engine 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 ony active in the hidden and not available as decoder choice from the outside.

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 }
smooth NULL
Definition: ftsmooth.c:464
struct mpg123_handle_struct::@2902 cpu_opts
MPG123_EXPORT int mpg123_decoder ( mpg123_handle mh,
const char decoder_name 
)

Set the chosen decoder to 'decoder_name'

Returns
MPG123_OK on success

Definition at line 78 of file libmpg123.c.

79 {
80  enum optdec dt = dectype(decoder);
81 
82  if(mh == NULL) return MPG123_BAD_HANDLE;
83 
84  if(dt == nodec)
85  {
86  mh->err = MPG123_BAD_DECODER;
87  return MPG123_ERR;
88  }
89  if(dt == mh->cpu_opts.type) return MPG123_OK;
90 
91  /* Now really change. */
92  /* frame_exit(mh);
93  frame_init(mh); */
94  debug("cpu opt setting");
95  if(frame_cpu_opt(mh, decoder) != 1)
96  {
97  mh->err = MPG123_BAD_DECODER;
98  frame_exit(mh);
99  return MPG123_ERR;
100  }
101  /* New buffers for decoder are created in frame_buffers() */
102  if((frame_outbuffer(mh) != 0))
103  {
104  mh->err = MPG123_NO_BUFFERS;
105  frame_exit(mh);
106  return MPG123_ERR;
107  }
108  /* Do _not_ call decode_update here! That is only allowed after a first MPEG frame has been met. */
109  mh->decoder_change = 1;
110  return MPG123_OK;
111 }
#define frame_exit
Definition: intsym.h:160
#define dectype
Definition: intsym.h:205
smooth NULL
Definition: ftsmooth.c:464
#define debug(s)
Definition: debug.h:44
#define frame_outbuffer
Definition: intsym.h:155
optdec
Definition: optimize.h:94
#define frame_cpu_opt
Definition: intsym.h:203
struct mpg123_handle_struct::@2902 cpu_opts
MPG123_EXPORT const char** mpg123_decoders ( void  )

Return a 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  )

Return a 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