File tree Expand file tree Collapse file tree 10 files changed +10
-10
lines changed
tests/drivers/video/api/src Expand file tree Collapse file tree 10 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1183,7 +1183,7 @@ static int gc2145_init(const struct device *dev)
1183
1183
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
1184
1184
fmt .width = RESOLUTION_QVGA_W ;
1185
1185
fmt .height = RESOLUTION_QVGA_H ;
1186
- fmt .pitch = RESOLUTION_QVGA_W * 2 ;
1186
+ fmt .pitch = RESOLUTION_QVGA_W * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1187
1187
1188
1188
ret = gc2145_set_fmt (dev , & fmt );
1189
1189
if (ret ) {
Original file line number Diff line number Diff line change @@ -564,7 +564,7 @@ static int mt9m114_init(const struct device *dev)
564
564
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
565
565
fmt .width = 480 ;
566
566
fmt .height = 272 ;
567
- fmt .pitch = fmt .width * 2 ;
567
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
568
568
569
569
ret = mt9m114_set_fmt (dev , & fmt );
570
570
if (ret ) {
Original file line number Diff line number Diff line change @@ -1032,7 +1032,7 @@ static int ov2640_init(const struct device *dev)
1032
1032
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
1033
1033
fmt .width = SVGA_HSIZE ;
1034
1034
fmt .height = SVGA_VSIZE ;
1035
- fmt .pitch = SVGA_HSIZE * 2 ;
1035
+ fmt .pitch = SVGA_HSIZE * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1036
1036
ret = ov2640_set_fmt (dev , & fmt );
1037
1037
if (ret ) {
1038
1038
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -1433,7 +1433,7 @@ static int ov5640_init(const struct device *dev)
1433
1433
fmt .width = 1280 ;
1434
1434
fmt .height = 720 ;
1435
1435
}
1436
- fmt .pitch = fmt .width * 2 ;
1436
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1437
1437
ret = ov5640_set_fmt (dev , & fmt );
1438
1438
if (ret ) {
1439
1439
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -554,7 +554,7 @@ static int ov7670_init(const struct device *dev)
554
554
fmt .pixelformat = VIDEO_PIX_FMT_YUYV ;
555
555
fmt .width = 640 ;
556
556
fmt .height = 480 ;
557
- fmt .pitch = fmt .width * 2 ;
557
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
558
558
ret = ov7670_set_fmt (dev , & fmt );
559
559
if (ret < 0 ) {
560
560
return ret ;
Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ static int ov7725_init(const struct device *dev)
592
592
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
593
593
fmt .width = 640 ;
594
594
fmt .height = 480 ;
595
- fmt .pitch = 640 * 2 ;
595
+ fmt .pitch = fmt . width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
596
596
ret = ov7725_set_fmt (dev , & fmt );
597
597
if (ret ) {
598
598
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ int emul_imager_init(const struct device *dev)
368
368
fmt .pixelformat = fmts [0 ].pixelformat ;
369
369
fmt .width = fmts [0 ].width_min ;
370
370
fmt .height = fmts [0 ].height_min ;
371
- fmt .pitch = fmt .width * 2 ;
371
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
372
372
373
373
ret = emul_imager_set_fmt (dev , & fmt );
374
374
if (ret < 0 ) {
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ int main(void)
150
150
151
151
#if CONFIG_VIDEO_FRAME_WIDTH
152
152
fmt .width = CONFIG_VIDEO_FRAME_WIDTH ;
153
- fmt .pitch = fmt .width * 2 ;
153
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
154
154
#endif
155
155
156
156
if (strcmp (CONFIG_VIDEO_PIXEL_FORMAT , "" )) {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ int main(void)
79
79
/* Set format */
80
80
fmt .width = CONFIG_VIDEO_WIDTH ;
81
81
fmt .height = CONFIG_VIDEO_HEIGHT ;
82
- fmt .pitch = fmt .width * 2 ;
82
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
83
83
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
84
84
85
85
if (video_set_format (video_dev , & fmt )) {
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ ZTEST(video_common, test_video_vbuf)
158
158
fmt .pixelformat = caps .format_caps [0 ].pixelformat ;
159
159
fmt .width = caps .format_caps [0 ].width_max ;
160
160
fmt .height = caps .format_caps [0 ].height_max ;
161
- fmt .pitch = fmt .width * 2 ;
161
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
162
162
fmt .type = type ;
163
163
zexpect_ok (video_set_format (rx_dev , & fmt ));
164
164
You can’t perform that action at this time.
0 commit comments