subdev其实不算V4L2框架的一部分, 可能是因为它是在V4L2出现后才新增的. 它定义了一套自己的接口函数struct v4l2_subdev_ops, 所有的subdev驱动都要实现这套函数.不过这套函数与V4L2定义的ioctl标准是基本兼容的, 我们可以把用户空间的标准v4l2 ioctl调用映射到v4l2_subdev_ops, 例如subdev_d
//include/media/v4l2-device.hstructv4l2_device{structdevice*dev;// 父设备指针#ifdefined(CONFIG_MEDIA_CONTROLLER)// 多媒体设备配置选项structmedia_device*mdev;#endifstructlist_headsubdevs;spinlock_tlock;// 独一无二的设备名称,默认使用driver name + bus IDcharname[V4L2_DEVICE_NAME_SIZE];void(*no...
// include/media/.h 中定义一个消息头。 void (*notify)(struct v4l2_subdev *sd, unsignedintnotification, void *arg); // 提供子设备(主要是video和ISP设备)在用户空间的特效操作接口, // 比如改变输出图像的亮度、对比度、饱和度等等 struct v4l2_ctrl_handler *ctrl_handler; // 设备优先级状态 struct...
char name[V4L2_DEVICE_NAME_SIZE]; /* unique device name, by default the driver name + bus ID */ void (*notify)(struct v4l2_subdev *sd, unsigned int notification, void *arg); /* notify callback called by some sub-devices. */ struct v4l2_ctrl_handler *ctrl_handler; /* The control ...
return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);#ifdef CONFIG_VIDEO_ADV_DEBUG case VIDIOC_DBG_G_REGISTER: { struct v4l2_dbg_register *p = arg;if (!capable(CAP_SYS_ADMIN)) return -EPERM; return v4l2_subdev_call(sd, core, g_register, p); ...
void (*notify)(struct v4l2_subdev *sd, unsigned int notification, void *arg); //函数指针,报告一些子设备调用的回调函数 struct v4l2_ctrl_handler *ctrl_handler; //控制处理数据结构 struct v4l2_prio_state prio; //优先级状态 struct kref ref; //计数 ...
v4l2-subdev.c:v4l2 子设备; v4l2-mem2mem.c:内存到内存为 Linux 和 videobuf 视频设备的框架,设备的辅助函数,使用其源和目的 videobuf 缓冲区。 直接来看驱动源码的话,还是对驱动的框架没有一个感性的认识,尤其这个 V4L2 框架非常复杂,我们先从内核源码中提供的虚拟视频驱动程序 vivi.c 来分析,内核版本 3.4...
(struct v4l2_async_notifier *notifier, struct v4l2_subdev *subdev, struct v4l2_async_subdev *asd) { // 处理设备解绑逻辑 } static void my_notify_fn(struct v4l2_async_notifier *notifier, unsigned long event, void *arg) { // 处理异步事件通知 } static const struct v4l2_async_notifier_...
670 + static int csi_formatter_notify_bound(struct v4l2_async_notifier *notifier, 671 + struct v4l2_subdev *sd, 672 + struct v4l2_async_connection *asd) 673 + { 674 + const unsigned int link_flags = MEDIA_LNK_FL_IMMUTABLE ...
kworker/0:3-1854 [000] … 1253.631432: rtcpu_vinotify_event: tstamp:39372820726 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:39372794896 data:0x01000000 kworker/0:3-1854 [000] … 1253.631432: rtcpu_vinotify_event: tstamp:39372820890...