Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
stream.h File Reference

Declarations for the streaming protocols. More...

#include <utility>
#include <boost/asio.hpp>
#include "audio.h"
#include "crypto.h"
#include "video.h"
Include dependency graph for stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  stream::config_t
struct  stream::session::termination_stats_t
 Aggregate reconnection/termination stats for diagnostics. More...

Macros

#define SS_ENC_MICROPHONE   0x08

Enumerations

enum class  stream::session::state_e : int { STOPPED , STOPPING , STARTING , RUNNING }
enum class  stream::session::termination_reason_e : int {
  UNKNOWN , CLIENT_QUIT , CLIENT_LOST , HANDSHAKE_FAILED ,
  PROTOCOL_ERROR , SERVER_STOPPED , PERMISSION_REVOKED
}
 Why a streaming session ended. More...

Functions

std::string_view stream::session::termination_reason_str (termination_reason_e reason)
termination_reason_e stream::session::last_termination_reason ()
termination_stats_t stream::session::termination_stats ()
 Snapshot of the termination/reconnection stats.
std::shared_ptr< session_t > stream::session::alloc (config_t &config, rtsp_stream::launch_session_t &launch_session)
std::string stream::session::uuid (const session_t &session)
bool stream::session::uuid_match (const session_t &session, const std::string_view &uuid)
bool stream::session::isolated (const session_t &session)
bool stream::session::update_device_info (session_t &session, const std::string &name, const crypto::PERM &newPerm)
int stream::session::start (session_t &session, const std::string &addr_string)
void stream::session::stop (session_t &session, termination_reason_e reason)
void stream::session::graceful_stop (session_t &session)
void stream::session::join (session_t &session)
state_e stream::session::state (session_t &session)
bool stream::session::send (session_t &session, const std::string_view &payload)

Variables

constexpr auto stream::VIDEO_STREAM_PORT = 9
constexpr auto stream::CONTROL_PORT = 10
constexpr auto stream::AUDIO_STREAM_PORT = 11
constexpr auto stream::MIC_STREAM_PORT = 12

Detailed Description

Declarations for the streaming protocols.

Definition in file stream.h.

Macro Definition Documentation

◆ SS_ENC_MICROPHONE

#define SS_ENC_MICROPHONE   0x08

Definition at line 27 of file stream.h.

Enumeration Type Documentation

◆ state_e

enum class stream::session::state_e : int
strong
Enumerator
STOPPED 

The session is stopped.

STOPPING 

The session is stopping.

STARTING 

The session is starting.

RUNNING 

The session is running.

Definition at line 52 of file stream.h.

◆ termination_reason_e

enum class stream::session::termination_reason_e : int
strong

Why a streaming session ended.

Lets the host distinguish a client that dropped (network loss, crash) from one the user or server stopped on purpose, instead of collapsing every path into an indistinct "CLIENT DISCONNECTED".

Enumerator
UNKNOWN 

No reason recorded yet.

CLIENT_QUIT 

Client closed the stream (ENet disconnect).

CLIENT_LOST 

Client stopped responding (ping timeout / network loss).

HANDSHAKE_FAILED 

Video/audio handshake never completed.

PROTOCOL_ERROR 

Malformed/failed control-stream exchange.

SERVER_STOPPED 

Host stopped the session (API stop, shutdown).

PERMISSION_REVOKED 

View permission was revoked mid-session.

Definition at line 66 of file stream.h.

Function Documentation

◆ alloc()

std::shared_ptr< session_t > stream::session::alloc ( config_t & config,
rtsp_stream::launch_session_t & launch_session )

Definition at line 2597 of file stream.cpp.

◆ graceful_stop()

void stream::session::graceful_stop ( session_t & session)

Definition at line 2392 of file stream.cpp.

◆ isolated()

bool stream::session::isolated ( const session_t & session)

Definition at line 2270 of file stream.cpp.

◆ join()

void stream::session::join ( session_t & session)

Definition at line 2431 of file stream.cpp.

◆ last_termination_reason()

termination_reason_e stream::session::last_termination_reason ( )

Definition at line 2322 of file stream.cpp.

◆ send()

bool stream::session::send ( session_t & session,
const std::string_view & payload )
inline

Definition at line 2258 of file stream.cpp.

◆ start()

int stream::session::start ( session_t & session,
const std::string & addr_string )

Definition at line 2504 of file stream.cpp.

◆ state()

state_e stream::session::state ( session_t & session)

Definition at line 2254 of file stream.cpp.

◆ stop()

void stream::session::stop ( session_t & session,
termination_reason_e reason )

Definition at line 2341 of file stream.cpp.

◆ termination_reason_str()

std::string_view stream::session::termination_reason_str ( termination_reason_e reason)

Definition at line 2302 of file stream.cpp.

◆ termination_stats()

termination_stats_t stream::session::termination_stats ( )

Snapshot of the termination/reconnection stats.

Definition at line 2326 of file stream.cpp.

◆ update_device_info()

bool stream::session::update_device_info ( session_t & session,
const std::string & name,
const crypto::PERM & newPerm )

Definition at line 2274 of file stream.cpp.

◆ uuid()

std::string stream::session::uuid ( const session_t & session)

Definition at line 2262 of file stream.cpp.

◆ uuid_match()

bool stream::session::uuid_match ( const session_t & session,
const std::string_view & uuid )

Definition at line 2266 of file stream.cpp.

Variable Documentation

◆ AUDIO_STREAM_PORT

auto stream::AUDIO_STREAM_PORT = 11
constexpr

Definition at line 21 of file stream.h.

◆ CONTROL_PORT

auto stream::CONTROL_PORT = 10
constexpr

Definition at line 20 of file stream.h.

◆ MIC_STREAM_PORT

auto stream::MIC_STREAM_PORT = 12
constexpr

Definition at line 22 of file stream.h.

◆ VIDEO_STREAM_PORT

auto stream::VIDEO_STREAM_PORT = 9
constexpr

Definition at line 19 of file stream.h.