diff options
| author | Laurent Pinchart <[email protected]> | 2022-01-13 17:00:42 +0200 |
|---|---|---|
| committer | Sakari Ailus <[email protected]> | 2022-03-04 00:27:06 +0200 |
| commit | 3056a8e936bb090865402bfe6f3a730a28790033 (patch) | |
| tree | dc9efe7ce7bb99f0264c24825220385ede80adf9 /tools/perf/scripts/python | |
| parent | f17bc788f7b97c36b8f3fbef14555a2a16ee3f69 (diff) | |
media: media-entity: Simplify media_pipeline_start()
The media_pipeline_start() function has two purposes: it constructs a
pipeline by recording the entities that are part of it, gathered from a
graph walk, and validate the media links. The pipeline pointer is stored
in the media_entity structure as part of this process, and the entity's
stream count is increased, to record that the entity is streaming.
When multiple video nodes are present in a pipeline,
media_pipeline_start() is typically called on all of them, with the same
pipeline pointer. This is taken into account in media_pipeline_start()
by skipping validation for entities that are already part of the
pipeline, while returning an error if an entity is part of a different
pipeline.
It turns out that this process is overly complicated. When
media_pipeline_start() is called for the first time, it constructs the
full pipeline, adding all entities and validating all the links.
Subsequent calls to media_pipeline_start() are then nearly no-ops, they
only increase the stream count on the pipeline and on all entities.
The media_entity stream_count field is used for two purposes: checking
if the entity is streaming, and detecting when a call to
media_pipeline_stop() balances needs to reset the entity pipe pointer to
NULL. The former can easily be replaced by a check of the pipe pointer.
Simplify media_pipeline_start() by avoiding the pipeline walk on all
calls but the first one, and drop the media_entity stream_count field.
media_pipeline_stop() is updated accordingly.
Signed-off-by: Laurent Pinchart <[email protected]>
[Sakari Ailus: Drop redundant '!= NULL' as discussed]
Signed-off-by: Sakari Ailus <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions