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 @@ -1186,7 +1186,7 @@ static int gc2145_init(const struct device *dev)
1186
1186
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
1187
1187
fmt .width = RESOLUTION_QVGA_W ;
1188
1188
fmt .height = RESOLUTION_QVGA_H ;
1189
- fmt .pitch = RESOLUTION_QVGA_W * 2 ;
1189
+ fmt .pitch = RESOLUTION_QVGA_W * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1190
1190
1191
1191
ret = gc2145_set_fmt (dev , VIDEO_EP_OUT , & fmt );
1192
1192
if (ret ) {
Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ static int mt9m114_init(const struct device *dev)
567
567
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
568
568
fmt .width = 480 ;
569
569
fmt .height = 272 ;
570
- fmt .pitch = fmt .width * 2 ;
570
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
571
571
572
572
ret = mt9m114_set_fmt (dev , VIDEO_EP_OUT , & fmt );
573
573
if (ret ) {
Original file line number Diff line number Diff line change @@ -1036,7 +1036,7 @@ static int ov2640_init(const struct device *dev)
1036
1036
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
1037
1037
fmt .width = SVGA_HSIZE ;
1038
1038
fmt .height = SVGA_VSIZE ;
1039
- fmt .pitch = SVGA_HSIZE * 2 ;
1039
+ fmt .pitch = SVGA_HSIZE * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1040
1040
ret = ov2640_set_fmt (dev , VIDEO_EP_OUT , & fmt );
1041
1041
if (ret ) {
1042
1042
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -1439,7 +1439,7 @@ static int ov5640_init(const struct device *dev)
1439
1439
fmt .width = 1280 ;
1440
1440
fmt .height = 720 ;
1441
1441
}
1442
- fmt .pitch = fmt .width * 2 ;
1442
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
1443
1443
ret = ov5640_set_fmt (dev , VIDEO_EP_OUT , & fmt );
1444
1444
if (ret ) {
1445
1445
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ static int ov7670_init(const struct device *dev)
557
557
fmt .pixelformat = VIDEO_PIX_FMT_YUYV ;
558
558
fmt .width = 640 ;
559
559
fmt .height = 480 ;
560
- fmt .pitch = fmt .width * 2 ;
560
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
561
561
ret = ov7670_set_fmt (dev , VIDEO_EP_OUT , & fmt );
562
562
if (ret < 0 ) {
563
563
return ret ;
Original file line number Diff line number Diff line change @@ -598,7 +598,7 @@ static int ov7725_init(const struct device *dev)
598
598
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
599
599
fmt .width = 640 ;
600
600
fmt .height = 480 ;
601
- fmt .pitch = 640 * 2 ;
601
+ fmt .pitch = fmt . width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
602
602
ret = ov7725_set_fmt (dev , VIDEO_EP_OUT , & fmt );
603
603
if (ret ) {
604
604
LOG_ERR ("Unable to configure default format" );
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ int emul_imager_init(const struct device *dev)
398
398
fmt .pixelformat = fmts [0 ].pixelformat ;
399
399
fmt .width = fmts [0 ].width_min ;
400
400
fmt .height = fmts [0 ].height_min ;
401
- fmt .pitch = fmt .width * 2 ;
401
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
402
402
403
403
ret = emul_imager_set_fmt (dev , VIDEO_EP_OUT , & fmt );
404
404
if (ret < 0 ) {
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ int main(void)
147
147
148
148
#if CONFIG_VIDEO_FRAME_WIDTH
149
149
fmt .width = CONFIG_VIDEO_FRAME_WIDTH ;
150
- fmt .pitch = fmt .width * 2 ;
150
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
151
151
#endif
152
152
153
153
if (strcmp (CONFIG_VIDEO_PIXEL_FORMAT , "" )) {
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ int main(void)
76
76
/* Set format */
77
77
fmt .width = CONFIG_VIDEO_WIDTH ;
78
78
fmt .height = CONFIG_VIDEO_HEIGHT ;
79
- fmt .pitch = fmt .width * 2 ;
79
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
80
80
fmt .pixelformat = VIDEO_PIX_FMT_RGB565 ;
81
81
82
82
if (video_set_format (video_dev , VIDEO_EP_OUT , & fmt )) {
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ ZTEST(video_common, test_video_vbuf)
156
156
fmt .pixelformat = caps .format_caps [0 ].pixelformat ;
157
157
fmt .width = caps .format_caps [0 ].width_max ;
158
158
fmt .height = caps .format_caps [0 ].height_max ;
159
- fmt .pitch = fmt .width * 2 ;
159
+ fmt .pitch = fmt .width * video_bits_per_pixel ( fmt . pixelformat ) / BITS_PER_BYTE ;
160
160
zexpect_ok (video_set_format (rx_dev , VIDEO_EP_OUT , & fmt ));
161
161
162
162
/* Allocate a buffer, assuming prj.conf gives enough memory for it */
You can’t perform that action at this time.
0 commit comments