12#ifndef ROC_PIPELINE_RECEIVER_LOOP_H_
13#define ROC_PIPELINE_RECEIVER_LOOP_H_
52 class Task :
public PipelineTask {
54 friend class ReceiverLoop;
58 bool (ReceiverLoop::*
func_)(Task&);
101 size_t* party_count);
147 virtual void pause();
159 virtual uint64_t
tid_imp()
const;
164 bool task_create_slot_(
Task& task);
165 bool task_delete_slot_(
Task& task);
166 bool task_query_slot_(
Task& task);
167 bool task_add_endpoint_(
Task& task);
175 const bool auto_reclock_;
Sample specification. Describes sample rate and channels.
Optionally constructed object.
uint64_t ticks_t
Number of ticks.
Pipeline task scheduler interface. PipelineLoop uses this interface to schedule asynchronous work....
virtual uint64_t tid_imp() const =0
Get current thread id.
virtual core::nanoseconds_t timestamp_imp() const =0
Get current time.
PipelineLoop(IPipelineTaskScheduler &scheduler, const PipelineLoopConfig &config, const audio::SampleSpec &sample_spec)
Initialization.
Base class for pipeline tasks.
bool(ReceiverLoop::* func_)(Task &)
Task implementation method.
ReceiverSlotMetrics * slot_metrics_
Output slot metrics.
address::SocketAddr inbound_address_
Inbound packet address.
ReceiverSlotConfig slot_config_
Slot config.
address::Interface iface_
Interface.
address::Protocol proto_
Protocol.
ReceiverParticipantMetrics * party_metrics_
Output participant metrics.
size_t * party_count_
Input/output participant count.
packet::IWriter * outbound_writer_
Outbound packet writer.
ReceiverSlot * slot_
Slot.
packet::IWriter * inbound_writer_
Inbound packet writer.
AddEndpoint(SlotHandle slot, address::Interface iface, address::Protocol proto, const address::SocketAddr &inbound_address, packet::IWriter *outbound_writer)
Set task parameters.
packet::IWriter * get_inbound_writer() const
Get packet writer for inbound packets for the endpoint.
SlotHandle get_handle() const
Get created slot handle.
CreateSlot(const ReceiverSlotConfig &slot_config)
Set task parameters.
DeleteSlot(SlotHandle slot)
Set task parameters.
QuerySlot(SlotHandle slot, ReceiverSlotMetrics &slot_metrics, ReceiverParticipantMetrics *party_metrics, size_t *party_count)
Set task parameters.
Subclasses for specific tasks.
sndio::ISource & source()
Get receiver sources.
bool is_valid() const
Check if the pipeline was successfully constructed.
struct SlotHandle * SlotHandle
Opaque slot handle.
ReceiverLoop(IPipelineTaskScheduler &scheduler, const ReceiverSourceConfig &source_config, const rtp::EncodingMap &encoding_map, core::IPool &packet_pool, core::IPool &packet_buffer_pool, core::IPool &frame_buffer_pool, core::IArena &arena)
Initialize.
Receiver source pipeline.
RTP encoding map. Thread-safe. Returned encodings are immutable and can be safely used from any threa...
virtual audio::SampleSpec sample_spec() const =0
Get sample specification of the device.
virtual bool has_clock() const =0
Check if the device has own clock.
virtual void pause()=0
Pause device.
virtual bool restart()=0
Restart device.
virtual core::nanoseconds_t latency() const =0
Get latency of the device.
virtual DeviceState state() const =0
Get device state.
virtual DeviceType type() const =0
Get device type.
virtual ISource * to_source()=0
Cast IDevice to ISink.
virtual bool has_latency() const =0
Check if the device supports latency reports.
virtual bool resume()=0
Resume device after pause.
virtual ISink * to_sink()=0
Cast IDevice to ISink.
int64_t nanoseconds_t
Nanoseconds.
Sender and receiver processing pipelines.
Optionally constructed object.
Base class for pipelines.
Receiver source pipeline.
Commonly used types and functions.
Receiver-side metrics specific to one participant (remote sender).
Parameters of receiver slot.
Receiver-side metrics of the whole slot.
Parameters of receiver session.