基于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我也还没怎么看过,也是新的知识,新的知识就是收获,现在开始吧...

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dianlong_lee

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值