xine-lib 1.2.11
|
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <math.h>
#include <unistd.h>
#include <inttypes.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/audio_out.h>
#include <jack/jack.h>
#include "speakers.h"
Data Structures | |
struct | jack_driver_s |
struct | jack_class_t |
Macros | |
#define | AO_OUT_JACK_IFACE_VERSION 9 |
#define | GAP_TOLERANCE AO_MAX_GAP |
#define | MAX_CHANS 6 |
#define | CHUNK_SIZE (16 * 1024) |
#define | NUM_CHUNKS 8 |
#define | BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE) |
Typedefs | |
typedef struct jack_driver_s | jack_driver_t |
Functions | |
static int | buf_free (jack_driver_t *this) |
get the number of free bytes in the buffer More... | |
static int | buf_used (jack_driver_t *this) |
get amount of data available in the buffer More... | |
static int | write_buffer_32 (jack_driver_t *this, unsigned char *data, int len) |
insert len bytes into buffer More... | |
static int | write_buffer_16 (jack_driver_t *this, unsigned char *data, int len) |
static jack_nframes_t | read_buffer (jack_driver_t *this, float **bufs, jack_nframes_t cnt, unsigned num_bufs, float gain) |
read data from buffer and splitting it into channels More... | |
static void | silence (float **bufs, int cnt, int num_bufs) |
fill the buffers with silence More... | |
static void | jack_reset (jack_driver_t *this) |
stop playing and empty buffers (for seeking/pause) More... | |
static int | jack_callback (jack_nframes_t nframes, void *arg) |
static int | jack_open_device (jack_driver_t *this, const char *jack_device, uint32_t *poutput_sample_rate, int num_channels) |
static void | ao_jack_close (ao_driver_t *this_gen) |
static int | ao_jack_open_int (jack_driver_t *this, const char *jack_device, uint32_t bits, uint32_t rate, int mode) |
static int | ao_jack_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) |
static int | ao_jack_num_channels (ao_driver_t *this_gen) |
static int | ao_jack_bytes_per_frame (ao_driver_t *this_gen) |
static int | ao_jack_get_gap_tolerance (ao_driver_t *this_gen) |
static int | ao_jack_delay (ao_driver_t *this_gen) |
static int | ao_jack_write (ao_driver_t *this_gen, int16_t *frame_buffer, uint32_t num_frames) |
static uint32_t | ao_jack_get_capabilities (ao_driver_t *this_gen) |
static void | ao_jack_exit (ao_driver_t *this_gen) |
static int | ao_jack_get_property (ao_driver_t *this_gen, int property) |
static int | ao_jack_set_property (ao_driver_t *this_gen, int property, int value) |
static int | ao_jack_ctrl (ao_driver_t *this_gen, int cmd,...) |
static void | jack_speaker_arrangement_cb (void *user_data, xine_cfg_entry_t *entry) |
static ao_driver_t * | open_jack_plugin (audio_driver_class_t *class_gen, const void *data) |
static void * | init_class (xine_t *xine, const void *data) |
Variables | |
static ao_info_t | ao_info_jack |
const plugin_info_t xine_plugin_info[] | EXPORTED |
#define AO_OUT_JACK_IFACE_VERSION 9 |
#define BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE) |
#define CHUNK_SIZE (16 * 1024) |
size of one chunk, if this is too small Xine will start to "stutter"
after a short time of playback
#define GAP_TOLERANCE AO_MAX_GAP |
#define MAX_CHANS 6 |
#define NUM_CHUNKS 8 |
number of "virtual" chunks the buffer consists of
typedef struct jack_driver_s jack_driver_t |
|
static |
Referenced by open_jack_plugin().
|
static |
close the device and reset the play position
References jack_reset(), NULL, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by ao_jack_exit(), ao_jack_open_int(), and open_jack_plugin().
|
static |
References AO_CTRL_FLUSH_BUFFERS, AO_CTRL_PLAY_PAUSE, AO_CTRL_PLAY_RESUME, and jack_reset().
Referenced by open_jack_plugin().
|
static |
References buf_used().
Referenced by open_jack_plugin().
|
static |
References ao_jack_close(), and NULL.
Referenced by open_jack_plugin().
|
static |
Referenced by open_jack_plugin().
|
static |
References GAP_TOLERANCE.
Referenced by open_jack_plugin().
|
static |
References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, and AO_PROP_PCM_VOL.
Referenced by open_jack_plugin().
|
static |
Referenced by open_jack_plugin().
|
static |
References ao_jack_open_int(), bits, mode(), xine_config_free_string(), xine_config_lookup_string(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_jack_plugin().
|
static |
References AO_CAP_MODE_4_1CHANNEL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_A52, AO_CAP_MODE_AC5, AO_CAP_MODE_MONO, AO_CAP_MODE_STEREO, ao_jack_close(), bits, jack_open_device(), mode(), XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by ao_jack_open().
|
static |
References AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, and AO_PROP_PCM_VOL.
Referenced by open_jack_plugin().
|
static |
References write_buffer_16(), write_buffer_32(), xine_usec_sleep(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_jack_plugin().
|
static |
get the number of free bytes in the buffer
may only be called by Xine's thread return value may change between immediately following two calls, and the real number of free bytes might be larger!
References BUFFSIZE, and CHUNK_SIZE.
Referenced by _meta_info_set_encoding(), write_buffer_16(), and write_buffer_32().
|
static |
get amount of data available in the buffer
may only be called by the playback thread return value may change between immediately following two calls, and the real number of buffered bytes might be larger!
References BUFFSIZE.
Referenced by ao_jack_delay(), demux_asf_parse_asx_references(), demux_asf_read_file(), demux_real_parse_references(), and read_buffer().
|
static |
|
static |
References MAX_CHANS, read_buffer(), silence(), XINE_VERBOSITY_LOG, and xprintf.
Referenced by jack_open_device().
|
static |
References jack_callback(), jack_reset(), MAX_CHANS, NULL, XINE_VERBOSITY_LOG, and xprintf.
Referenced by ao_jack_open_int().
|
static |
stop playing and empty buffers (for seeking/pause)
Referenced by ao_jack_close(), ao_jack_ctrl(), jack_open_device(), and open_jack_plugin().
|
static |
References AO_CAP_MODE_4_1CHANNEL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, xine_cfg_entry_s::num_value, SURROUND4, SURROUND41, SURROUND5, SURROUND51, and user_data().
Referenced by open_jack_plugin().
|
static |
References _, AO_CAP_FLOAT32, AO_CAP_MIXER_VOL, AO_CAP_MODE_4CHANNEL, AO_CAP_MODE_5_1CHANNEL, AO_CAP_MODE_5CHANNEL, AO_CAP_MODE_STEREO, AO_CAP_MUTE_VOL, ao_jack_bytes_per_frame(), ao_jack_close(), ao_jack_ctrl(), ao_jack_delay(), ao_jack_exit(), ao_jack_get_capabilities(), ao_jack_get_gap_tolerance(), ao_jack_get_property(), ao_jack_num_channels(), ao_jack_open(), ao_jack_set_property(), ao_jack_write(), AUDIO_DEVICE_SPEAKER_ARRANGEMENT_HELP, AUDIO_DEVICE_SPEAKER_ARRANGEMENT_TYPES, BUFFSIZE, xine_s::config, jack_reset(), jack_speaker_arrangement_cb(), NULL, STEREO, SURROUND4, SURROUND5, SURROUND51, config_values_s::xine, jack_class_t::xine, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by init_class().
|
static |
read data from buffer and splitting it into channels
bufs | num_bufs float buffers, each will contain the data of one channel |
cnt | number of samples to read per channel |
num_bufs | number of channels to split the data into |
Assumes the data in the buffer is of type float, the number of bytes read is res * num_bufs * sizeof(float), where res is the return value. If there is not enough data in the buffer remaining parts will be filled with silence.
References buf_used(), and BUFFSIZE.
Referenced by jack_callback().
|
static |
fill the buffers with silence
bufs | num_bufs float buffers, each will contain the data of one channel |
cnt | number of samples in each buffer |
num_bufs | number of buffers |
Referenced by jack_callback(), and realtime_samplecounter_available().
|
static |
References buf_free(), and BUFFSIZE.
Referenced by ao_jack_write().
|
static |
insert len bytes into buffer
data | data to insert |
len | length of data |
If there is not enough room, the buffer is filled up
TODO: Xine should really pass data as float, perhaps in V1.2?
References buf_free(), and BUFFSIZE.
Referenced by ao_jack_write().
|
static |
const plugin_info_t xine_plugin_info [] EXPORTED |