Linux Kernel media框架(四)

Pipelinesand media streams

管道和媒体流

---------------------------

 

Whenstarting streaming, drivers must notify all entities in the pipeline to prevent link states from being modifiedduring streaming by calling

当开始流式传输时,驱动程序必须通知管道中的所有实体,以防止在流式传输期间通过调用修改链接状态

 

media_entity_pipeline_start(struct media_entity *entity,

    struct media_pipeline*pipe);

 

Thefunction will mark all entities connected to the given entity through enabled links, either directly orindirectly, as streaming.

该功能将通过启用的链接,直接或间接地将连接到给定实体的所有实体标记为流。

 

Themedia_pipeline instance pointed to by the pipe argument will be stored in every entity in the pipeline. Driversshould embed the media_pipeline structure in higher-level pipeline structures and can then access thepipeline through themedia_entity pipe field.

 

pipe参数指向的media_pipeline实例将存储在管道中的每个实体中。 驱动程序应该将media_pipeline结构嵌入到更高级别的流水线结构中,然后可以通过media_entity管道字段访问管道。

 

Callsto media_entity_pipeline_start() can be nested. The pipeline pointer must be identical for all nested calls to thefunction.

 

media_entity_pipeline_start()的调用可以嵌套。 对于函数的所有嵌套调用,流水线指针必须相同。

 

media_entity_pipeline_start()may return an error. In that case, it will clean up any of the changes it did by itself.

media_entity_pipeline_start()可能会返回错误。 在这种情况下,它会清理它自己做的任何更改。

 

Whenstopping the stream, drivers must notify the entities with

当停止流时,驱动程序必须透过下面调用通知实体

 

media_entity_pipeline_stop(struct media_entity *entity);

 

Ifmultiple calls to media_entity_pipeline_start() have been made the same number of media_entity_pipeline_stop() calls are required to stopstreaming. The media_entitypipe field is reset to NULL on the last nested stop call.

如果对media_entity_pipeline_start()的多个调用已执行,则需要相同数量的media_entity_pipeline_stop()调用来停止流式传输。 在最后一个嵌套停止调用中,media_entity管道字段重置为NULL

 

                   

Linkconfiguration will fail with -EBUSY by default if either end of the link is a streaming entity. Links that can bemodified while streaming must be marked with the MEDIA_LNK_FL_DYNAMIC flag.

 

Ifother operations need to be disallowed on streaming entities (such as changing entities configurationparameters) drivers can explicitly check the media_entity stream_count field to find out if an entity isstreaming. This operation mustbe done with the media_device graph_mutex held.

如果链接的任一端是流实体,则链路配置将失败,默认情况下为-EBUSY。可以在流传输时修改的链接必须标有MEDIA_LNK_FL_DYNAMIC标志。

 

如果需要在流实体上禁止其他操作(例如更改实体配置参数),驱动程序可以显式检查media_entity stream_count字段,以确定实体是否正在流式传输。 此操作必须通过持有的media_device graph_mutex完成。

 

 Linkvalidation

---------------

链接验证

 

 

Linkvalidation is performed by media_entity_pipeline_start() for any entity which has sink pads in thepipeline. The media_entity::link_validate()callback is used for that purpose. In

link_validate()callback, entity driver should check that the properties of the source pad of the connected entity andits own sink pad match. It is up to the type of the entity (and in the end, the properties of thehardware) what matchingactually means.

 

Subsystemsshould facilitate link validation by providing subsystem specific helper functions to provide easy accessfor commonly needed information, and in the end provide a way to use driver-specific callbacks.

 

对于在流水线中具有sinkpads的任何实体,通过media_entity_pipeline_start()执行链路验证。 media_entity :: link_validate()回调用于此目的。 在

link_validate()回调,实体驱动程序应该检查所连接实体的源pad的属性和它自己的sink pad是否匹配。 它取决于实体的类型(和最终,硬件的属性)什么匹配实际上意味着什么。

 

子系统应该通过提供子系统特定的帮助函数来方便链接验证,以提供对常用信息的容易访问,并且最终提供使用驱动程序特定回调的方式。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值