diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-08-25 08:00:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:53:17 -0400 |
commit | e02188c90f6ef61f0844c42508fe603c5d4fa42b (patch) | |
tree | 7b0ff940b37ba6bf53c7cea7fadbb697ec2d156a /Documentation/media-framework.txt | |
parent | 97548ed4c4661502cdfd1aabd5d3876fa4f5cc2e (diff) |
[media] media: Pipelines and media streams
Drivers often need to associate pipeline objects to entities, and to
take stream state into account when configuring entities and links. The
pipeline API helps drivers manage that information.
When starting streaming, drivers call media_entity_pipeline_start(). The
function marks all entities connected to the given entity through
enabled links, either directly or indirectly, as streaming. Similarly,
when stopping the stream, drivers call media_entity_pipeline_stop().
The media_entity_pipeline_start() function takes a pointer to a media
pipeline and stores it in every entity in the graph. Drivers should
embed the media_pipeline structure in higher-level pipeline structures
and can then access the pipeline through the media_entity structure.
Link configuration will fail with -EBUSY by default if either end of the
link is a streaming entity, unless the link is marked with the
MEDIA_LNK_FL_DYNAMIC flag.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/media-framework.txt')
-rw-r--r-- | Documentation/media-framework.txt | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/media-framework.txt b/Documentation/media-framework.txt index 4809221c0ff9..fd48add02cb0 100644 --- a/Documentation/media-framework.txt +++ b/Documentation/media-framework.txt | |||
@@ -313,3 +313,41 @@ Link configuration must not have any side effect on other links. If an enabled | |||
313 | link at a sink pad prevents another link at the same pad from being disabled, | 313 | link at a sink pad prevents another link at the same pad from being disabled, |
314 | the link_setup operation must return -EBUSY and can't implicitly disable the | 314 | the link_setup operation must return -EBUSY and can't implicitly disable the |
315 | first enabled link. | 315 | first enabled link. |
316 | |||
317 | |||
318 | Pipelines and media streams | ||
319 | --------------------------- | ||
320 | |||
321 | When starting streaming, drivers must notify all entities in the pipeline to | ||
322 | prevent link states from being modified during streaming by calling | ||
323 | |||
324 | media_entity_pipeline_start(struct media_entity *entity, | ||
325 | struct media_pipeline *pipe); | ||
326 | |||
327 | The function will mark all entities connected to the given entity through | ||
328 | enabled links, either directly or indirectly, as streaming. | ||
329 | |||
330 | The media_pipeline instance pointed to by the pipe argument will be stored in | ||
331 | every entity in the pipeline. Drivers should embed the media_pipeline structure | ||
332 | in higher-level pipeline structures and can then access the pipeline through | ||
333 | the media_entity pipe field. | ||
334 | |||
335 | Calls to media_entity_pipeline_start() can be nested. The pipeline pointer must | ||
336 | be identical for all nested calls to the function. | ||
337 | |||
338 | When stopping the stream, drivers must notify the entities with | ||
339 | |||
340 | media_entity_pipeline_stop(struct media_entity *entity); | ||
341 | |||
342 | If multiple calls to media_entity_pipeline_start() have been made the same | ||
343 | number of media_entity_pipeline_stop() calls are required to stop streaming. The | ||
344 | media_entity pipe field is reset to NULL on the last nested stop call. | ||
345 | |||
346 | Link configuration will fail with -EBUSY by default if either end of the link is | ||
347 | a streaming entity. Links that can be modified while streaming must be marked | ||
348 | with the MEDIA_LNK_FL_DYNAMIC flag. | ||
349 | |||
350 | If other operations need to be disallowed on streaming entities (such as | ||
351 | changing entities configuration parameters) drivers can explictly check the | ||
352 | media_entity stream_count field to find out if an entity is streaming. This | ||
353 | operation must be done with the media_device graph_mutex held. | ||