PulseAudio server controller that creates and removes Sunshine sinks.
More...
|
| std::string | get_default_sink_name () |
| | Get default sink name.
|
| |
| std::string | get_monitor_name (const std::string &sink_name) |
| | Get monitor name.
|
| |
| int | init () |
| | Initialize PulseAudio mainloop, context, and Sunshine null sinks.
|
| |
| bool | is_sink_available (const std::string &sink) override |
| | Check if the audio sink is available in the system.
|
| |
| int | load_null (const char *name, const std::uint8_t *channel_mapping, int channels) |
| | Create a PulseAudio null sink for one channel layout.
|
| |
| std::unique_ptr< mic_t > | microphone (const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size, bool continuous_audio, bool host_audio_enabled) override |
| | Create a microphone capture stream for the requested layout.
|
| |
| int | set_sink (const std::string &sink) override |
| | Update the sink value on the backend.
|
| |
| std::optional< sink_t > | sink_info () override |
| | Query host and virtual sink names available to Sunshine.
|
| |
| int | unload_null (std::uint32_t i) |
| | Unload a Sunshine-created PulseAudio null sink.
|
| |
| virtual | ~audio_control_t ()=default |
| | Destroy the audio control.
|
| |
|
|
ctx_t | ctx |
| | PulseAudio threaded mainloop context.
|
| |
|
std::unique_ptr< safe::event_t< ctx_event_e > > | events |
| | Event queue receiving PulseAudio context state changes.
|
| |
|
std::unique_ptr< std::function< void(ctx_t::pointer)> > | events_cb |
| | Callback that translates PulseAudio context updates into events.
|
| |
|
struct { | |
| |
|
std::uint32_t stereo = PA_INVALID_INDEX | |
| |
|
std::uint32_t surround51 = PA_INVALID_INDEX | |
| |
|
std::uint32_t surround71 = PA_INVALID_INDEX | |
| |
| } | index | |
| | PulseAudio module indexes for Sunshine-created null sinks.
|
| |
|
loop_t | loop |
| | PulseAudio threaded mainloop instance.
|
| |
|
std::string | requested_sink |
| | Requested sink.
|
| |
|
std::thread | worker |
| | Thread running the PulseAudio mainloop.
|
| |
PulseAudio server controller that creates and removes Sunshine sinks.
◆ get_default_sink_name()
| std::string platf::pa::server_t::get_default_sink_name |
( |
| ) |
|
|
inline |
Get default sink name.
- Returns
- PulseAudio name of the current default sink, or an empty string.
◆ get_monitor_name()
| std::string platf::pa::server_t::get_monitor_name |
( |
const std::string & | sink_name | ) |
|
|
inline |
Get monitor name.
- Parameters
-
- Returns
- PulseAudio monitor source name for the supplied sink, or an empty string.
◆ init()
| int platf::pa::server_t::init |
( |
| ) |
|
|
inline |
Initialize PulseAudio mainloop, context, and Sunshine null sinks.
- Returns
- 0 on success; nonzero or negative platform status on failure.
◆ is_sink_available()
| bool platf::pa::server_t::is_sink_available |
( |
const std::string & | sink | ) |
|
|
inlineoverridevirtual |
Check if the audio sink is available in the system.
- Parameters
-
- Returns
- True if available, false otherwise.
Implements platf::audio_control_t.
◆ load_null()
| int platf::pa::server_t::load_null |
( |
const char * | name, |
|
|
const std::uint8_t * | channel_mapping, |
|
|
int | channels ) |
|
inline |
Create a PulseAudio null sink for one channel layout.
- Parameters
-
| name | Human-readable name to assign. |
| channel_mapping | Channel mapping. |
| channels | Number of audio channels in the stream. |
- Returns
- PulseAudio module index for the new sink, or PA_INVALID_INDEX on failure.
◆ microphone()
| std::unique_ptr< mic_t > platf::pa::server_t::microphone |
( |
const std::uint8_t * | mapping, |
|
|
int | channels, |
|
|
std::uint32_t | sample_rate, |
|
|
std::uint32_t | frame_size, |
|
|
bool | continuous_audio, |
|
|
bool | host_audio_enabled ) |
|
inlineoverridevirtual |
Create a microphone capture stream for the requested layout.
- Parameters
-
| mapping | Opus channel mapping table for the requested layout. |
| channels | Number of audio channels in the stream. |
| sample_rate | Audio sample rate in hertz. |
| frame_size | Number of samples captured per audio frame. |
| continuous_audio | Continuous audio. |
| host_audio_enabled | Whether host playback should remain enabled during capture. |
- Returns
- Microphone capture object for the requested audio layout.
Implements platf::audio_control_t.
◆ set_sink()
| int platf::pa::server_t::set_sink |
( |
const std::string & | sink | ) |
|
|
inlineoverridevirtual |
Update the sink value on the backend.
- Parameters
-
| sink | Audio sink name to route or capture. |
- Returns
- Status from updating sink.
Implements platf::audio_control_t.
◆ sink_info()
| std::optional< sink_t > platf::pa::server_t::sink_info |
( |
| ) |
|
|
inlineoverridevirtual |
Query host and virtual sink names available to Sunshine.
- Returns
- Host and virtual sink names when the backend can report them.
Implements platf::audio_control_t.
◆ unload_null()
| int platf::pa::server_t::unload_null |
( |
std::uint32_t | i | ) |
|
|
inline |
Unload a Sunshine-created PulseAudio null sink.
- Parameters
-
| i | PulseAudio introspection info supplied to the callback. |
- Returns
- 0 when the sink is absent or unloaded; nonzero on PulseAudio failure.
The documentation for this class was generated from the following file: