Sunshine latest
Self-hosted game stream host for Moonlight.
audio.cpp File Reference

Definitions for audio control on Linux. More...

#include <bitset>
#include <sstream>
#include <thread>
#include <boost/regex.hpp>
#include <pulse/error.h>
#include <pulse/pulseaudio.h>
#include <pulse/simple.h>
#include "src/config.h"
#include "src/logging.h"
#include "src/platform/common.h"
#include "src/thread_safe.h"
Include dependency graph for audio.cpp:

Classes

struct  platf::pa::add_const_helper< false, T >
 
struct  platf::pa::add_const_helper< true, T >
 
struct  platf::mic_attr_t
 
class  platf::pa::server_t
 

Typedefs

template<class T >
using platf::pa::add_const_t = typename add_const_helper<std::is_pointer_v<T>, T>::type
 
template<class T >
using platf::pa::cb_simple_t = std::function<void(ctx_t::pointer, add_const_t<T> i)>
 
template<class T >
using platf::pa::cb_t = std::function<void(ctx_t::pointer, add_const_t<T> i, int eol)>
 
using platf::pa::ctx_t = util::safe_ptr<pa_context, pa_context_unref>
 
using platf::pa::loop_t = util::safe_ptr<pa_mainloop, pa_mainloop_free>
 
using platf::pa::op_t = util::safe_ptr<pa_operation, pa_operation_unref>
 
using platf::pa::string_t = util::safe_ptr<char, pa_free<char>>
 

Functions

std::unique_ptr< audio_control_tplatf::audio_control ()
 
template<class T >
void platf::pa::cb (ctx_t::pointer ctx, add_const_t< T > i, int eol, void *userdata)
 
template<class T >
void platf::pa::cb (ctx_t::pointer ctx, add_const_t< T > i, void *userdata)
 
void platf::pa::cb_i (ctx_t::pointer ctx, std::uint32_t i, void *userdata)
 
void platf::pa::ctx_state_cb (ctx_t::pointer ctx, void *userdata)
 
std::unique_ptr< mic_tplatf::microphone (const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size, std::string source_name)
 
template<class T >
void platf::pa::pa_free (T *p)
 
void platf::pa::success_cb (ctx_t::pointer ctx, int status, void *userdata)
 
std::string platf::to_string (const char *name, const std::uint8_t *mapping, int channels)
 

Variables

constexpr pa_channel_position_t platf::position_mapping []
 

Detailed Description

Definitions for audio control on Linux.

Variable Documentation

◆ position_mapping

constexpr pa_channel_position_t platf::position_mapping[]
constexpr
Initial value:
{
PA_CHANNEL_POSITION_FRONT_LEFT,
PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_FRONT_CENTER,
PA_CHANNEL_POSITION_LFE,
PA_CHANNEL_POSITION_REAR_LEFT,
PA_CHANNEL_POSITION_REAR_RIGHT,
PA_CHANNEL_POSITION_SIDE_LEFT,
PA_CHANNEL_POSITION_SIDE_RIGHT,
}