pipeline: implement processors property

This commit is contained in:
Aleix Conchillo Flaqué
2025-08-15 11:03:08 -07:00
parent d743586bfb
commit 2fd5885dc3
3 changed files with 28 additions and 0 deletions

View File

@@ -152,6 +152,18 @@ class ParallelPipeline(BasePipeline):
# Frame processor
#
@property
def processors(self):
"""Return the list of sub-processors contained within this processor.
Only compound processors (e.g. pipelines and parallel pipelines) have
sub-processors. Non-compound processors will return an empty list.
Returns:
The list of sub-processors if this is a compound processor.
"""
return self._pipelines
def processors_with_metrics(self) -> List[FrameProcessor]:
"""Collect processors that can generate metrics from all parallel branches.

View File

@@ -114,6 +114,10 @@ class Pipeline(BasePipeline):
# Frame processor
#
@property
def processors(self):
return self._processors
def processors_with_metrics(self):
"""Return processors that can generate metrics.

View File

@@ -137,6 +137,18 @@ class SyncParallelPipeline(BasePipeline):
# Frame processor
#
@property
def processors(self):
"""Return the list of sub-processors contained within this processor.
Only compound processors (e.g. pipelines and parallel pipelines) have
sub-processors. Non-compound processors will return an empty list.
Returns:
The list of sub-processors if this is a compound processor.
"""
return self._pipelines
def processors_with_metrics(self) -> List[FrameProcessor]:
"""Collect processors that can generate metrics from all parallel pipelines.