|
Hermes 0.7.0
Linux game streaming host
|
Classes | |
| class | lock_t |
| struct | [struct].index |
Public Member Functions | |
| template<class Make> | |
| bool | issue (Make make) |
| int | context_errno () |
| int | init () |
| int | load_null (const char *name, const std::uint8_t *channel_mapping, int channels) |
| int | unload_null (std::uint32_t i) |
| std::uint32_t | find_sink_module (const std::string &name) |
| The module index behind a sink, or PA_INVALID_INDEX for none. | |
| bool | sink_exists (const std::string &name) |
| Whether a sink of this name is present right now. | |
| bool | create_session_sink (const std::string &name, const std::uint8_t *mapping, int channels) override |
| Create a sink that belongs to one isolated session alone. | |
| void | remove_session_sink (const std::string &name) override |
| Remove a sink created by create_session_sink(). Removing one that is already gone is not an error. | |
| std::optional< sink_t > | sink_info () override |
| std::string | get_default_sink_name () |
| std::string | get_monitor_name (const std::string &sink_name) |
| std::unique_ptr< mic_t > | microphone (const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size) override |
| std::unique_ptr< mic_t > | microphone_from (const std::string &sink, const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size) override |
| Record a named sink's monitor, whatever the current sink is. | |
| bool | is_sink_available (const std::string &sink) override |
| Check if the audio sink is available in the system. | |
| std::vector< std::string > | streams_playing_elsewhere (const std::string &sink) override |
Applications playing to a sink other than sink. | |
| int | set_sink (const std::string &sink) override |
Public Attributes | |
| loop_t | loop |
| ctx_t | ctx |
| std::string | requested_sink |
| struct | index |
| std::unique_ptr< safe::event_t< ctx_event_e > > | events |
| std::unique_ptr< std::function< void(ctx_t::pointer)> > | events_cb |
| bool | running = false |
|
inlineoverridevirtual |
Create a sink that belongs to one isolated session alone.
The sinks behind sink_info() are the server's: there is one set of them, and capture reaches them by making one of them the host's default, which is what puts everything the host plays into the stream. That is right for a session that is the host's desktop and wrong for a session that is somebody else's - it hands one client the host's audio and every other client's along with it.
A session sink is named for the session, is never made anyone's default, and is captured by name. Nothing is asked to move: the session's own applications are pointed at it when they start.
Reimplemented from platf::audio_control_t.
|
inline |
The module index behind a sink, or PA_INVALID_INDEX for none.
Sinks are removed by module, not by name, and a session sink's module index is not known here - it may have been loaded by an earlier run of Hermes that a client is now reconnecting to. Looking it up keeps removal honest across a restart.
|
inline |
|
inline |
|
inlineoverridevirtual |
Check if the audio sink is available in the system.
| sink | Sink to be checked. |
Implements platf::audio_control_t.
|
inline |
|
inline |
|
inlineoverridevirtual |
Implements platf::audio_control_t.
|
inlineoverridevirtual |
Record a named sink's monitor, whatever the current sink is.
microphone() picks its source from state the whole process shares - the configured sink, the last one swapped to, the default - which is right while there is one session and wrong once there are several. A session sink is not negotiable: the session it belongs to must be recorded from it and from nothing else.
The default below is never reached in practice, because a session sink is only ever named after create_session_sink() agreed to make one, and a platform without virtual sinks refuses that.
Reimplemented from platf::audio_control_t.
|
inlineoverridevirtual |
Remove a sink created by create_session_sink(). Removing one that is already gone is not an error.
Reimplemented from platf::audio_control_t.
|
inlineoverridevirtual |
Implements platf::audio_control_t.
|
inline |
Whether a sink of this name is present right now.
Asked separately from find_sink_module() because presence and ownership are not the same question: a sink that is there can still report no owner module - PipeWire's PulseAudio server does that for the devices it did not load itself - so a module index is the wrong thing to read an answer out of.
|
inlineoverridevirtual |
Implements platf::audio_control_t.
|
inlineoverridevirtual |
Applications playing to a sink other than sink.
A stream follows the default sink unless something chose an output for it: the user in the desktop's sound settings, or the sound server restoring that choice the next time the application plays. Such a stream does not move when Hermes makes its sink the default, so the client never hears it.
Reimplemented from platf::audio_control_t.
|
inline |
| std::unique_ptr<safe::event_t<ctx_event_e> > platf::pa::server_t::events |
| std::unique_ptr<std::function<void(ctx_t::pointer)> > platf::pa::server_t::events_cb |