-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Enhance message content send to 'stderr' #9
base: master
Are you sure you want to change the base?
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 <[email protected]>
8735d3e
to
07de388
Compare
@@ -122,20 +122,17 @@ static void print_summary(struct config *config, struct preset *preset) | |||
printf(" Height: %d\n", preset->height); | |||
printf(" Frames count: %d\n", preset->frames_count); | |||
|
|||
printf(" Format: "); | |||
printf(" Codec Type: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That feels overkill, I don't think I'll take it in, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it in my branch. For testing
control.id, control.size); | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one is a keeper!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will create an seperate PR
@@ -597,6 +601,9 @@ bool video_engine_capabilities_test(int video_fd, | |||
unsigned int capabilities; | |||
int rc; | |||
|
|||
if(!quiet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the changes below feel overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep it in my brach. Just for testing ....
v4l2-request-test.c
Outdated
@@ -217,6 +217,7 @@ static void setup_config(struct config *config) | |||
config->drm_driver = strdup("sun4i-drm"); | |||
|
|||
config->preset_name = strdup("bbb-mpeg2"); | |||
asprintf(&config->slices_path, "data/%s", config->preset_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. [v5] update already send.
@@ -509,7 +515,7 @@ static int set_format_controls(int video_fd, int request_fd, | |||
V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX, | |||
&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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, feel free to spin this as a standalone fix.
@@ -649,7 +649,8 @@ int display_engine_start(int drm_fd, unsigned int width, unsigned int height, | |||
struct format_description *format, | |||
struct video_buffer *video_buffers, unsigned int count, | |||
struct gem_buffer **buffers, | |||
struct display_setup *setup) | |||
struct display_setup *setup, | |||
bool quiet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
- respect quiet field in function calls - otherwise show descriptive control messages Signed-off-by: Ralf Zerres <[email protected]>
- get more descriptive response messages on stderr Signed-off-by: Ralf Zerres <[email protected]>
- h264-ctrls.h - hevc-ctrls.h compile will rely on up to date system/uapi headers Signed-off-by: Ralf Zerres <[email protected]>
- h264-ctrls.h - hevc-ctrls.h Signed-off-by: Ralf Zerres <[email protected]>
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()