[RFC] Enhance message content send to 'stderr'#9
[RFC] Enhance message content send to 'stderr'#9rzerres wants to merge 7 commits intobootlin:masterfrom
Conversation
- enable getopt_long supporting long option style (e.g --video-path, --fps, etc.) - try to be consistent which 'v4l2-compliance' binary when choosing option names - adapt help message - to adopt the slice-path you need to explicitly prepend an argument-option (-s or --slice-path) with the path as an option-string - adopt summary output to be in line with long options - typo corrections - update code style (tabify vs whitespace, alingement) Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
8735d3e to
07de388
Compare
| printf(" Frames count: %d\n", preset->frames_count); | ||
|
|
||
| printf(" Format: "); | ||
| printf(" Codec Type: "); |
There was a problem hiding this comment.
Replacing Format with Codec is definitely a change I would take in, but adding more than the short names for the codecs seems overkill. If you'd like to improve this area, one thing would be to use proper names: MPEG-2, H.264 and H.265 instead.
There was a problem hiding this comment.
Will produce an update.
| /* Ref: https://www.kernel.org/doc/html/v4.10/media/uapi/v4l/vidioc-g-ext-ctrls.html */ | ||
| fprintf(stderr, "Initialized 'controls' structure (ctrl_class: %d, which: %d)\n", | ||
| controls.ctrl_class, controls.which); | ||
| fprintf(stderr, " 'control' value (id: %d, size: %d)\n", |
There was a problem hiding this comment.
That feels overkill, I don't think I'll take it in, sorry.
There was a problem hiding this comment.
keep it in my branch. For testing
| rc = ioctl(video_fd, VIDIOC_S_EXT_CTRLS, &controls); | ||
| if (rc < 0) { | ||
| fprintf(stderr, "Unable to set control: %s\n", strerror(errno)); | ||
| fprintf(stderr, "Unable to set control: %s (%d)\n", |
There was a problem hiding this comment.
That one is a keeper!
There was a problem hiding this comment.
will create an seperate PR
| unsigned int capabilities; | ||
| int rc; | ||
|
|
||
| if(!quiet) |
There was a problem hiding this comment.
This and the changes below feel overkill.
There was a problem hiding this comment.
keep it in my brach. Just for testing ....
v4l2-request-test.c
Outdated
There was a problem hiding this comment.
I'd rather keep this in main() so that we alloc once instead of alloc + free + alloc when user specifies another path.
There was a problem hiding this comment.
ok. [v5] update already send.
| &frame->h264.scaling_matrix, | ||
| sizeof(frame->h264.scaling_matrix) }, | ||
| { CODEC_TYPE_H264, "scaling matrix", | ||
| { CODEC_TYPE_H264, "slice parameters", |
There was a problem hiding this comment.
Good catch, feel free to spin this as a standalone fix.
| struct gem_buffer **buffers, | ||
| struct display_setup *setup) | ||
| struct display_setup *setup, | ||
| bool quiet) |
There was a problem hiding this comment.
These functions are not expected to interact with the user other than for printing out errors, so I don't think I'll take this in.
- const struct codec (.name, .description, .type) use more descriptive names when referencing codecs by enum type Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- respect quiet field in function calls - otherwise show descriptive control messages Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- get more descriptive response messages on stderr Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- h264-ctrls.h - hevc-ctrls.h compile will rely on up to date system/uapi headers Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
- h264-ctrls.h - hevc-ctrls.h Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
|
This discussion can be closed. It took me a while to understand, that the github GUI requires an author to group disired commits for new PR's in its own branch. You aren't able to 'exclude' or 'include' just single commit hashes from a single working branch into the PR. :( |
v1:
append new argument to function calls. This can be evaluated to post enhanced messages if not (!quiet) selected
define a resonable default slice_path in setup-config()