STRUCT VIDEO_DEVICE(9)
π struct video_device(9) π
okay bestie, welcome to the Kernel API Manual β¨ β this is the page for struct video_device, which is, and I cannot stress this enough, the actual structure used to create and manage the V4L2 device nodes. main character energy fr π
πΈ NAME πΈ
struct video_device β Structure used to create and manage the V4L2 device nodes. that's it, that's the vibe π«Ά
β¨ SYNOPSIS β¨
lowkey just look at it:
struct video_device {
#if defined(CONFIG_MEDIA_CONTROLLER);
struct media_entity entity;
struct media_intf_devnode *intf_devnode;
struct media_pipeline pipe;
#endif;
const struct v4l2_file_operations *fops;
u32 device_caps;
struct device dev;
struct cdev *cdev;
struct v4l2_device *v4l2_dev;
struct device *dev_parent;
struct v4l2_ctrl_handler *ctrl_handler;
struct vb2_queue *queue;
struct v4l2_prio_state *prio;
char name[64];
enum vfl_devnode_type vfl_type;
enum vfl_devnode_direction vfl_dir;
int minor;
u16 num;
unsigned long flags;
int index;
spinlock_t fh_lock;
struct list_head fh_list;
int dev_debug;
v4l2_std_id tvnorms;
void (*release)(struct video_device *vdev);
const struct v4l2_ioctl_ops *ioctl_ops;
unsigned long valid_ioctls[BITS_TO_LONGS( BASE_VIDIOC_PRIVATE)];
struct mutex *lock;
};
π Members π
every single field, no skips, we do not skip fields in this house π
entityβstruct media_entityπintf_devnodeβ pointer tostruct media_intf_devnodepipeβstruct media_pipelinefopsβ pointer tostruct v4l2_file_operationsfor the video devicedevice_capsβ device capabilities as used inv4l2_capabilitiesdevβstruct devicefor the video devicecdevβ character devicev4l2_devβ pointer tostruct v4l2_deviceparentdev_parentβ pointer tostruct deviceparentctrl_handlerβ Control handler associated with this device node. May beNULL.queueβstruct vb2_queueassociated with this device node. May beNULL.prioβ pointer tostruct v4l2_prio_statewith device's Priority state. IfNULL, thenv4l2_dev->priowill be used.nameβ video device namevfl_typeβ V4L device type, as defined byenum vfl_devnode_typevfl_dirβ V4L receiver, transmitter or m2mminorβ device node 'minor'. It is set to-1if the registration failed π (yes, that's the fail flag, clock it)numβ number of the video device nodeflagsβ video device flags. Use bitops to set/clear/test flags. Contains a set ofenum v4l2_video_device_flags.indexβ attribute to differentiate multiple indices on one physical devicefh_lockβ Lock for allv4l2_fhsfh_listβ List ofstruct v4l2_fhdev_debugβ Internal device debug flags, not for use by drivers π (hands off, bestie)tvnormsβ Supported tv normsreleaseβ video device release callbackioctl_opsβ pointer tostruct v4l2_ioctl_opswith ioctl callbacksvalid_ioctlsβ bitmap with the valid ioctls for this devicelockβ pointer tostruct mutexserialization lock
π¦ Description π¦
NOTE: Only setdev_parentif that can't be deduced fromv4l2_dev.
that's the whole note, but it's a very serious note okay π€ only set dev_parent when it genuinely can't be deduced from v4l2_dev. no cap.
π SEE ALSO π
the whole friend group, in order, all of them, iykyk π
- Kernel file
./include/media/v4l2-dev.h enum vfl_devnode_type(9)enum vfl_devnode_direction(9)enum v4l2_video_device_flags(9)struct v4l2_prio_state(9)v4l2_prio_init(9)v4l2_prio_change(9)v4l2_prio_open(9)v4l2_prio_close(9)v4l2_prio_max(9)v4l2_prio_check(9)struct v4l2_file_operations(9)media_entity_to_video_device(9)to_video_device(9)__video_register_device(9)video_register_device(9)video_register_device_no_warn(9)video_unregister_device(9)video_device_alloc(9)video_device_release(9)video_device_release_empty(9)v4l2_disable_ioctl(9)video_get_drvdata(9)video_set_drvdata(9)video_devdata(9)video_drvdata(9)video_device_node_name(9)video_is_registered(9)v4l2_debugfs_root(9)video_device_pipeline_start(9)__video_device_pipeline_start(9)video_device_pipeline_stop(9)__video_device_pipeline_stop(9)video_device_pipeline_alloc_start(9)video_device_pipeline(9)
and that's the page bestie π go forth and register some video devices, you're gonna slay β¨
source: ./include/media Β· dated October 2026 β mwah, see u in the next manpage ππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms