1.三要素
camera/camera device/came sensor, 通常指带有I2C接口作为控制与配置,并行或串行总线作为图像数据传输通道的传感器。
camera host, 提供sensor连接的接口。
came host bus, 数据通道,包含时钟,控制总线,图像同步信号等。
2.目的
早期是为host驱动和sensor驱动提供统一的接口,后来sensor API被V4L2标准子设备API代替,这也使得,没有host的情况下,camera驱动代码可以复用。
3.Camera Host API
使用下列函数注册host
soc_camera_host_register(struct soc_camera_host )
host相关的方法接口通过下列结构体传递:
static struct soc_camera_host_ops camera_host_ops = {
.owner = THIS_MODULE,
.add = camera_add_device,
.remove = camera_remove_device,
.set_fmt = camera_set_fmt_cap,
.try_fmt = camera_try_fmt_cap,
.init_videobuf2 = camera_init_videobuf2,
.poll = camera_poll,
.querycap = camera_querycap,
.set_bus_param = camera_set_bus_param,
/ The rest of host operations are optional */
};
其中,当sensor连接或者断开连接时,会分别调用add,remove方法。

本文介绍了Camera框架的三要素:camera/cameradevice/camesensor、camerahost和camehostbus,并探讨了CameraHostAPI和CameraAPI的实现方式。此外,还讨论了S_CROP和S_FMT的行为,以及V4L2标准下的格式转换。
最低0.47元/天 解锁文章
135

被折叠的 条评论
为什么被折叠?



