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

xine-lib 1.2.12

Data Structures | Macros | Functions | Variables
xine_dts_decoder.c File Reference

DTS decoder for xine. More...

`#include <stdlib.h>`
`#include <unistd.h>`
`#include <string.h>`
`#include <sys/types.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/audio_out.h>`
`#include <xine/buffer.h>`
`#include "bswap.h"`
`#include <dts.h>`

## Data Structures
struct | dts_decoder_t

## Macros
#define | _DEFAULT_SOURCE 1
#define | _XOPEN_SOURCE 500
#define | _BSD_SOURCE 1
#define | LOG_MODULE "libdts"
#define | LOG_VERBOSE
#define | MAX_AC5_FRAME 4096

## Functions
static void | dts_reset (audio_decoder_t *const this_gen)
static void | dts_discontinuity (audio_decoder_t *const this_gen)
static void | float_to_int (const float *const _f, int16_t *const s16, const int num_channels)
| Convert a array of floating point samples into 16-bit signed integer samples. More...
static void | mute_channel (int16_t *const s16, const int num_channels)
static void | dts_decode_frame (dts_decoder_t *this, const int64_t pts)
static void | dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
static void | dts_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

## Detailed Description

DTS decoder for xine.

Author
  Joachim Koenig (2001-09-04)
  James Courtier-Dutton (2001-12-09)

## Macro Definition Documentation

## ◆ _BSD_SOURCE

#define _BSD_SOURCE 1

## ◆ _DEFAULT_SOURCE

#define _DEFAULT_SOURCE 1

## ◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE 500

## ◆ LOG_MODULE

#define LOG_MODULE "libdts"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ MAX_AC5_FRAME

#define MAX_AC5_FRAME 4096

## Function Documentation

## ◆ dts_decode_data()

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

References _x_meta_info_get(), _x_meta_info_set_utf8(), _x_stream_info_set(), be2me_32, BUF_FLAG_PREVIEW, BUF_FLAG_STDHEADER, buf_element_s::content, buf_element_s::decoder_flags, dts_decode_frame(), lprintf, MAX_AC5_FRAME, buf_element_s::pts, buf_element_s::size, xine_container_of, XINE_META_INFO_AUDIOCODEC, XINE_STREAM_INFO_AUDIO_BITRATE, and XINE_STREAM_INFO_AUDIO_SAMPLERATE.

Referenced by open_plugin().

## ◆ dts_decode_frame()

static void dts_decode_frame | ( | dts_decoder_t * | this,
|  | const int64_t | pts
| ) |  |
| static

References AO_CAP_MODE_4_1CHANNEL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_AC5, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, float_to_int(), lprintf, MAX_AC5_FRAME, audio_buffer_s::mem, mute_channel(), audio_buffer_s::num_frames, audio_buffer_s::stream, audio_buffer_s::vpts, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by dts_decode_data().

## ◆ dts_discontinuity()

static void dts_discontinuity | ( | audio_decoder_t *const | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ dts_dispose()

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

References NULL, and xine_container_of.

Referenced by open_plugin().

## ◆ dts_reset()

static void dts_reset | ( | audio_decoder_t *const | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ float_to_int()

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

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

Parameters

  f | Floating point samples array (origin)
  s16 | 16-bit signed integer samples array (destination)
  num_channels | Number of channels present in the stream

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.

Note
  This is subtly different from the function with the same name in xine_musepack_decoder.c

References INT16_MAX, and INT16_MIN.

Referenced by dts_decode_frame().

## ◆ 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.

## ◆ mute_channel()

static void mute_channel | ( | int16_t *const | s16,
|  | const int | num_channels
| ) |  |
| inlinestatic

Referenced by dts_decode_frame().

## ◆ open_plugin()

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

References _, AO_CAP_MODE_4_1CHANNEL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_AC5, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, xine_stream_s::audio_out, dts_decode_data(), dts_discontinuity(), dts_dispose(), dts_reset(), xine_audio_port_s::get_capabilities, lprintf, NULL, xine_stream_s::xine, XINE_VERBOSITY_LOG, and xprintf.

Referenced by init_plugin().

## Variable Documentation

## ◆ audio_types

const uint32_t audio_types[]
| static

Initial value:
= {
BUF_AUDIO_DTS, 0
}
BUF_AUDIO_DTS
#define BUF_AUDIO_DTS
Definition: buffer.h:214

## ◆ 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_dts_decoder.c:579

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_AUDIO_DECODER, 16, "dts", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
init_plugin
static void * init_plugin(xine_t *xine, const void *data)
Definition: xine_dts_decoder.c:566
dec_info_audio
static const decoder_info_t dec_info_audio
Definition: xine_dts_decoder.c:583
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
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