aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videodev.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-05-28 11:16:41 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:07:32 -0400
commit78b526a43561d7e5e702ba27948e422dfbc4bea1 (patch)
tree67c8b7150b51f6a82275af6f5baaedff4eaf40c0 /drivers/media/video/videodev.c
parent0e3bd2b9996dfa4105617e2369155823df6b389a (diff)
V4L/DVB (7949): videodev: renamed the vidioc_*_fmt_* callbacks
The naming for the callbacks that handle the VIDIOC_ENUM_FMT and VIDIOC_S/G/TRY_FMT ioctls was very confusing. Renamed it to match the v4l2_buf_type name. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r--drivers/media/video/videodev.c230
1 files changed, 113 insertions, 117 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 83106bba100d..6cf6ad7193d9 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -683,35 +683,35 @@ static int check_fmt (struct video_device *vfd, enum v4l2_buf_type type)
683{ 683{
684 switch (type) { 684 switch (type) {
685 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 685 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
686 if (vfd->vidioc_try_fmt_cap) 686 if (vfd->vidioc_try_fmt_vid_cap)
687 return (0); 687 return (0);
688 break; 688 break;
689 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 689 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
690 if (vfd->vidioc_try_fmt_overlay) 690 if (vfd->vidioc_try_fmt_vid_overlay)
691 return (0); 691 return (0);
692 break; 692 break;
693 case V4L2_BUF_TYPE_VBI_CAPTURE: 693 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
694 if (vfd->vidioc_try_fmt_vbi) 694 if (vfd->vidioc_try_fmt_vid_out)
695 return (0); 695 return (0);
696 break; 696 break;
697 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 697 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
698 if (vfd->vidioc_try_fmt_vbi_output) 698 if (vfd->vidioc_try_fmt_vid_out_overlay)
699 return (0); 699 return (0);
700 break; 700 break;
701 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: 701 case V4L2_BUF_TYPE_VBI_CAPTURE:
702 if (vfd->vidioc_try_fmt_vbi_capture) 702 if (vfd->vidioc_try_fmt_vbi_cap)
703 return (0); 703 return (0);
704 break; 704 break;
705 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 705 case V4L2_BUF_TYPE_VBI_OUTPUT:
706 if (vfd->vidioc_try_fmt_video_output) 706 if (vfd->vidioc_try_fmt_vbi_out)
707 return (0); 707 return (0);
708 break; 708 break;
709 case V4L2_BUF_TYPE_VBI_OUTPUT: 709 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
710 if (vfd->vidioc_try_fmt_vbi_output) 710 if (vfd->vidioc_try_fmt_sliced_vbi_cap)
711 return (0); 711 return (0);
712 break; 712 break;
713 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 713 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
714 if (vfd->vidioc_try_fmt_output_overlay) 714 if (vfd->vidioc_try_fmt_sliced_vbi_out)
715 return (0); 715 return (0);
716 break; 716 break;
717 case V4L2_BUF_TYPE_PRIVATE: 717 case V4L2_BUF_TYPE_PRIVATE:
@@ -828,46 +828,37 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
828 828
829 switch (type) { 829 switch (type) {
830 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 830 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
831 if (vfd->vidioc_enum_fmt_cap) 831 if (vfd->vidioc_enum_fmt_vid_cap)
832 ret=vfd->vidioc_enum_fmt_cap(file, fh, f); 832 ret = vfd->vidioc_enum_fmt_vid_cap(file, fh, f);
833 break; 833 break;
834 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 834 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
835 if (vfd->vidioc_enum_fmt_overlay) 835 if (vfd->vidioc_enum_fmt_vid_overlay)
836 ret=vfd->vidioc_enum_fmt_overlay(file, fh, f); 836 ret = vfd->vidioc_enum_fmt_vid_overlay(file,
837 fh, f);
837 break; 838 break;
839#if 1
840 /* V4L2_BUF_TYPE_VBI_CAPTURE should not support VIDIOC_ENUM_FMT
841 * according to the spec. The bttv and saa7134 drivers support
842 * it though, so just warn that this is deprecated and will be
843 * removed in the near future. */
838 case V4L2_BUF_TYPE_VBI_CAPTURE: 844 case V4L2_BUF_TYPE_VBI_CAPTURE:
839 if (vfd->vidioc_enum_fmt_vbi) 845 if (vfd->vidioc_enum_fmt_vbi_cap) {
840 ret=vfd->vidioc_enum_fmt_vbi(file, fh, f); 846 printk(KERN_WARNING "vidioc_enum_fmt_vbi_cap will be removed in 2.6.28!\n");
841 break; 847 ret = vfd->vidioc_enum_fmt_vbi_cap(file, fh, f);
842 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 848 }
843 if (vfd->vidioc_enum_fmt_sliced_vbi_output)
844 ret = vfd->vidioc_enum_fmt_sliced_vbi_output(file,
845 fh, f);
846 break;
847 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
848 if (vfd->vidioc_enum_fmt_vbi_capture)
849 ret=vfd->vidioc_enum_fmt_vbi_capture(file,
850 fh, f);
851 break; 849 break;
850#endif
852 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 851 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
853 if (vfd->vidioc_enum_fmt_video_output) 852 if (vfd->vidioc_enum_fmt_vid_out)
854 ret=vfd->vidioc_enum_fmt_video_output(file, 853 ret = vfd->vidioc_enum_fmt_vid_out(file, fh, f);
855 fh, f);
856 break;
857 case V4L2_BUF_TYPE_VBI_OUTPUT:
858 if (vfd->vidioc_enum_fmt_vbi_output)
859 ret=vfd->vidioc_enum_fmt_vbi_output(file,
860 fh, f);
861 break;
862 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
863 if (vfd->vidioc_enum_fmt_output_overlay)
864 ret=vfd->vidioc_enum_fmt_output_overlay(file, fh, f);
865 break; 854 break;
866 case V4L2_BUF_TYPE_PRIVATE: 855 case V4L2_BUF_TYPE_PRIVATE:
867 if (vfd->vidioc_enum_fmt_type_private) 856 if (vfd->vidioc_enum_fmt_type_private)
868 ret=vfd->vidioc_enum_fmt_type_private(file, 857 ret = vfd->vidioc_enum_fmt_type_private(file,
869 fh, f); 858 fh, f);
870 break; 859 break;
860 default:
861 break;
871 } 862 }
872 if (!ret) 863 if (!ret)
873 dbgarg (cmd, "index=%d, type=%d, flags=%d, " 864 dbgarg (cmd, "index=%d, type=%d, flags=%d, "
@@ -891,43 +882,46 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
891 882
892 switch (f->type) { 883 switch (f->type) {
893 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 884 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
894 if (vfd->vidioc_g_fmt_cap) 885 if (vfd->vidioc_g_fmt_vid_cap)
895 ret=vfd->vidioc_g_fmt_cap(file, fh, f); 886 ret = vfd->vidioc_g_fmt_vid_cap(file, fh, f);
896 if (!ret) 887 if (!ret)
897 v4l_print_pix_fmt(vfd,&f->fmt.pix); 888 v4l_print_pix_fmt(vfd,&f->fmt.pix);
898 break; 889 break;
899 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 890 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
900 if (vfd->vidioc_g_fmt_overlay) 891 if (vfd->vidioc_g_fmt_vid_overlay)
901 ret=vfd->vidioc_g_fmt_overlay(file, fh, f); 892 ret = vfd->vidioc_g_fmt_vid_overlay(file,
902 break; 893 fh, f);
903 case V4L2_BUF_TYPE_VBI_CAPTURE:
904 if (vfd->vidioc_g_fmt_vbi)
905 ret=vfd->vidioc_g_fmt_vbi(file, fh, f);
906 break;
907 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
908 if (vfd->vidioc_g_fmt_sliced_vbi_output)
909 ret = vfd->vidioc_g_fmt_sliced_vbi_output(file, fh, f);
910 break;
911 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
912 if (vfd->vidioc_g_fmt_vbi_capture)
913 ret=vfd->vidioc_g_fmt_vbi_capture(file, fh, f);
914 break; 894 break;
915 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 895 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
916 if (vfd->vidioc_g_fmt_video_output) 896 if (vfd->vidioc_g_fmt_vid_out)
917 ret=vfd->vidioc_g_fmt_video_output(file, 897 ret = vfd->vidioc_g_fmt_vid_out(file, fh, f);
918 fh, f);
919 break; 898 break;
920 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 899 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
921 if (vfd->vidioc_g_fmt_output_overlay) 900 if (vfd->vidioc_g_fmt_vid_out_overlay)
922 ret=vfd->vidioc_g_fmt_output_overlay(file, fh, f); 901 ret = vfd->vidioc_g_fmt_vid_out_overlay(file,
902 fh, f);
903 break;
904 case V4L2_BUF_TYPE_VBI_CAPTURE:
905 if (vfd->vidioc_g_fmt_vbi_cap)
906 ret = vfd->vidioc_g_fmt_vbi_cap(file, fh, f);
923 break; 907 break;
924 case V4L2_BUF_TYPE_VBI_OUTPUT: 908 case V4L2_BUF_TYPE_VBI_OUTPUT:
925 if (vfd->vidioc_g_fmt_vbi_output) 909 if (vfd->vidioc_g_fmt_vbi_out)
926 ret=vfd->vidioc_g_fmt_vbi_output(file, fh, f); 910 ret = vfd->vidioc_g_fmt_vbi_out(file, fh, f);
911 break;
912 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
913 if (vfd->vidioc_g_fmt_sliced_vbi_cap)
914 ret = vfd->vidioc_g_fmt_sliced_vbi_cap(file,
915 fh, f);
916 break;
917 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
918 if (vfd->vidioc_g_fmt_sliced_vbi_out)
919 ret = vfd->vidioc_g_fmt_sliced_vbi_out(file,
920 fh, f);
927 break; 921 break;
928 case V4L2_BUF_TYPE_PRIVATE: 922 case V4L2_BUF_TYPE_PRIVATE:
929 if (vfd->vidioc_g_fmt_type_private) 923 if (vfd->vidioc_g_fmt_type_private)
930 ret=vfd->vidioc_g_fmt_type_private(file, 924 ret = vfd->vidioc_g_fmt_type_private(file,
931 fh, f); 925 fh, f);
932 break; 926 break;
933 } 927 }
@@ -945,42 +939,44 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
945 switch (f->type) { 939 switch (f->type) {
946 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 940 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
947 v4l_print_pix_fmt(vfd,&f->fmt.pix); 941 v4l_print_pix_fmt(vfd,&f->fmt.pix);
948 if (vfd->vidioc_s_fmt_cap) 942 if (vfd->vidioc_s_fmt_vid_cap)
949 ret=vfd->vidioc_s_fmt_cap(file, fh, f); 943 ret = vfd->vidioc_s_fmt_vid_cap(file, fh, f);
950 break; 944 break;
951 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 945 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
952 if (vfd->vidioc_s_fmt_overlay) 946 if (vfd->vidioc_s_fmt_vid_overlay)
953 ret=vfd->vidioc_s_fmt_overlay(file, fh, f); 947 ret = vfd->vidioc_s_fmt_vid_overlay(file,
954 break; 948 fh, f);
955 case V4L2_BUF_TYPE_VBI_CAPTURE:
956 if (vfd->vidioc_s_fmt_vbi)
957 ret=vfd->vidioc_s_fmt_vbi(file, fh, f);
958 break;
959 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
960 if (vfd->vidioc_s_fmt_sliced_vbi_output)
961 ret = vfd->vidioc_s_fmt_sliced_vbi_output(file, fh, f);
962 break;
963 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
964 if (vfd->vidioc_s_fmt_vbi_capture)
965 ret=vfd->vidioc_s_fmt_vbi_capture(file, fh, f);
966 break; 949 break;
967 case V4L2_BUF_TYPE_VIDEO_OUTPUT: 950 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
968 if (vfd->vidioc_s_fmt_video_output) 951 if (vfd->vidioc_s_fmt_vid_out)
969 ret=vfd->vidioc_s_fmt_video_output(file, 952 ret = vfd->vidioc_s_fmt_vid_out(file, fh, f);
970 fh, f);
971 break; 953 break;
972 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 954 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
973 if (vfd->vidioc_s_fmt_output_overlay) 955 if (vfd->vidioc_s_fmt_vid_out_overlay)
974 ret=vfd->vidioc_s_fmt_output_overlay(file, fh, f); 956 ret = vfd->vidioc_s_fmt_vid_out_overlay(file,
957 fh, f);
958 break;
959 case V4L2_BUF_TYPE_VBI_CAPTURE:
960 if (vfd->vidioc_s_fmt_vbi_cap)
961 ret = vfd->vidioc_s_fmt_vbi_cap(file, fh, f);
975 break; 962 break;
976 case V4L2_BUF_TYPE_VBI_OUTPUT: 963 case V4L2_BUF_TYPE_VBI_OUTPUT:
977 if (vfd->vidioc_s_fmt_vbi_output) 964 if (vfd->vidioc_s_fmt_vbi_out)
978 ret=vfd->vidioc_s_fmt_vbi_output(file, 965 ret = vfd->vidioc_s_fmt_vbi_out(file, fh, f);
979 fh, f); 966 break;
967 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
968 if (vfd->vidioc_s_fmt_sliced_vbi_cap)
969 ret = vfd->vidioc_s_fmt_sliced_vbi_cap(file,
970 fh, f);
971 break;
972 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
973 if (vfd->vidioc_s_fmt_sliced_vbi_out)
974 ret = vfd->vidioc_s_fmt_sliced_vbi_out(file,
975 fh, f);
980 break; 976 break;
981 case V4L2_BUF_TYPE_PRIVATE: 977 case V4L2_BUF_TYPE_PRIVATE:
982 if (vfd->vidioc_s_fmt_type_private) 978 if (vfd->vidioc_s_fmt_type_private)
983 ret=vfd->vidioc_s_fmt_type_private(file, 979 ret = vfd->vidioc_s_fmt_type_private(file,
984 fh, f); 980 fh, f);
985 break; 981 break;
986 } 982 }
@@ -995,46 +991,46 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
995 v4l2_type_names)); 991 v4l2_type_names));
996 switch (f->type) { 992 switch (f->type) {
997 case V4L2_BUF_TYPE_VIDEO_CAPTURE: 993 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
998 if (vfd->vidioc_try_fmt_cap) 994 if (vfd->vidioc_try_fmt_vid_cap)
999 ret=vfd->vidioc_try_fmt_cap(file, fh, f); 995 ret = vfd->vidioc_try_fmt_vid_cap(file, fh, f);
1000 if (!ret) 996 if (!ret)
1001 v4l_print_pix_fmt(vfd,&f->fmt.pix); 997 v4l_print_pix_fmt(vfd,&f->fmt.pix);
1002 break; 998 break;
1003 case V4L2_BUF_TYPE_VIDEO_OVERLAY: 999 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
1004 if (vfd->vidioc_try_fmt_overlay) 1000 if (vfd->vidioc_try_fmt_vid_overlay)
1005 ret=vfd->vidioc_try_fmt_overlay(file, fh, f); 1001 ret = vfd->vidioc_try_fmt_vid_overlay(file,
1002 fh, f);
1003 break;
1004 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
1005 if (vfd->vidioc_try_fmt_vid_out)
1006 ret = vfd->vidioc_try_fmt_vid_out(file, fh, f);
1007 break;
1008 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
1009 if (vfd->vidioc_try_fmt_vid_out_overlay)
1010 ret = vfd->vidioc_try_fmt_vid_out_overlay(file,
1011 fh, f);
1006 break; 1012 break;
1007 case V4L2_BUF_TYPE_VBI_CAPTURE: 1013 case V4L2_BUF_TYPE_VBI_CAPTURE:
1008 if (vfd->vidioc_try_fmt_vbi) 1014 if (vfd->vidioc_try_fmt_vbi_cap)
1009 ret=vfd->vidioc_try_fmt_vbi(file, fh, f); 1015 ret = vfd->vidioc_try_fmt_vbi_cap(file, fh, f);
1010 break; 1016 break;
1011 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 1017 case V4L2_BUF_TYPE_VBI_OUTPUT:
1012 if (vfd->vidioc_try_fmt_sliced_vbi_output) 1018 if (vfd->vidioc_try_fmt_vbi_out)
1013 ret = vfd->vidioc_try_fmt_sliced_vbi_output(file, 1019 ret = vfd->vidioc_try_fmt_vbi_out(file, fh, f);
1014 fh, f);
1015 break; 1020 break;
1016 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: 1021 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
1017 if (vfd->vidioc_try_fmt_vbi_capture) 1022 if (vfd->vidioc_try_fmt_sliced_vbi_cap)
1018 ret=vfd->vidioc_try_fmt_vbi_capture(file, 1023 ret = vfd->vidioc_try_fmt_sliced_vbi_cap(file,
1019 fh, f);
1020 break;
1021 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
1022 if (vfd->vidioc_try_fmt_video_output)
1023 ret=vfd->vidioc_try_fmt_video_output(file,
1024 fh, f); 1024 fh, f);
1025 break; 1025 break;
1026 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: 1026 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
1027 if (vfd->vidioc_try_fmt_output_overlay) 1027 if (vfd->vidioc_try_fmt_sliced_vbi_out)
1028 ret=vfd->vidioc_try_fmt_output_overlay(file, fh, f); 1028 ret = vfd->vidioc_try_fmt_sliced_vbi_out(file,
1029 break;
1030 case V4L2_BUF_TYPE_VBI_OUTPUT:
1031 if (vfd->vidioc_try_fmt_vbi_output)
1032 ret=vfd->vidioc_try_fmt_vbi_output(file,
1033 fh, f); 1029 fh, f);
1034 break; 1030 break;
1035 case V4L2_BUF_TYPE_PRIVATE: 1031 case V4L2_BUF_TYPE_PRIVATE:
1036 if (vfd->vidioc_try_fmt_type_private) 1032 if (vfd->vidioc_try_fmt_type_private)
1037 ret=vfd->vidioc_try_fmt_type_private(file, 1033 ret = vfd->vidioc_try_fmt_type_private(file,
1038 fh, f); 1034 fh, f);
1039 break; 1035 break;
1040 } 1036 }