Signals

Signals are the return channel from a thread backend to the frontend (main thread). The base class is Limef::signal::Signal.

namespace signal

Signalling threads and filterchains.

Enums

enum class SignalClass

Identify the signal subclass

When creating new signal classes to their associated threads, you need to register the new signal class always here

Values:

enumerator NullSignal

identifies class NullSignal

enumerator BasicSignal

identifies class BasicSignal

enumerator ExampleSignal

identifies class ExampleSignal

enumerator MediaFileSignal

identifies class MedaFileSignal: signals for Limef::thread::MediaFileThread0

enumerator WebSocketServerSignal

identifies class WebSocketServerSignal: signals for Limef::thread::WebSocketServer

enumerator FlowControlSignal

identifies class FlowControlSignal: signals for framefilter flow control

enumerator RTSPServerSignal

identifies class RTSPServerSignal: signals for Limef::rtsp::RTSPServerThread

class BasicSignal : public Limef::signal::Signal
#include <signal.h>

A thread intercom Signal.

A signal that is used by a Thread frontend to intercom with the Thread backend

Public Types

enum class Operation

Thread operation kind.

What kind of operation is required for the thread

Values:

enumerator null

a dummy/placeholder signal

enumerator exit

in-going: request termination

enumerator started

out-going: thread has been started

Public Functions

inline Operation getOperation() const

Return the Limef::BasicSignal::Operation type.

class FlowControlSignal : public Limef::signal::Signal
#include <signal.h>

Flow control signal for framefilter chains.

Used to send control commands (like flush) through framefilter chains. Producer threads send this signal downstream when stopping.

Public Types

enum class Command

Flow control command type.

Values:

enumerator Flush

Flush internal buffers and pass remaining data downstream.

class NullSignal : public Limef::signal::Signal
#include <signal.h>

A dummy/placeholder signal class & a minimal example of creating a new signal class.

class Signal
#include <signal.h>

Signal base class.

Signals are encapsulated into SignalFrames and they are used to inform Thread’s and downstream framefilters about actions and parameters they should do and use.

Each subclass must implement method staticSignalClass that is used by Signal::as, for example:

static SignalClass staticSignalClass() { return SignalClass::NullSignal; }

Subclassed by Limef::rtsp::RTSPServerSignal, Limef::signal::BasicSignal, Limef::signal::FlowControlSignal, Limef::signal::NullSignal, Limef::thread::ExampleSignal, Limef::thread::MediaFileSignal, Limef::thread::WebSocketServerSignal

Public Functions

template<typename T>
inline T *as()

Test and cast signal type Tests if the signal is of desired type and if so, cast it to the desider type, otherwise return nullptr, i.e.:

const auto* exampleSignal = signalFrame->asSignal<ExampleSignal>()