@@ -47,7 +47,7 @@ typedef struct {
47
47
uint16_t height ;
48
48
} image_size_t ;
49
49
50
- STATIC const image_size_t image_size_table [] = {
50
+ STATIC const image_size_t isx012_image_size_table [] = {
51
51
{ VIDEO_HSIZE_QVGA , VIDEO_VSIZE_QVGA },
52
52
{ VIDEO_HSIZE_VGA , VIDEO_VSIZE_VGA },
53
53
{ VIDEO_HSIZE_HD , VIDEO_VSIZE_HD },
@@ -57,12 +57,40 @@ STATIC const image_size_t image_size_table[] = {
57
57
{ VIDEO_HSIZE_5M , VIDEO_VSIZE_5M },
58
58
};
59
59
60
+ STATIC const image_size_t isx019_image_size_table [] = {
61
+ { VIDEO_HSIZE_QVGA , VIDEO_VSIZE_QVGA },
62
+ { VIDEO_HSIZE_VGA , VIDEO_VSIZE_VGA },
63
+ { VIDEO_HSIZE_HD , VIDEO_VSIZE_HD },
64
+ { VIDEO_HSIZE_QUADVGA , VIDEO_VSIZE_QUADVGA },
65
+ };
66
+
67
+ static const char * get_imgsensor_name () {
68
+ static struct v4l2_capability cap ;
69
+
70
+ ioctl (camera_dev .fd , VIDIOC_QUERYCAP , (unsigned long )& cap );
71
+
72
+ return (const char * )cap .driver ;
73
+ }
74
+
60
75
static bool camera_check_width_and_height (uint16_t width , uint16_t height ) {
61
- for (int i = 0 ; i < MP_ARRAY_SIZE (image_size_table ); i ++ ) {
62
- if (image_size_table [i ].width == width && image_size_table [i ].height == height ) {
63
- return true;
76
+ const char * sensor ;
77
+
78
+ sensor = get_imgsensor_name ();
79
+
80
+ if (strncmp (sensor , "ISX012" , strlen ("ISX012" )) == 0 ) {
81
+ for (int i = 0 ; i < MP_ARRAY_SIZE (isx012_image_size_table ); i ++ ) {
82
+ if (isx012_image_size_table [i ].width == width && isx012_image_size_table [i ].height == height ) {
83
+ return true;
84
+ }
85
+ }
86
+ } else if (strncmp (sensor , "ISX019" , strlen ("ISX019" ))) {
87
+ for (int i = 0 ; i < MP_ARRAY_SIZE (isx019_image_size_table ); i ++ ) {
88
+ if (isx019_image_size_table [i ].width == width && isx019_image_size_table [i ].height == height ) {
89
+ return true;
90
+ }
64
91
}
65
92
}
93
+
66
94
return false;
67
95
}
68
96
0 commit comments