Skip to content

Commit 238e4a5

Browse files
Hans Verkuilmchehab
authored andcommitted
media: rename VFL_TYPE_GRABBER to _VIDEO
We currently have the following devnode types: enum vfl_devnode_type { VFL_TYPE_GRABBER = 0, VFL_TYPE_VBI, VFL_TYPE_RADIO, VFL_TYPE_SUBDEV, VFL_TYPE_SDR, VFL_TYPE_TOUCH, VFL_TYPE_MAX /* Shall be the last one */ }; They all make sense, except for the first: GRABBER really refers to /dev/videoX devices, which can be capture, output or m2m, so 'grabber' doesn't even refer to their function anymore. Let's call a spade a spade and rename this to VFL_TYPE_VIDEO. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent cc62c74 commit 238e4a5

6 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎Documentation/media/kapi/v4l2-dev.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ This will create the character device for you.
185185

186186
.. code-block:: c
187187
188-
err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
188+
err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
189189
if (err) {
190190
video_device_release(vdev); /* or kfree(my_vdev); */
191191
return err;
@@ -201,7 +201,7 @@ types exist:
201201
========================== ==================== ==============================
202202
:c:type:`vfl_devnode_type` Device name Usage
203203
========================== ==================== ==============================
204-
``VFL_TYPE_GRABBER`` ``/dev/videoX`` for video input/output devices
204+
``VFL_TYPE_VIDEO`` ``/dev/videoX`` for video input/output devices
205205
``VFL_TYPE_VBI`` ``/dev/vbiX`` for vertical blank data (i.e.
206206
closed captions, teletext)
207207
``VFL_TYPE_RADIO`` ``/dev/radioX`` for radio tuners

‎Documentation/translations/zh_CN/video4linux/v4l2-framework.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ video_device注册
649649

650650
接下来你需要注册视频设备:这会为你创建一个字符设备。
651651

652-
err = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
652+
err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
653653
if (err) {
654654
video_device_release(vdev); /* or kfree(my_vdev); */
655655
return err;
@@ -660,7 +660,7 @@ video_device注册
660660

661661
注册哪种设备是根据类型(type)参数。存在以下类型:
662662

663-
VFL_TYPE_GRABBER: 用于视频输入/输出设备的 videoX
663+
VFL_TYPE_VIDEO: 用于视频输入/输出设备的 videoX
664664
VFL_TYPE_VBI: 用于垂直消隐数据的 vbiX (例如,隐藏式字幕,图文电视)
665665
VFL_TYPE_RADIO: 用于广播调谐器的 radioX
666666

‎drivers/media/v4l2-core/v4l2-dev.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,13 @@ static void determine_valid_ioctls(struct video_device *vdev)
542542
V4L2_CAP_META_OUTPUT;
543543
DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE);
544544
const struct v4l2_ioctl_ops *ops = vdev->ioctl_ops;
545-
bool is_vid = vdev->vfl_type == VFL_TYPE_GRABBER &&
545+
bool is_vid = vdev->vfl_type == VFL_TYPE_VIDEO &&
546546
(vdev->device_caps & vid_caps);
547547
bool is_vbi = vdev->vfl_type == VFL_TYPE_VBI;
548548
bool is_radio = vdev->vfl_type == VFL_TYPE_RADIO;
549549
bool is_sdr = vdev->vfl_type == VFL_TYPE_SDR;
550550
bool is_tch = vdev->vfl_type == VFL_TYPE_TOUCH;
551-
bool is_meta = vdev->vfl_type == VFL_TYPE_GRABBER &&
551+
bool is_meta = vdev->vfl_type == VFL_TYPE_VIDEO &&
552552
(vdev->device_caps & meta_caps);
553553
bool is_rx = vdev->vfl_dir != VFL_DIR_TX;
554554
bool is_tx = vdev->vfl_dir != VFL_DIR_RX;
@@ -783,7 +783,7 @@ static int video_register_media_controller(struct video_device *vdev)
783783
vdev->entity.function = MEDIA_ENT_F_UNKNOWN;
784784

785785
switch (vdev->vfl_type) {
786-
case VFL_TYPE_GRABBER:
786+
case VFL_TYPE_VIDEO:
787787
intf_type = MEDIA_INTF_T_V4L_VIDEO;
788788
vdev->entity.function = MEDIA_ENT_F_IO_V4L;
789789
break;
@@ -891,7 +891,7 @@ int __video_register_device(struct video_device *vdev,
891891

892892
/* Part 1: check device type */
893893
switch (type) {
894-
case VFL_TYPE_GRABBER:
894+
case VFL_TYPE_VIDEO:
895895
name_base = "video";
896896
break;
897897
case VFL_TYPE_VBI:
@@ -935,7 +935,7 @@ int __video_register_device(struct video_device *vdev,
935935
* of 128-191 and just pick the first free minor there
936936
* (new style). */
937937
switch (type) {
938-
case VFL_TYPE_GRABBER:
938+
case VFL_TYPE_VIDEO:
939939
minor_offset = 0;
940940
minor_cnt = 64;
941941
break;

‎drivers/media/v4l2-core/v4l2-ioctl.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,12 +941,12 @@ static int check_fmt(struct file *file, enum v4l2_buf_type type)
941941
V4L2_CAP_META_OUTPUT;
942942
struct video_device *vfd = video_devdata(file);
943943
const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
944-
bool is_vid = vfd->vfl_type == VFL_TYPE_GRABBER &&
944+
bool is_vid = vfd->vfl_type == VFL_TYPE_VIDEO &&
945945
(vfd->device_caps & vid_caps);
946946
bool is_vbi = vfd->vfl_type == VFL_TYPE_VBI;
947947
bool is_sdr = vfd->vfl_type == VFL_TYPE_SDR;
948948
bool is_tch = vfd->vfl_type == VFL_TYPE_TOUCH;
949-
bool is_meta = vfd->vfl_type == VFL_TYPE_GRABBER &&
949+
bool is_meta = vfd->vfl_type == VFL_TYPE_VIDEO &&
950950
(vfd->device_caps & meta_caps);
951951
bool is_rx = vfd->vfl_dir != VFL_DIR_TX;
952952
bool is_tx = vfd->vfl_dir != VFL_DIR_RX;

‎include/media/v4l2-dev.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
/**
2525
* enum vfl_devnode_type - type of V4L2 device node
2626
*
27-
* @VFL_TYPE_GRABBER: for video input/output devices
27+
* @VFL_TYPE_VIDEO: for video input/output devices
28+
* @VFL_TYPE_GRABBER: deprecated, same as VFL_TYPE_VIDEO
2829
* @VFL_TYPE_VBI: for vertical blank data (i.e. closed captions, teletext)
2930
* @VFL_TYPE_RADIO: for radio tuners
3031
* @VFL_TYPE_SUBDEV: for V4L2 subdevices
@@ -33,7 +34,8 @@
3334
* @VFL_TYPE_MAX: number of VFL types, must always be last in the enum
3435
*/
3536
enum vfl_devnode_type {
36-
VFL_TYPE_GRABBER = 0,
37+
VFL_TYPE_VIDEO,
38+
VFL_TYPE_GRABBER = VFL_TYPE_VIDEO,
3739
VFL_TYPE_VBI,
3840
VFL_TYPE_RADIO,
3941
VFL_TYPE_SUBDEV,

‎samples/v4l/v4l2-pci-skeleton.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static int skeleton_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
879879
vdev->tvnorms = SKEL_TVNORMS;
880880
video_set_drvdata(vdev, skel);
881881

882-
ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
882+
ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
883883
if (ret)
884884
goto free_hdl;
885885

0 commit comments

Comments
 (0)