Skip to content

Commit 2fdc051

Browse files
ngphibangcfriedt
authored andcommitted
samples: drivers: video: Fix RGB565/BGR565 in display format
Formats should be coherently set between camera and display. Forcing RGB565 to BGR565 will break some platforms. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent 220571e commit 2fdc051

File tree

1 file changed

+2
-2
lines changed
  • samples/drivers/video/capture/src

1 file changed

+2
-2
lines changed

samples/drivers/video/capture/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ static inline int display_setup(const struct device *const display_dev, const ui
4646
/* Set display pixel format to match the one in use by the camera */
4747
switch (pixfmt) {
4848
case VIDEO_PIX_FMT_RGB565:
49-
if (capabilities.current_pixel_format != PIXEL_FORMAT_BGR_565) {
50-
ret = display_set_pixel_format(display_dev, PIXEL_FORMAT_BGR_565);
49+
if (capabilities.current_pixel_format != PIXEL_FORMAT_RGB_565) {
50+
ret = display_set_pixel_format(display_dev, PIXEL_FORMAT_RGB_565);
5151
}
5252
break;
5353
case VIDEO_PIX_FMT_XRGB32:

0 commit comments

Comments
 (0)