[Armadeus-commitlog] armadeus branch, master, updated. armadeus-6.0-428-ga6888a6eb
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2018-06-29 13:27:01
|
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 a6888a6eb31bedd013bb4774031652e1b1acf205 (commit)
from e862eeb35b8a1b75bc7d3f5dbef364e6bdf4ffaa (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 a6888a6eb31bedd013bb4774031652e1b1acf205
Author: Julien BOIBESSOT <jul...@ar...>
Date: Fri Jun 29 15:25:46 2018 +0200
[DEMOS] capture: add an option to choose camera framerate. Rename some options to fit new one. Fixes fps calculation while we are at it...
-----------------------------------------------------------------------
Summary of changes:
target/demos/camera/capture/capture.c | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/target/demos/camera/capture/capture.c b/target/demos/camera/capture/capture.c
index 3cdf68b55..56ce8a395 100644
--- a/target/demos/camera/capture/capture.c
+++ b/target/demos/camera/capture/capture.c
@@ -83,6 +83,7 @@ struct camera {
struct camera mycamera;
unsigned int force_yuv420 = 0;
+unsigned int force_fps = 0;
unsigned int video_input = 0;
unsigned int capture_mode = 0;
@@ -974,8 +975,11 @@ end_of_fmt:
if (capture_mode) {
CLEAR(parm);
parm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- parm.parm.capture.timeperframe.numerator = 30;
- parm.parm.capture.timeperframe.denominator = 1;
+ parm.parm.capture.timeperframe.numerator = 1;
+ if (force_fps)
+ parm.parm.capture.timeperframe.denominator = force_fps;
+ else
+ parm.parm.capture.timeperframe.denominator = 30;
parm.parm.capture.capturemode = capture_mode;
fprintf(stdout, "Forcing sensor capture mode to %d\n", capture_mode);
if (ioctl(v4l_fd, VIDIOC_S_PARM, &parm) < 0) {
@@ -1192,16 +1196,19 @@ 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"
+ " -y | --yuv Forces YUV420/YU12 format on camera\n"
" -b | --verbose Display some debug informations\n"
+ " -f | --fps N Choose fps (depends on camera sensor, actually 15 or 30 (default))\n"
"",
argv[0], SCREEN_WIDTH, SCREEN_HEIGHT, CAM_WIDTH, CAM_HEIGHT);
}
-static const char short_options [] = "d:hi:mo:ruwtfb";
+static const char short_options [] = "d:hi:mo:ruwtf:bxy";
static const struct option long_options [] = {
+ { "verbose", no_argument, NULL, 'b' },
{ "device", required_argument, NULL, 'd' },
+ { "fps", required_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
{ "input", required_argument, NULL, 'i' },
{ "mmap", no_argument, NULL, 'm' },
@@ -1210,11 +1217,10 @@ static const struct option long_options [] = {
{ "userp", no_argument, NULL, 'u' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 't' },
- { "cam_width", required_argument, NULL, 'y' },
+ { "cam_width", required_argument, NULL, 'x' },
+ { "yuv", no_argument, NULL, 'y' },
{ "cam_height", required_argument, NULL, 'z' },
{ "use_vpu", required_argument, NULL, 'v' },
- { "force", no_argument, NULL, 'f' },
- { "verbose", no_argument, NULL, 'b' },
{ 0, 0, 0, 0 }
};
@@ -1274,9 +1280,11 @@ int main(int argc, char **argv)
dev_name = optarg;
break;
- case 'f':
- force_yuv420 = 1;
- break;
+ case 'f':
+ force_fps = atoi(optarg);
+ if (force_fps != 30)
+ force_fps = 15;
+ break;
case 'h':
usage(stdout, argc, argv);
@@ -1315,10 +1323,14 @@ int main(int argc, char **argv)
height = atoi(optarg);
break;
- case 'y':
+ case 'x':
camwidth = atoi(optarg);
break;
+ case 'y':
+ force_yuv420 = 1;
+ break;
+
case 'z':
camheight = atoi(optarg);
break;
hooks/post-receive
--
armadeus
|