12#ifndef ROC_PIPELINE_PIPELINE_LOOP_H_
13#define ROC_PIPELINE_PIPELINE_LOOP_H_
266 enum ProcState { ProcNotScheduled, ProcScheduled, ProcRunning };
268 bool process_subframes_and_tasks_simple_(
audio::Frame& frame);
269 bool process_subframes_and_tasks_precise_(
audio::Frame& frame);
271 bool schedule_and_maybe_process_task_(
PipelineTask& task);
272 bool maybe_process_tasks_();
274 void schedule_async_task_processing_();
275 void cancel_async_task_processing_();
278 bool process_next_subframe_(
audio::Frame& frame,
size_t* frame_pos);
280 bool start_subframe_task_processing_();
288 void report_stats_();
295 const size_t min_samples_between_tasks_;
296 const size_t max_samples_between_tasks_;
328 size_t samples_processed_;
331 bool enough_samples_to_process_tasks_;
Sample stream specification. Defines sample rate and channel layout.
Atomic integer. Provides sequential consistency. For a fine-grained memory order control,...
Thread-safe lock-free node-based intrusive multi-producer single-consumer queue.
Base class for non-copyable objects.
Pipeline task completion handler.
Pipeline task scheduler interface. PipelineLoop uses this interface to schedule asynchronous work....
Base class for task-based pipelines.
size_t num_pending_frames() const
How much pending frames are there.
virtual core::nanoseconds_t timestamp_imp() const =0
Get current time.
void schedule(PipelineTask &task, IPipelineTaskCompleter &completer)
Enqueue a task for asynchronous execution.
virtual bool process_task_imp(PipelineTask &task)=0
Process task.
virtual bool process_subframe_imp(audio::Frame &frame)=0
Process subframe.
PipelineLoop(IPipelineTaskScheduler &scheduler, const TaskConfig &config, const audio::SampleSpec &sample_spec)
Initialization.
size_t num_pending_tasks() const
How much pending tasks are there.
void process_tasks()
Process some of the enqueued tasks, if any.
const Stats & get_stats_ref() const
Get task processing statistics. Returned object can't be accessed concurrently with other methods.
bool process_subframes_and_tasks(audio::Frame &frame)
Split frame and process subframes and some of the enqueued tasks.
bool schedule_and_wait(PipelineTask &task)
Enqueue a task for asynchronous execution and wait until it finishes.
Base class for pipeline tasks.
Pipeline task completion handler.
Pipeline task scheduler interface.
Multi-producer single-consumer queue.
int64_t nanoseconds_t
Nanoseconds.
Optionally constructed object.
Base class for pipeline tasks.
Task processing statistics.
uint64_t task_processed_in_frame
Number of tasks processed in process_frame_and_tasks().
uint64_t preemptions
Number of times when other method was preempted by process_frame_and_tasks().
uint64_t scheduler_cancellations
Number of time when cancel_task_processing() was called.
uint64_t task_processed_in_place
Number of tasks processed directly in schedule() or schedule_and_wait().
uint64_t scheduler_calls
Number of time when schedule_task_processing() was called.
uint64_t task_processed_total
Total number of tasks processed.
Task processing parameters.
Various units used in packets.