xine-lib 1.2.13-20230125hg15249
|
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <math.h>
#include <alsa/asoundlib.h>
#include <sys/ioctl.h>
#include <inttypes.h>
#include <pthread.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/compat.h>
#include <xine/audio_out.h>
#include "speakers.h"
Data Structures | |
struct | alsa_class_t |
struct | alsa_driver_s |
struct | alsa_driver_s::_alsa_dev_info_s |
Macros | |
#define | ALSA_PCM_NEW_HW_PARAMS_API |
#define | ALSA_PCM_NEW_SW_PARAMS_API |
#define | AO_OUT_ALSA_IFACE_VERSION 9 |
#define | BUFFER_TIME 1000*1000 |
#define | GAP_TOLERANCE 5000 |
#define | MIXER_MASK_LEFT 0x0001 |
#define | MIXER_MASK_RIGHT 0x0002 |
#define | MIXER_MASK_MUTE 0x0004 |
#define | MIXER_MASK_STEREO 0x0008 |
#define | MIXER_HAS_MUTE_SWITCH 0x0010 |
Typedefs | |
typedef struct alsa_driver_s | alsa_driver_t |
Functions | |
static int | ao_alsa_get_percent_from_volume (long val, long min, long max) |
static int | my_snd_mixer_wait (snd_mixer_t *mixer, int timeout) |
static void * | ao_alsa_handle_event_thread (void *data) |
static long | ao_alsa_get_volume_from_percent (int val, long min, long max) |
static void | error_callback (const char *file, int line, const char *function, int err, const char *fmt,...) |
static int | ao_alsa_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode) |
static int | ao_alsa_num_channels (ao_driver_t *this_gen) |
static int | ao_alsa_bytes_per_frame (ao_driver_t *this_gen) |
static int | ao_alsa_get_gap_tolerance (ao_driver_t *this_gen) |
static int | ao_alsa_delay (ao_driver_t *this_gen) |
static int | resume (snd_pcm_t *pcm) |
static int | ao_alsa_write (ao_driver_t *this_gen, int16_t *data, uint32_t count) |
static void | ao_alsa_close (ao_driver_t *this_gen) |
static uint32_t | ao_alsa_get_capabilities (ao_driver_t *this_gen) |
static void | ao_alsa_exit (ao_driver_t *this_gen) |
static int | ao_alsa_get_property (ao_driver_t *this_gen, int property) |
static int | ao_alsa_set_property (ao_driver_t *this_gen, int property, int value) |
static int | ao_alsa_ctrl (ao_driver_t *this_gen, int cmd,...) |
static void | ao_alsa_mixer_init (ao_driver_t *this_gen) |
static void | alsa_apply_speaker_arrangement (alsa_driver_t *this, int speakers) |
static void | _alsa_mmap_cb (void *user_data, xine_cfg_entry_t *entry) |
static void | _alsa_speaker_arrangement_cb (void *user_data, xine_cfg_entry_t *entry) |
static char * | _alsa_safe_strdup (const char *s) |
static void | _alsa_dev_name_cb (void *user_data, xine_cfg_entry_t *entry) |
static int | _alsa_query_dev (alsa_driver_t *this, uint32_t index) |
static ao_driver_t * | open_plugin (audio_driver_class_t *class_gen, const void *data) |
static void * | init_class (xine_t *xine, const void *data) |
Variables | |
static snd_output_t * | jcd_out |
static ao_info_t | ao_info_alsa |
const plugin_info_t xine_plugin_info[] | EXPORTED |
#define ALSA_PCM_NEW_HW_PARAMS_API |
#define ALSA_PCM_NEW_SW_PARAMS_API |
#define AO_OUT_ALSA_IFACE_VERSION 9 |
#define BUFFER_TIME 1000*1000 |
Referenced by ao_alsa_open().
#define GAP_TOLERANCE 5000 |
Referenced by ao_alsa_get_gap_tolerance().
#define MIXER_HAS_MUTE_SWITCH 0x0010 |
Referenced by ao_alsa_get_property(), ao_alsa_handle_event_thread(), ao_alsa_mixer_init(), and ao_alsa_set_property().
#define MIXER_MASK_LEFT 0x0001 |
Referenced by ao_alsa_handle_event_thread(), ao_alsa_mixer_init(), and ao_alsa_set_property().
#define MIXER_MASK_MUTE 0x0004 |
Referenced by ao_alsa_get_property(), ao_alsa_handle_event_thread(), ao_alsa_mixer_init(), and ao_alsa_set_property().
#define MIXER_MASK_RIGHT 0x0002 |
Referenced by ao_alsa_handle_event_thread(), ao_alsa_mixer_init(), and ao_alsa_set_property().
#define MIXER_MASK_STEREO 0x0008 |
Referenced by ao_alsa_handle_event_thread(), ao_alsa_mixer_init(), and ao_alsa_set_property().
typedef struct alsa_driver_s alsa_driver_t |
|
static |
References _alsa_safe_strdup(), xine_cfg_entry_s::str_value, and user_data().
Referenced by open_plugin().
|
static |
References xine_cfg_entry_s::num_value, and user_data().
Referenced by open_plugin().
|
static |
References _, AO_CAP_16BITS, AO_CAP_24BITS, AO_CAP_8BITS, AO_CAP_FLOAT32, AO_CAP_MODE_A52, AO_CAP_MODE_AC5, name, NULL, type, xine_log(), XINE_LOG_MSG, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin().
|
static |
References NULL.
Referenced by _alsa_dev_name_cb(), and open_plugin().
|
static |
References alsa_apply_speaker_arrangement(), xine_cfg_entry_s::num_value, and user_data().
Referenced by open_plugin().
|
static |
References _, A52_PASSTHRU, AO_CAP_16BITS, AO_CAP_24BITS, AO_CAP_8BITS, AO_CAP_FLOAT32, 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, SURROUND4, SURROUND41, SURROUND5, SURROUND51, type, XINE_VERBOSITY_LOG, and xprintf.
Referenced by _alsa_speaker_arrangement_cb(), and open_plugin().
|
static |
Referenced by open_plugin().
|
static |
References NULL.
Referenced by open_plugin().
|
static |
References ao_alsa_ctrl(), AO_CTRL_FLUSH_BUFFERS, AO_CTRL_PLAY_PAUSE, AO_CTRL_PLAY_RESUME, NULL, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by ao_alsa_ctrl(), and open_plugin().
|
static |
References now().
Referenced by open_plugin().
|
static |
References _x_freep(), name, NULL, and xine_config_free_string().
Referenced by open_plugin().
|
static |
Referenced by open_plugin().
|
static |
References GAP_TOLERANCE.
Referenced by open_plugin().
|
static |
Referenced by ao_alsa_get_property(), and ao_alsa_handle_event_thread().
|
static |
References ao_alsa_get_percent_from_volume(), AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, MIXER_HAS_MUTE_SWITCH, MIXER_MASK_MUTE, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin().
|
static |
Referenced by ao_alsa_set_property().
|
static |
References ao_alsa_get_percent_from_volume(), xine_audio_level_data_t::left, MIXER_HAS_MUTE_SWITCH, MIXER_MASK_LEFT, MIXER_MASK_MUTE, MIXER_MASK_RIGHT, MIXER_MASK_STEREO, xine_audio_level_data_t::mute, my_snd_mixer_wait(), NULL, xine_audio_level_data_t::right, XINE_EVENT_AUDIO_LEVEL, xine_event_send(), xine_list_next_value(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by ao_alsa_mixer_init().
|
static |
References _, ao_alsa_handle_event_thread(), AO_CAP_MIXER_VOL, AO_CAP_MUTE_VOL, AO_CAP_PCM_VOL, xine_s::config, config_values_s::free_string, LOG_MODULE, config_values_s::lookup_string, MIXER_HAS_MUTE_SWITCH, MIXER_MASK_LEFT, MIXER_MASK_MUTE, MIXER_MASK_RIGHT, MIXER_MASK_STEREO, NULL, config_values_s::register_bool, SCHED_OTHER, config_values_s::update_string, config_values_s::xine, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by open_plugin().
|
static |
Referenced by open_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_CAP_NO_UNPAUSE, bits, BUFFER_TIME, jcd_out, mode(), NULL, xine_log(), XINE_LOG_MSG, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.
Referenced by open_plugin().
|
static |
References ao_alsa_get_volume_from_percent(), AO_PROP_MIXER_VOL, AO_PROP_MUTE_VOL, AO_PROP_PCM_VOL, MIXER_HAS_MUTE_SWITCH, MIXER_MASK_LEFT, MIXER_MASK_MUTE, MIXER_MASK_RIGHT, MIXER_MASK_STEREO, XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin().
|
static |
References jcd_out, now(), resume(), XINE_VERBOSITY_DEBUG, and xprintf.
Referenced by open_plugin().
|
static |
References function, and NULL.
Referenced by open_plugin().
|
static |
References default_audio_driver_class_dispose, N_, NULL, and open_plugin().
|
static |
References NULL.
Referenced by ao_alsa_handle_event_thread().
|
static |
References _, _alsa_dev_name_cb(), _alsa_mmap_cb(), _alsa_query_dev(), _alsa_safe_strdup(), _alsa_speaker_arrangement_cb(), _x_freep(), A52_PASSTHRU, alsa_apply_speaker_arrangement(), ao_alsa_bytes_per_frame(), ao_alsa_close(), ao_alsa_ctrl(), ao_alsa_delay(), ao_alsa_exit(), ao_alsa_get_capabilities(), ao_alsa_get_gap_tolerance(), ao_alsa_get_property(), ao_alsa_mixer_init(), ao_alsa_num_channels(), ao_alsa_open(), ao_alsa_set_property(), ao_alsa_write(), AUDIO_DEVICE_SPEAKER_ARRANGEMENT_HELP, AUDIO_DEVICE_SPEAKER_ARRANGEMENT_TYPES, xine_s::config, error_callback(), name, NULL, STEREO, SURROUND4, SURROUND41, SURROUND5, SURROUND51, SURROUND6, SURROUND61, SURROUND71, config_values_s::xine, xine_log(), and XINE_LOG_MSG.
Referenced by init_class().
|
static |
Referenced by ao_alsa_write().
|
static |
const plugin_info_t xine_plugin_info [] EXPORTED |
|
static |
Referenced by ao_alsa_open(), and ao_alsa_write().