Merge branch 'CR_1389_v4l2_test_error_changhuang.liang' into 'jh7110-devel'

v4l2_test: null display do not process image to display

See merge request sdk/buildroot!17
This commit is contained in:
andy.hu
2022-06-28 07:01:15 +00:00
+12 -2
View File
@@ -211,6 +211,7 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) { if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) {
fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp); fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp);
} }
if (outbuf) {
if (out_format == new_in_format) { if (out_format == new_in_format) {
yuyv_resize(inbuf, outbuf, in_width, in_height); yuyv_resize(inbuf, outbuf, in_width, in_height);
} else if ((STF_DISP_FB == disp_type) && is_yuv420sp) { } else if ((STF_DISP_FB == disp_type) && is_yuv420sp) {
@@ -220,6 +221,7 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
} else { } else {
convert_yuyv_to_rgb(inbuf, outbuf, in_width, in_height, 0); convert_yuyv_to_rgb(inbuf, outbuf, in_width, in_height, 0);
} }
}
break; break;
case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV21:
// if (gp_cfg_param->jpegFilename) { // if (gp_cfg_param->jpegFilename) {
@@ -259,6 +261,7 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
} }
LOG(STF_LEVEL_DEBUG, "out_format=%d, new_in_format=%d, is_yuv420sp=%d\n", out_format, LOG(STF_LEVEL_DEBUG, "out_format=%d, new_in_format=%d, is_yuv420sp=%d\n", out_format,
new_in_format, is_yuv420sp); new_in_format, is_yuv420sp);
if (outbuf) {
if (out_format == new_in_format) { if (out_format == new_in_format) {
convert_nv21_to_nv12(inbuf, outbuf, in_width, in_height, 0); convert_nv21_to_nv12(inbuf, outbuf, in_width, in_height, 0);
} else if ((STF_DISP_FB == disp_type) && is_yuv420sp) { } else if ((STF_DISP_FB == disp_type) && is_yuv420sp) {
@@ -266,6 +269,7 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
} else { } else {
convert_nv21_to_rgb(inbuf, outbuf, in_width, in_height, 0); convert_nv21_to_rgb(inbuf, outbuf, in_width, in_height, 0);
} }
}
break; break;
case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_RGB24:
// if (jpegFilename) { // if (jpegFilename) {
@@ -279,7 +283,10 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) { if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) {
fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp); fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp);
} }
if (outbuf)
convert_rgb888_to_rgb(inbuf, outbuf, in_width, in_height, 0); convert_rgb888_to_rgb(inbuf, outbuf, in_width, in_height, 0);
break; break;
case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB565:
// if (jpegFilename) { // if (jpegFilename) {
@@ -293,12 +300,15 @@ static void imageProcess(const uint8_t* inbuf, uint8_t* outbuf,
if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) { if (gp_cfg_param->jpegFilename && gp_cfg_param->rec_fp) {
fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp); fwrite(inbuf, in_imagesize, 1, gp_cfg_param->rec_fp);
} }
if (outbuf) {
if (out_format == new_in_format) if (out_format == new_in_format)
convert_rgb565_to_rgb(inbuf, outbuf, in_width, in_height, 0); convert_rgb565_to_rgb(inbuf, outbuf, in_width, in_height, 0);
else if ((STF_DISP_FB == disp_type) && is_yuv420sp) else if ((STF_DISP_FB == disp_type) && is_yuv420sp)
convert_rgb565_to_nv12(inbuf, outbuf, in_width, in_height, 0); convert_rgb565_to_nv12(inbuf, outbuf, in_width, in_height, 0);
else else
convert_rgb565_to_rgb(inbuf, outbuf, in_width, in_height, 0); convert_rgb565_to_rgb(inbuf, outbuf, in_width, in_height, 0);
}
break; break;
case V4L2_PIX_FMT_SRGGB12: case V4L2_PIX_FMT_SRGGB12:
if (jpegFilename) if (jpegFilename)
@@ -670,8 +680,8 @@ static void usage(FILE* fp, int argc, char** argv)
"-s | --g_imagesize print image size\n" "-s | --g_imagesize print image size\n"
"\n" "\n"
"Eg:\n" "Eg:\n"
"\t drm: v4l2test -d /dev/video2 -f 5 -c -W 1920 -H 1080 -m 2 -t 2\n" "\t drm: v4l2test -d /dev/video1 -f 5 -c -W 1920 -H 1080 -m 2 -t 2\n"
"\t fb: v4l2test -d /dev/video2 -f 5 -c -W 1920 -H 1080 -m 0 -t 1\n" "\t fb: v4l2test -d /dev/video1 -f 5 -c -W 1920 -H 1080 -m 0 -t 1\n"
"\n" "\n"
"Open debug log level: \n" "Open debug log level: \n"
"\t export V4L2_DEBUG=3\n" "\t export V4L2_DEBUG=3\n"