xine-lib: xine-lib-1.2.12/src/audio_dec/xine_mad_decoder.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Typedefs | Functions | Variables
xine_mad_decoder.c File Reference
`#include <stdlib.h>`
`#include <string.h>`
`#include "config.h"`
`#include <xine/xine_internal.h>`
`#include <xine/audio_out.h>`
`#include <xine/buffer.h>`
`#include <xine/xineutils.h>`
`#include "bswap.h"`
`#include "frame.h"`
`#include "synth.h"`

## Data Structures
struct | mad_decoder_s

## Macros
#define | LOG_MODULE "mad_decoder"
#define | LOG_VERBOSE
#define | REST_SIZE 16384
#define | MAD_MIN_SIZE 2889
#define | MAD_PTS_LD 3
#define | MAD_PTS_SIZE (1 << MAD_PTS_LD)
#define | MAD_PTS_MASK (MAD_PTS_SIZE - 1)

## Typedefs
typedef struct mad_decoder_s | mad_decoder_t

## Functions
static int | _mad_frame_size (const uint8_t *h)
static void | mad_reset (audio_decoder_t *this_gen)
static void | mad_discontinuity (audio_decoder_t *this_gen)
static int32_t | _mad_scale (mad_fixed_t sample)
static int | _mad_consume (mad_decoder_t *this)
static void | mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
static int | _mad_fixed_2_db (mad_fixed_t v)
static void | mad_dispose (audio_decoder_t *this_gen)
static audio_decoder_t * | open_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

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "mad_decoder"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAD_MIN_SIZE

#define MAD_MIN_SIZE 2889

## ◆ MAD_PTS_LD

#define MAD_PTS_LD 3

## ◆ MAD_PTS_MASK

#define MAD_PTS_MASK (MAD_PTS_SIZE - 1)

## ◆ MAD_PTS_SIZE

#define MAD_PTS_SIZE (1 << MAD_PTS_LD)

## ◆ REST_SIZE

#define REST_SIZE 16384

## Typedef Documentation

## ◆ mad_decoder_t

typedef struct mad_decoder_s mad_decoder_t

## Function Documentation

## ◆ _mad_consume()

static int _mad_consume | ( | mad_decoder_t * | this | ) |
| static

References MAD_PTS_MASK.

Referenced by mad_decode_data().

## ◆ _mad_fixed_2_db()

static int _mad_fixed_2_db | ( | mad_fixed_t | v | ) |
| static

References v.

Referenced by mad_dispose().

## ◆ _mad_frame_size()

static int _mad_frame_size | ( | const uint8_t * | h | ) |
| static

References _X_BE_32, and type.

Referenced by mad_decode_data().

## ◆ _mad_scale()

static int32_t _mad_scale | ( | mad_fixed_t | sample | ) |
| inlinestatic

References v.

Referenced by mad_decode_data().

## ◆ init_plugin()

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

References N_, NULL, open_plugin(), and audio_decoder_class_s::open_plugin.

## ◆ mad_decode_data()

static void mad_decode_data | ( | audio_decoder_t * | this_gen,
|  | buf_element_t * | buf
| ) |  |
| static

References _mad_consume(), _mad_frame_size(), _mad_scale(), _x_meta_info_get(), _x_meta_info_set_utf8(), _x_stream_info_get(), _x_stream_info_set(), AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, BUF_FLAG_AUDIO_PADDING, BUF_FLAG_HEADER, BUF_FLAG_PREVIEW, buf_element_s::content, buf_element_s::decoder_flags, buf_element_s::decoder_info, lprintf, MAD_PTS_MASK, mad_reset(), buf_element_s::max_size, audio_buffer_s::mem, buf_element_s::mem, mode(), NULL, audio_buffer_s::num_frames, buf_element_s::pts, REST_SIZE, buf_element_s::size, v, audio_buffer_s::vpts, xine_container_of, xine_fast_memcpy, XINE_META_INFO_AUDIOCODEC, XINE_STREAM_INFO_AUDIO_BITRATE, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin().

## ◆ mad_discontinuity()

static void mad_discontinuity | ( | audio_decoder_t * | this_gen | ) |
| static

References xine_container_of.

Referenced by open_plugin().

## ◆ mad_dispose()

static void mad_dispose | ( | audio_decoder_t * | this_gen | ) |
| static

References _mad_fixed_2_db(), xine_container_of, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by open_plugin().

## ◆ mad_reset()

static void mad_reset | ( | audio_decoder_t * | this_gen | ) |
| static

References xine_container_of.

Referenced by mad_decode_data(), and open_plugin().

## ◆ open_plugin()

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

References lprintf, mad_decode_data(), mad_discontinuity(), mad_dispose(), mad_reset(), and NULL.

Referenced by init_plugin().

## Variable Documentation

## ◆ audio_types

const uint32_t audio_types[]
| static

Initial value:
= {
BUF_AUDIO_MPEG, 0
}
BUF_AUDIO_MPEG
#define BUF_AUDIO_MPEG
Definition: buffer.h:210

## ◆ dec_info_audio

const decoder_info_t dec_info_audio
| static

Initial value:
= {
.supported_types = audio_types,
.priority = 8,
}
audio_types
static const uint32_t audio_types[]
Definition: xine_mad_decoder.c:748

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_DECODER, 16, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
init_plugin
static void * init_plugin(xine_t *xine, const void *data)
Definition: xine_mad_decoder.c:736
dec_info_audio
static const decoder_info_t dec_info_audio
Definition: xine_mad_decoder.c:752
NULL
NULL
Definition: xine_plugin.c:78
PLUGIN_AUDIO_DECODER
#define PLUGIN_AUDIO_DECODER
Definition: xine_plugin.h:32
PLUGIN_NONE
#define PLUGIN_NONE
Definition: xine_plugin.h:29