pulseaudio  14.2
About: PulseAudio is a networked sound server (for POSIX OSes), a proxy for your sound applications.
  Fossies Dox: pulseaudio-14.2.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

module-ladspa-sink.c File Reference
#include <math.h>
#include <pulse/xmalloc.h>
#include <pulsecore/i18n.h>
#include <pulsecore/namereg.h>
#include <pulsecore/sink.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/sample-util.h>
#include <pulsecore/ltdl-helper.h>
#include "ladspa.h"
Include dependency graph for module-ladspa-sink.c:

Go to the source code of this file.

Data Structures

struct  userdata
 

Macros

#define MEMBLOCKQ_MAXLENGTH   (16*1024*1024)
 
#define DEFAULT_AUTOLOADED   false
 

Enumerations

enum  { LADSPA_SINK_MESSAGE_UPDATE_PARAMETERS = PA_SINK_MESSAGE_MAX }
 

Functions

 PA_MODULE_AUTHOR ("Lennart Poettering")
 This file is part of PulseAudio. More...
 
 PA_MODULE_DESCRIPTION (_("Virtual LADSPA sink"))
 
 PA_MODULE_VERSION (PACKAGE_VERSION)
 
 PA_MODULE_LOAD_ONCE (false)
 
 PA_MODULE_USAGE (_("sink_name=<name for the sink> " "sink_properties=<properties for the sink> " "sink_input_properties=<properties for the sink input> " "master=<name of sink to filter> " "sink_master=<name of sink to filter> " "format=<sample format> " "rate=<sample rate> " "channels=<number of channels> " "channel_map=<input channel map> " "plugin=<ladspa plugin name> " "label=<ladspa plugin label> " "control=<comma separated list of input control values> " "input_ladspaport_map=<comma separated list of input LADSPA port names> " "output_ladspaport_map=<comma separated list of output LADSPA port names> " "autoloaded=<set if this module is being loaded automatically> "))
 
static int write_control_parameters (struct userdata *u, double *control_values, bool *use_default)
 
static void connect_control_ports (struct userdata *u)
 
static int sink_process_msg_cb (pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk)
 
static int sink_set_state_in_main_thread_cb (pa_sink *s, pa_sink_state_t state, pa_suspend_cause_t suspend_cause)
 
static int sink_set_state_in_io_thread_cb (pa_sink *s, pa_sink_state_t new_state, pa_suspend_cause_t new_suspend_cause)
 
static void sink_request_rewind_cb (pa_sink *s)
 
static void sink_update_requested_latency_cb (pa_sink *s)
 
static void sink_set_mute_cb (pa_sink *s)
 
static int sink_input_pop_cb (pa_sink_input *i, size_t nbytes, pa_memchunk *chunk)
 
static void sink_input_process_rewind_cb (pa_sink_input *i, size_t nbytes)
 
static void sink_input_update_max_rewind_cb (pa_sink_input *i, size_t nbytes)
 
static void sink_input_update_max_request_cb (pa_sink_input *i, size_t nbytes)
 
static void sink_input_update_sink_latency_range_cb (pa_sink_input *i)
 
static void sink_input_update_sink_fixed_latency_cb (pa_sink_input *i)
 
static void sink_input_detach_cb (pa_sink_input *i)
 
static void sink_input_attach_cb (pa_sink_input *i)
 
static void sink_input_kill_cb (pa_sink_input *i)
 
static bool sink_input_may_move_to_cb (pa_sink_input *i, pa_sink *dest)
 
static void sink_input_moving_cb (pa_sink_input *i, pa_sink *dest)
 
static void sink_input_mute_changed_cb (pa_sink_input *i)
 
static void sink_input_suspend_cb (pa_sink_input *i, pa_sink_state_t old_state, pa_suspend_cause_t old_suspend_cause)
 
static int parse_control_parameters (struct userdata *u, const char *cdata, double *read_values, bool *use_default)
 
static int validate_control_parameters (struct userdata *u, double *control_values, bool *use_default)
 
int pa__init (pa_module *m)
 
int pa__get_n_used (pa_module *m)
 
void pa__done (pa_module *m)
 

Variables

static const char *const valid_modargs []
 

Macro Definition Documentation

◆ DEFAULT_AUTOLOADED

#define DEFAULT_AUTOLOADED   false

Definition at line 71 of file module-ladspa-sink.c.

◆ MEMBLOCKQ_MAXLENGTH

#define MEMBLOCKQ_MAXLENGTH   (16*1024*1024)

Definition at line 70 of file module-ladspa-sink.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LADSPA_SINK_MESSAGE_UPDATE_PARAMETERS 

Definition at line 128 of file module-ladspa-sink.c.

Function Documentation

◆ connect_control_ports()

◆ pa__done()

◆ pa__get_n_used()

int pa__get_n_used ( pa_module m)

◆ pa__init()

int pa__init ( pa_module m)

Definition at line 992 of file module-ladspa-sink.c.

References _LADSPA_Descriptor::activate, pa_module::argument, pa_sink::asyncmsgq, pa_sink_input::attach, userdata::auto_desc, userdata::autoloaded, userdata::block_size, pa_sink::channel_map, userdata::channels, pa_sample_spec::channels, connect_control_ports(), _LADSPA_Descriptor::connect_port, userdata::control, _LADSPA_Descriptor::Copyright, pa_module::core, dbus_init(), DEFAULT_AUTOLOADED, userdata::descriptor, pa_sink_input::detach, pa_module::dl, pa_sink_input_new_data::driver, pa_sink_new_data::driver, fail(), pa_sink_input_new_data::flags, pa_sink::flags, pa_sample_spec::format, userdata::handle, userdata::input, userdata::input_count, pa_sink::input_to_master, _LADSPA_Descriptor::instantiate, pa_sink_input::kill, _LADSPA_Descriptor::Label, LADSPA_IS_INPLACE_BROKEN, LADSPA_IS_PORT_AUDIO, LADSPA_IS_PORT_CONTROL, LADSPA_IS_PORT_INPUT, LADSPA_IS_PORT_OUTPUT, _LADSPA_Descriptor::Maker, userdata::max_ladspaport_count, pa_sink_input::may_move_to, pa_memchunk::memblock, userdata::memblockq, MEMBLOCKQ_MAXLENGTH, pa_core::mempool, userdata::module, pa_sink_input_new_data::module, pa_sink_new_data::module, pa_sink_input::moving, pa_sink_input::mute_changed, userdata::n_control, _LADSPA_Descriptor::Name, pa_sink::name, pa_sink_new_data::name, pa_sink_input_new_data::origin_sink, userdata::output, userdata::output_count, pa__done(), pa_assert, pa_assert_cc, PA_CHANNEL_MAP_DEFAULT, PA_CHANNELS_MAX, PA_EXPAND_AND_STRINGIZE, pa_frame_align(), pa_load_sym(), pa_log, pa_log_debug(), pa_log_warn(), pa_memblock_unref(), pa_memblockq_new(), pa_mempool_block_size_max(), pa_modargs_free(), pa_modargs_get_proplist(), pa_modargs_get_sample_spec_and_channel_map(), pa_modargs_get_value(), pa_modargs_get_value_boolean(), pa_modargs_new(), pa_namereg_get(), PA_NAMEREG_SINK, PA_PROP_DEVICE_CLASS, PA_PROP_DEVICE_DESCRIPTION, PA_PROP_DEVICE_MASTER_DEVICE, PA_PROP_MEDIA_NAME, PA_PROP_MEDIA_ROLE, pa_proplist_contains(), pa_proplist_gets(), pa_proplist_setf(), pa_proplist_sets(), PA_SAMPLE_FLOAT32, PA_SINK_DYNAMIC_LATENCY, pa_sink_input_cork(), pa_sink_input_get_silence(), pa_sink_input_new(), pa_sink_input_new_data_done(), pa_sink_input_new_data_init(), pa_sink_input_new_data_set_channel_map(), pa_sink_input_new_data_set_sample_spec(), pa_sink_input_new_data_set_sink(), pa_sink_input_put(), PA_SINK_INPUT_START_CORKED, PA_SINK_LATENCY, pa_sink_new(), pa_sink_new_data_done(), pa_sink_new_data_init(), pa_sink_new_data_set_channel_map(), pa_sink_new_data_set_sample_spec(), pa_sink_put(), pa_sink_set_asyncmsgq(), pa_sink_set_set_mute_callback(), pa_split(), pa_sprintf_malloc(), pa_streq, PA_UPDATE_REPLACE, pa_xfree(), pa_xnew, pa_xnew0, pa_xstrdup(), pa_sink::parent, parse_control_parameters(), pa_sink_input::pop, _LADSPA_Descriptor::PortCount, _LADSPA_Descriptor::PortDescriptors, _LADSPA_Descriptor::PortNames, pa_msgobject::process_msg, pa_sink_input::process_rewind, _LADSPA_Descriptor::Properties, pa_sink_input_new_data::proplist, pa_sink::proplist, pa_sink_new_data::proplist, pa_sample_spec::rate, pa_sink::request_rewind, pa_sink::sample_spec, pa_sink::set_state_in_io_thread, pa_sink::set_state_in_main_thread, userdata::sink, userdata::sink_input, sink_input_attach_cb(), sink_input_detach_cb(), sink_input_kill_cb(), sink_input_may_move_to_cb(), sink_input_moving_cb(), sink_input_mute_changed_cb(), sink_input_pop_cb(), sink_input_process_rewind_cb(), sink_input_suspend_cb(), sink_input_update_max_request_cb(), sink_input_update_max_rewind_cb(), sink_input_update_sink_fixed_latency_cb(), sink_input_update_sink_latency_range_cb(), sink_process_msg_cb(), sink_request_rewind_cb(), sink_set_mute_cb(), sink_set_state_in_io_thread_cb(), sink_set_state_in_main_thread_cb(), sink_update_requested_latency_cb(), userdata::ss, pa_sink_input::suspend, _LADSPA_Descriptor::UniqueID, pa_sink_input::update_max_request, pa_sink_input::update_max_rewind, pa_sink::update_requested_latency, pa_sink_input::update_sink_fixed_latency, pa_sink_input::update_sink_latency_range, userdata::use_default, pa_module::userdata, pa_sink_input::userdata, pa_sink::userdata, valid_modargs, and write_control_parameters().

◆ PA_MODULE_AUTHOR()

PA_MODULE_AUTHOR ( "Lennart Poettering"  )

This file is part of PulseAudio.

Copyright 2004-2008 Lennart Poettering

PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

PulseAudio is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with PulseAudio; if not, see http://www.gnu.org/licenses/.

◆ PA_MODULE_DESCRIPTION()

PA_MODULE_DESCRIPTION ( _("Virtual LADSPA sink")  )

◆ PA_MODULE_LOAD_ONCE()

PA_MODULE_LOAD_ONCE ( false  )

◆ PA_MODULE_USAGE()

PA_MODULE_USAGE ( _("sink_name=<name for the sink> " "sink_properties=<properties for the sink> " "sink_input_properties=<properties for the sink input> " "master=<name of sink to filter> " "sink_master=<name of sink to filter> " "format=<sample format> " "rate=<sample rate> " "channels=<number of channels> " "channel_map=<input channel map> " "plugin=<ladspa plugin name> " "label=<ladspa plugin label> " "control=<comma separated list of input control values> " "input_ladspaport_map=<comma separated list of input LADSPA port names> " "output_ladspaport_map=<comma separated list of output LADSPA port names> " "autoloaded=<set if this module is being loaded automatically> ")  )

◆ PA_MODULE_VERSION()

PA_MODULE_VERSION ( PACKAGE_VERSION  )

◆ parse_control_parameters()

static int parse_control_parameters ( struct userdata u,
const char *  cdata,
double *  read_values,
bool *  use_default 
)
static

◆ sink_input_attach_cb()

◆ sink_input_detach_cb()

◆ sink_input_kill_cb()

◆ sink_input_may_move_to_cb()

static bool sink_input_may_move_to_cb ( pa_sink_input i,
pa_sink dest 
)
static

Definition at line 661 of file module-ladspa-sink.c.

References userdata::autoloaded, pa_assert_se, userdata::sink, and pa_sink_input::userdata.

Referenced by pa__init().

◆ sink_input_moving_cb()

◆ sink_input_mute_changed_cb()

static void sink_input_mute_changed_cb ( pa_sink_input i)
static

◆ sink_input_pop_cb()

◆ sink_input_process_rewind_cb()

◆ sink_input_suspend_cb()

◆ sink_input_update_max_request_cb()

static void sink_input_update_max_request_cb ( pa_sink_input i,
size_t  nbytes 
)
static

◆ sink_input_update_max_rewind_cb()

static void sink_input_update_max_rewind_cb ( pa_sink_input i,
size_t  nbytes 
)
static

◆ sink_input_update_sink_fixed_latency_cb()

static void sink_input_update_sink_fixed_latency_cb ( pa_sink_input i)
static

◆ sink_input_update_sink_latency_range_cb()

static void sink_input_update_sink_latency_range_cb ( pa_sink_input i)
static

◆ sink_process_msg_cb()

◆ sink_request_rewind_cb()

◆ sink_set_mute_cb()

◆ sink_set_state_in_io_thread_cb()

static int sink_set_state_in_io_thread_cb ( pa_sink s,
pa_sink_state_t  new_state,
pa_suspend_cause_t  new_suspend_cause 
)
static

◆ sink_set_state_in_main_thread_cb()

static int sink_set_state_in_main_thread_cb ( pa_sink s,
pa_sink_state_t  state,
pa_suspend_cause_t  suspend_cause 
)
static

◆ sink_update_requested_latency_cb()

◆ validate_control_parameters()

◆ write_control_parameters()

Variable Documentation

◆ valid_modargs

const char* const valid_modargs[]
static
Initial value:
= {
"sink_name",
"sink_properties",
"sink_input_properties",
"master",
"sink_master",
"format",
"rate",
"channels",
"channel_map",
"plugin",
"label",
"control",
"input_ladspaport_map",
"output_ladspaport_map",
"autoloaded",
NULL
}

Definition at line 108 of file module-ladspa-sink.c.

Referenced by pa__init().