xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Functions | Variables
xine_musepack_decoder.c File Reference

xine interface to libmusepack/libmpcdec More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <xine/xine_internal.h>
#include <xine/audio_out.h>
#include <xine/buffer.h>
#include <xine/xineutils.h>
#include "mpcdec/mpcdec.h"

Data Structures

struct  mpc_decoder_s
 

Macros

#define LOG_MODULE   "mpc_decoder"
 
#define LOG_VERBOSE
 
#define MPC_DECODER_MEMSIZE   65536
 
#define MPC_DECODER_MEMSIZE2   (MPC_DECODER_MEMSIZE/2)
 
#define INIT_BUFSIZE   (MPC_DECODER_MEMSIZE*2)
 
#define MPC_THIS   mpc_decoder_t * const this = (mpc_decoder_t *)data
 

Typedefs

typedef struct mpc_decoder_s mpc_decoder_t
 

Functions

static int32_t mpc_reader_read (void *const data, void *const ptr, int size)
 
static mpc_bool_t mpc_reader_seek (void *const data, const int32_t offset)
 
static int32_t mpc_reader_tell (void *const data)
 
static int32_t mpc_reader_get_size (void *const data)
 
static mpc_bool_t mpc_reader_canseek (void *data)
 
static void float_to_int (const float *const _f, int16_t *const s16, const int samples)
 Convert a array of floating point samples into 16-bit signed integer samples.
 
static int mpc_decode_frame (mpc_decoder_t *this)
 
static void mpc_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
 
static void mpc_reset (audio_decoder_t *this_gen)
 
static void mpc_discontinuity (audio_decoder_t *this_gen)
 
static void mpc_dispose (audio_decoder_t *this_gen)
 
static audio_decoder_topen_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream)
 
static void * init_plugin (xine_t *xine, const void *data)
 

Variables

static const uint32_t audio_types []
 
static const decoder_info_t dec_info_audio
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Detailed Description

xine interface to libmusepack/libmpcdec

Author
James Stembridge jstem.nosp@m.brid.nosp@m.ge@gm.nosp@m.ail..nosp@m.com
Todo

Add support for 32-bit float samples.

Add support for seeking.

Macro Definition Documentation

◆ INIT_BUFSIZE

#define INIT_BUFSIZE   (MPC_DECODER_MEMSIZE*2)

Referenced by mpc_decode_data().

◆ LOG_MODULE

#define LOG_MODULE   "mpc_decoder"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MPC_DECODER_MEMSIZE

#define MPC_DECODER_MEMSIZE   65536

Referenced by mpc_decode_data().

◆ MPC_DECODER_MEMSIZE2

#define MPC_DECODER_MEMSIZE2   (MPC_DECODER_MEMSIZE/2)

Referenced by mpc_decode_data().

◆ MPC_THIS

#define MPC_THIS   mpc_decoder_t * const this = (mpc_decoder_t *)data

Typedef Documentation

◆ mpc_decoder_t

typedef struct mpc_decoder_s mpc_decoder_t

Function Documentation

◆ float_to_int()

static void float_to_int ( const float *const _f,
int16_t *const s16,
const int samples )
inlinestatic

Convert a array of floating point samples into 16-bit signed integer samples.

Parameters
fFloating point samples array (origin)
s1616-bit signed integer samples array (destination)
samplesNumber of samples to convert
Todo
This same work is being done in many decoders to adapt the output of the decoder to what the audio output can actually use, this should be done by the audio_output loop, not by the decoders.

References INT16_MAX, and INT16_MIN.

Referenced by mpc_decode_frame().

◆ init_plugin()

static void * init_plugin ( xine_t * xine,
const void * data )
static

◆ mpc_decode_data()

static void mpc_decode_data ( audio_decoder_t * this_gen,
buf_element_t * buf )
static

◆ mpc_decode_frame()

static int mpc_decode_frame ( mpc_decoder_t * this)
static

◆ mpc_discontinuity()

static void mpc_discontinuity ( audio_decoder_t * this_gen)
static

Referenced by open_plugin().

◆ mpc_dispose()

static void mpc_dispose ( audio_decoder_t * this_gen)
static

References _x_freep(), and xine_container_of.

Referenced by open_plugin().

◆ mpc_reader_canseek()

static mpc_bool_t mpc_reader_canseek ( void * data)
static

References lprintf.

Referenced by mpc_decode_data().

◆ mpc_reader_get_size()

static int32_t mpc_reader_get_size ( void *const data)
static

References lprintf, and MPC_THIS.

Referenced by mpc_decode_data().

◆ mpc_reader_read()

static int32_t mpc_reader_read ( void *const data,
void *const ptr,
int size )
static

References lprintf, MPC_THIS, and xine_fast_memcpy.

Referenced by mpc_decode_data().

◆ mpc_reader_seek()

static mpc_bool_t mpc_reader_seek ( void *const data,
const int32_t offset )
static

References lprintf, and MPC_THIS.

Referenced by mpc_decode_data().

◆ mpc_reader_tell()

static int32_t mpc_reader_tell ( void *const data)
static

References lprintf.

Referenced by mpc_decode_data().

◆ mpc_reset()

static void mpc_reset ( audio_decoder_t * this_gen)
static

References xine_container_of.

Referenced by open_plugin().

◆ open_plugin()

static audio_decoder_t * open_plugin ( audio_decoder_class_t * class_gen,
xine_stream_t * stream )
static

Variable Documentation

◆ audio_types

const uint32_t audio_types[]
static
Initial value:
= {
0
}
#define BUF_AUDIO_MPC
Definition buffer.h:263

◆ dec_info_audio

const decoder_info_t dec_info_audio
static
Initial value:
= {
.supported_types = audio_types,
.priority = 5,
}
static const uint32_t audio_types[]
Definition xine_musepack_decoder.c:538

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
#define XINE_VERSION_CODE
Definition xine_internal.h:57
static void * init_plugin(xine_t *xine, const void *data)
Definition xine_musepack_decoder.c:525
static const decoder_info_t dec_info_audio
Definition xine_musepack_decoder.c:543
NULL
Definition xine_plugin.c:78
#define PLUGIN_AUDIO_DECODER
Definition xine_plugin.h:32
#define PLUGIN_NONE
Definition xine_plugin.h:29