samples: drivers: video: capture: logging improvements

Remove trailing spaces at the end of log string.
Move arguments on the next line for readability.
Align arguments to first line.

Signed-off-by: Josuah Demangeon <me@josuah.net>
This commit is contained in:
Josuah Demangeon 2025-05-18 15:26:33 +00:00 committed by Benjamin Cabé
commit b95d7e2a94

View file

@ -37,10 +37,10 @@ static inline int display_setup(const struct device *const display_dev, const ui
LOG_INF("- Capabilities:"); LOG_INF("- Capabilities:");
LOG_INF(" x_resolution = %u, y_resolution = %u, supported_pixel_formats = %u" LOG_INF(" x_resolution = %u, y_resolution = %u, supported_pixel_formats = %u"
" current_pixel_format = %u, current_orientation = %u", " current_pixel_format = %u, current_orientation = %u",
capabilities.x_resolution, capabilities.y_resolution, capabilities.x_resolution, capabilities.y_resolution,
capabilities.supported_pixel_formats, capabilities.current_pixel_format, capabilities.supported_pixel_formats, capabilities.current_pixel_format,
capabilities.current_orientation); capabilities.current_orientation);
/* Set display pixel format to match the one in use by the camera */ /* Set display pixel format to match the one in use by the camera */
switch (pixfmt) { switch (pixfmt) {
@ -138,9 +138,9 @@ int main(void)
const struct video_format_cap *fcap = &caps.format_caps[i]; const struct video_format_cap *fcap = &caps.format_caps[i];
/* fourcc to string */ /* fourcc to string */
LOG_INF(" %s width [%u; %u; %u] height [%u; %u; %u]", LOG_INF(" %s width [%u; %u; %u] height [%u; %u; %u]",
VIDEO_FOURCC_TO_STR(fcap->pixelformat), VIDEO_FOURCC_TO_STR(fcap->pixelformat),
fcap->width_min, fcap->width_max, fcap->width_step, fcap->width_min, fcap->width_max, fcap->width_step,
fcap->height_min, fcap->height_max, fcap->height_step); fcap->height_min, fcap->height_max, fcap->height_step);
i++; i++;
} }
@ -173,7 +173,7 @@ int main(void)
if (!video_get_frmival(video_dev, &frmival)) { if (!video_get_frmival(video_dev, &frmival)) {
LOG_INF("- Default frame rate : %f fps", LOG_INF("- Default frame rate : %f fps",
1.0 * frmival.denominator / frmival.numerator); 1.0 * frmival.denominator / frmival.numerator);
} }
LOG_INF("- Supported frame intervals for the default format:"); LOG_INF("- Supported frame intervals for the default format:");
@ -181,12 +181,12 @@ int main(void)
fie.format = &fmt; fie.format = &fmt;
while (video_enum_frmival(video_dev, &fie) == 0) { while (video_enum_frmival(video_dev, &fie) == 0) {
if (fie.type == VIDEO_FRMIVAL_TYPE_DISCRETE) { if (fie.type == VIDEO_FRMIVAL_TYPE_DISCRETE) {
LOG_INF(" %u/%u ", fie.discrete.numerator, fie.discrete.denominator); LOG_INF(" %u/%u", fie.discrete.numerator, fie.discrete.denominator);
} else { } else {
LOG_INF(" [min = %u/%u; max = %u/%u; step = %u/%u]", LOG_INF(" [min = %u/%u; max = %u/%u; step = %u/%u]",
fie.stepwise.min.numerator, fie.stepwise.min.denominator, fie.stepwise.min.numerator, fie.stepwise.min.denominator,
fie.stepwise.max.numerator, fie.stepwise.max.denominator, fie.stepwise.max.numerator, fie.stepwise.max.denominator,
fie.stepwise.step.numerator, fie.stepwise.step.denominator); fie.stepwise.step.numerator, fie.stepwise.step.denominator);
} }
fie.index++; fie.index++;
} }
@ -268,8 +268,8 @@ int main(void)
return 0; return 0;
} }
LOG_DBG("Got frame %u! size: %u; timestamp %u ms", frame++, vbuf->bytesused, LOG_DBG("Got frame %u! size: %u; timestamp %u ms",
vbuf->timestamp); frame++, vbuf->bytesused, vbuf->timestamp);
#ifdef CONFIG_TEST #ifdef CONFIG_TEST
if (is_colorbar_ok(vbuf->buffer, fmt)) { if (is_colorbar_ok(vbuf->buffer, fmt)) {