其他分享
首页 > 其他分享> > 基于RV1126平台imx291分析 --- 先研究media再分析应用调用

基于RV1126平台imx291分析 --- 先研究media再分析应用调用

作者:互联网

Linux v4l2架构学习总链接

按照一开始的计划,这里应该去分析使用subdev的方式应用调用有什么不同。

但是打开rkcif_mipi的open函数,看到这样一个代码

int rkcif_update_sensor_info(struct rkcif_stream *stream)
{
	struct rkcif_sensor_info *sensor, *terminal_sensor;
	struct v4l2_subdev *sensor_sd;
	int ret = 0;

	sensor_sd = get_remote_sensor(stream, NULL);
	if (!sensor_sd)
		return -ENODEV;
        
        ...
}

static struct v4l2_subdev *get_remote_sensor(struct rkcif_stream *stream, u16 *index)
{
	struct media_pad *local, *remote;
	struct media_entity *sensor_me;

	local = &stream->vnode.vdev.entity.pads[0];
	if (!local)
		return NULL;
	remote = media_entity_remote_pad(local);
	if (!remote)
		return NULL;

	if (index)
		*index = remote->index;

	sensor_me = remote->entity;

	return media_entity_to_v4l2_subdev(sensor_me);
}

可以看到有个entity.pads[0],这里用到了media,所以不得已这里先去研究media。

我相信这里肯定可以不通过media就能获取到相关的subdev,但是这里不去纠结这个,因为media也是在研究计划之内的。

 

写到这里,对于media我也还没怎么看过,也是新的知识,新的知识就是收获,现在开始吧...

标签:remote,struct,stream,media,RV1126,entity,---,sensor
来源: https://blog.csdn.net/ldl617/article/details/115623730