xine-lib: xine-lib-1.2.12/src/demuxers/demux_mod.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Functions | Variables
demux_mod.c File Reference
`#include <stdio.h>`
`#include <fcntl.h>`
`#include <unistd.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/compat.h>`
`#include <xine/demux.h>`
`#include <libmodplug/modplug.h>`
`#include "bswap.h"`

## Data Structures
struct | demux_mod_t

## Macros
#define | LOG_MODULE "demux_mod"
#define | MOD_SAMPLERATE 44100
#define | MOD_BITS 16
#define | MOD_CHANNELS 2
#define | OUT_BYTES_PER_SECOND (MOD_SAMPLERATE * MOD_CHANNELS * (MOD_BITS >> 3))
#define | BLOCK_SIZE 4096
#define | FOURCC_32(a, b, c, d) (d + (c<<8) + (b<<16) + (a<<24))

## Functions
static int | probe_mod_file (input_plugin_t *input)
| Probes if the given file can be demuxed using modplug or not. More...
static int | open_mod_file (demux_mod_t *this, input_plugin_t *input)
static int | demux_mod_send_chunk (demux_plugin_t *this_gen)
static void | demux_mod_send_headers (demux_plugin_t *this_gen)
static int | demux_mod_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing)
static void | demux_mod_dispose (demux_plugin_t *this_gen)
static int | demux_mod_get_status (demux_plugin_t *this_gen)
static int | demux_mod_get_stream_length (demux_plugin_t *this_gen)
static uint32_t | demux_mod_get_capabilities (demux_plugin_t *this_gen)
static int | demux_mod_get_optional_data (demux_plugin_t *this_gen, void *data, int data_type)
static demux_plugin_t * | open_plugin (demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input)
static void * | demux_mod_init_plugin (xine_t *xine, const void *data)

## Variables
static const demuxer_info_t | demux_info_mod
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ BLOCK_SIZE

#define BLOCK_SIZE 4096

## ◆ FOURCC_32

#define FOURCC_32 | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d
| ) |  | (d + (c<<8) + (b<<16) + (a<<24))

## ◆ LOG_MODULE

#define LOG_MODULE "demux_mod"

## ◆ MOD_BITS

#define MOD_BITS 16

## ◆ MOD_CHANNELS

#define MOD_CHANNELS 2

## ◆ MOD_SAMPLERATE

#define MOD_SAMPLERATE 44100

## ◆ OUT_BYTES_PER_SECOND

#define OUT_BYTES_PER_SECOND (MOD_SAMPLERATE * MOD_CHANNELS * (MOD_BITS >> 3))

## Function Documentation

## ◆ demux_mod_dispose()

static void demux_mod_dispose | ( | demux_plugin_t * | this_gen | ) |
| static

References _x_freep().

Referenced by open_plugin().

## ◆ demux_mod_get_capabilities()

static uint32_t demux_mod_get_capabilities | ( | demux_plugin_t * | this_gen | ) |
| static

References DEMUX_CAP_NOCAP.

Referenced by open_plugin().

## ◆ demux_mod_get_optional_data()

static int demux_mod_get_optional_data | ( | demux_plugin_t * | this_gen,
|  | void * | data,
|  | int | data_type
| ) |  |
| static

References DEMUX_OPTIONAL_UNSUPPORTED.

Referenced by open_plugin().

## ◆ demux_mod_get_status()

static int demux_mod_get_status | ( | demux_plugin_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ demux_mod_get_stream_length()

static int demux_mod_get_stream_length | ( | demux_plugin_t * | this_gen | ) |
| static

Referenced by open_plugin().

## ◆ demux_mod_init_plugin()

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

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

## ◆ demux_mod_seek()

static int demux_mod_seek | ( | demux_plugin_t * | this_gen,
|  | off_t | start_pos,
|  | int | start_time,
|  | int | playing
| ) |  |
| static

References _x_demux_flush_engine().

Referenced by open_plugin().

## ◆ demux_mod_send_chunk()

static int demux_mod_send_chunk | ( | demux_plugin_t * | this_gen | ) |
| static

References _x_demux_control_newpts(), BUF_AUDIO_LPCM_LE, BUF_FLAG_FRAME_END, BUF_FLAG_SEEK, buf_element_s::content, buf_element_s::decoder_flags, DEMUX_FINISHED, buf_element_s::extra_info, buf_element_s::free_buffer, extra_info_s::input_normpos, extra_info_s::input_time, buf_element_s::max_size, OUT_BYTES_PER_SECOND, buf_element_s::pts, buf_element_s::size, and buf_element_s::type.

Referenced by open_plugin().

## ◆ demux_mod_send_headers()

static void demux_mod_send_headers | ( | demux_plugin_t * | this_gen | ) |
| static

References _x_demux_control_start(), _x_meta_info_set(), _x_stream_info_set(), BUF_AUDIO_LPCM_LE, BUF_FLAG_FRAME_END, BUF_FLAG_HEADER, BUF_FLAG_STDHEADER, buf_element_s::decoder_flags, buf_element_s::decoder_info, DEMUX_OK, MOD_BITS, MOD_CHANNELS, MOD_SAMPLERATE, buf_element_s::size, buf_element_s::type, XINE_META_INFO_ARTIST, XINE_META_INFO_COMMENT, XINE_META_INFO_TITLE, XINE_STREAM_INFO_AUDIO_BITS, XINE_STREAM_INFO_AUDIO_CHANNELS, XINE_STREAM_INFO_AUDIO_SAMPLERATE, XINE_STREAM_INFO_HAS_AUDIO, and XINE_STREAM_INFO_HAS_VIDEO.

Referenced by open_plugin().

## ◆ open_mod_file()

static int open_mod_file | ( | demux_mod_t * | this,
|  | input_plugin_t * | input
| ) |  |
| static

References input(), MOD_BITS, MOD_CHANNELS, MOD_SAMPLERATE, NULL, xine_log(), and XINE_LOG_PLUGIN.

Referenced by open_plugin().

## ◆ open_plugin()

static demux_plugin_t * open_plugin | ( | demux_class_t * | class_gen,
|  | xine_stream_t * | stream,
|  | input_plugin_t * | input
| ) |  |
| static

References xine_stream_s::content_detection_method, DEMUX_FINISHED, demux_mod_dispose(), demux_mod_get_capabilities(), demux_mod_get_optional_data(), demux_mod_get_status(), demux_mod_get_stream_length(), demux_mod_seek(), demux_mod_send_chunk(), demux_mod_send_headers(), input(), INPUT_IS_SEEKABLE, METHOD_BY_CONTENT, METHOD_BY_MRL, METHOD_EXPLICIT, NULL, open_mod_file(), probe_mod_file(), xine_stream_s::xine, XINE_VERBOSITY_DEBUG, and xprintf.

Referenced by demux_mod_init_plugin().

## ◆ probe_mod_file()

static int probe_mod_file | ( | input_plugin_t * | input | ) |
| static

Probes if the given file can be demuxed using modplug or not.

Return values

  0 | The file is not a valid modplug file (or the probe isn't complete yet)
  1 | The file has been identified as a valid modplug file

Todo:
  Just Protracker files are detected right now.

References _X_ABE_32, _x_demux_read_header(), FOURCC_32, and input().

Referenced by open_plugin().

## Variable Documentation

## ◆ demux_info_mod

const demuxer_info_t demux_info_mod
| static

Initial value:
= {
.priority = 10,
}

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_DEMUX, 27, "modplug", XINE_VERSION_CODE, &demux_info_mod, demux_mod_init_plugin },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
demux_info_mod
static const demuxer_info_t demux_info_mod
Definition: demux_mod.c:393
demux_mod_init_plugin
static void * demux_mod_init_plugin(xine_t *xine, const void *data)
Definition: demux_mod.c:363
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
NULL
NULL
Definition: xine_plugin.c:78
PLUGIN_DEMUX
#define PLUGIN_DEMUX
Definition: xine_plugin.h:31
PLUGIN_NONE
#define PLUGIN_NONE
Definition: xine_plugin.h:29