Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
platf::audio_control_t Class Referenceabstract
Inheritance diagram for platf::audio_control_t:
[legend]

Public Member Functions

virtual int set_sink (const std::string &sink)=0
virtual std::unique_ptr< mic_t > microphone (const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size)=0
virtual 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)
 Record a named sink's monitor, whatever the current sink is.
virtual bool is_sink_available (const std::string &sink)=0
 Check if the audio sink is available in the system.
virtual std::vector< std::string > streams_playing_elsewhere (const std::string &sink)
 Applications playing to a sink other than sink.
virtual std::optional< sink_t > sink_info ()=0
virtual bool create_session_sink (const std::string &name, const std::uint8_t *mapping, int channels)
 Create a sink that belongs to one isolated session alone.
virtual void remove_session_sink (const std::string &name)
 Remove a sink created by create_session_sink(). Removing one that is already gone is not an error.

Detailed Description

Definition at line 565 of file common.h.

Member Function Documentation

◆ create_session_sink()

virtual bool platf::audio_control_t::create_session_sink ( const std::string & name,
const std::uint8_t * mapping,
int channels )
inlinevirtual

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.

Returns
false where the platform has no virtual sinks to create, which leaves the caller with the shared behaviour it had before.

Reimplemented in platf::pa::server_t.

Definition at line 628 of file common.h.

◆ is_sink_available()

virtual bool platf::audio_control_t::is_sink_available ( const std::string & sink)
pure virtual

Check if the audio sink is available in the system.

Parameters
sinkSink to be checked.
Returns
True if available, false otherwise.

Implemented in platf::pa::server_t.

◆ microphone_from()

virtual std::unique_ptr< mic_t > platf::audio_control_t::microphone_from ( const std::string & sink,
const std::uint8_t * mapping,
int channels,
std::uint32_t sample_rate,
std::uint32_t frame_size )
inlinevirtual

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 in platf::pa::server_t.

Definition at line 584 of file common.h.

◆ remove_session_sink()

virtual void platf::audio_control_t::remove_session_sink ( const std::string & name)
inlinevirtual

Remove a sink created by create_session_sink(). Removing one that is already gone is not an error.

Reimplemented in platf::pa::server_t.

Definition at line 638 of file common.h.

◆ streams_playing_elsewhere()

virtual std::vector< std::string > platf::audio_control_t::streams_playing_elsewhere ( const std::string & sink)
inlinevirtual

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.

Returns
One "application -> sink" entry per stream that is playing.

Reimplemented in platf::pa::server_t.

Definition at line 605 of file common.h.


The documentation for this class was generated from the following file: