[Armadeus-commitlog] armadeus branch, master, updated. armadeus-6.0-323-g7b0b1b1
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2017-09-01 16:32:35
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 7b0b1b160efa00ad7495074547bbad29c2c77eb2 (commit)
from 6e8bad6b0d9a1345ce8995ad77799f7dfe7c79ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7b0b1b160efa00ad7495074547bbad29c2c77eb2
Author: Julien BOIBESSOT <jul...@ar...>
Date: Fri Sep 1 18:31:46 2017 +0200
[DEMOS] capture: add a runtime option to force YUV420 mode on camera
-----------------------------------------------------------------------
Summary of changes:
target/demos/camera/capture/capture.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/target/demos/camera/capture/capture.c b/target/demos/camera/capture/capture.c
index 988de51..bb4a917 100644
--- a/target/demos/camera/capture/capture.c
+++ b/target/demos/camera/capture/capture.c
@@ -81,6 +81,7 @@ struct camera {
struct camera mycamera;
+unsigned int force_yuv420 = 0;
static void errno_exit(const char *s)
{
@@ -895,10 +896,15 @@ static Uint32 get_a_supported_pix_fmt(void)
fprintf(stdout, "Using img format (%d 0x%08x): ", i, fmtdesc.pixelformat);
if (fmtdesc.pixelformat == V4L2_PIX_FMT_YUYV)
fprintf(stdout, "YUYV (YUV:4:2:2)\n");
- if (fmtdesc.pixelformat == V4L2_PIX_FMT_YUV420)
+ else if (fmtdesc.pixelformat == V4L2_PIX_FMT_UYVY)
+ fprintf(stdout, "UYVY (YUV:4:2:2)\n");
+ else if (fmtdesc.pixelformat == V4L2_PIX_FMT_YUV420)
fprintf(stdout, "YUV:4:2:0\n");
- if (fmtdesc.pixelformat == V4L2_PIX_FMT_JPEG)
+ else if (fmtdesc.pixelformat == V4L2_PIX_FMT_JPEG)
fprintf(stdout, "JPEG\n");
+ else
+ fprintf(stdout, "??? \n");
+
return fmtdesc.pixelformat;
}
}
@@ -978,7 +984,11 @@ static void init_capture_device(unsigned int capt_width, unsigned int capt_heigh
CLEAR(fmt);
- fmt.fmt.pix.pixelformat = get_a_supported_pix_fmt();
+ if (!force_yuv420) {
+ fmt.fmt.pix.pixelformat = get_a_supported_pix_fmt();
+ } else {
+ fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
+ }
if (!fmt.fmt.pix.pixelformat) {
fprintf(stderr, "%s does not support requested img formats\n",
dev_name);
@@ -1075,11 +1085,12 @@ static void usage(FILE *fp, int argc, char **argv)
" --cam_width W Use W as camera picture width (instead of %d)\n"
" --cam_height H Use H as camera picture height (instead of %d)\n"
" --use_vpu IP Uses processor VPU to encode video (at camera size) and send it to IP addr\n"
+ " -f | --force Forces YUV420/YU12 format on camera\n"
"",
argv[0], SCREEN_WIDTH, SCREEN_HEIGHT, CAM_WIDTH, CAM_HEIGHT);
}
-static const char short_options [] = "d:hmruwt";
+static const char short_options [] = "d:hmruwtf";
static const struct option long_options [] = {
{ "device", required_argument, NULL, 'd' },
@@ -1092,6 +1103,7 @@ static const struct option long_options [] = {
{ "cam_width", required_argument, NULL, 'y' },
{ "cam_height", required_argument, NULL, 'z' },
{ "use_vpu", required_argument, NULL, 'v' },
+ { "force", no_argument, NULL, 'f' },
{ 0, 0, 0, 0 }
};
@@ -1147,6 +1159,10 @@ int main(int argc, char **argv)
dev_name = optarg;
break;
+ case 'f':
+ force_yuv420 = 1;
+ break;
+
case 'h':
usage(stdout, argc, argv);
exit(EXIT_SUCCESS);
hooks/post-receive
--
armadeus
|