Age | Commit message (Collapse) | Author | Files | Lines |
|
Move the helper functions to decode tuner/modulator related fields
to v4l2-info.cpp to avoid code duplication in between v4l2-ctl and
rds-ctl.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Use the helper function v4l2_info_capability() from v4l2-info.cpp
to show the driver info instead of duplicating that code.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Android doesn't have getsubopt at all, and some libc implementations
use a getsubopt variant that behaves slightly different.
So add a new v4l-getsubopt.h header that either just uses the glibc
function (if glibc is detected) or uses a static inline v4l_getsubopt
that is copied from glibc. This should avoid such problems.
Reported-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Use constexpr instead of const, ensuring these are all initialized
at compile time.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
This is a C construct that is not really needed in C++.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with modernize-use-using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with modernize-use-nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Several C includes ending in .h are deprecated in C++.
Tested with several combinations of uClibc-ng, musl, glibc, libstdcpp,
libcxx, and uClibc++.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with performance-unnecessary-value-param
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with modernize-use-using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with modernize-use-auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with modernize-loop-convert
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Also converted to the appropriate macros for clarity.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with -Wdouble-promotion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with clang-tidy's modernize-redundant-void-arg
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with clang-tidy's modernize-use-bool-literals
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Also remove useless casts.
Found with clang-tidy's google-readability-casting
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with bugprone-incorrect-roundings
Found with performance-type-promotion-in-math-fn
Signed-off-by: Rosen Penev <rosenp@gmail.com>
[hverkuil-cisco@xs4all.nl: 655.25 -> 655.35]
[hverkuil-cisco@xs4all.nl: add std:: to lround call]
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Found with clang-tidy's readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: split '} if () {' into two lines]
[hverkuil-cisco@xs4all.nl: split 'if () continue; else return -1;' into two lines]
|
|
Found with clang-tidy's readability-container-size-empty
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Several headers are missing.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: keep fstream include]
|
|
Fix various snprintf warnings of this type:
get_media_devices.c: In function ‘get_class’:
get_media_devices.c:147:33: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
snprintf(fname, PATH_MAX, "%s/%s", dname, entry->d_name);
^~
get_media_devices.c:147:3: note: ‘snprintf’ output between 2 and 4352 bytes into a destination of size 4096
snprintf(fname, PATH_MAX, "%s/%s", dname, entry->d_name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Drop the '=' separator between the option and the arguments in the
usage message. It's confusing and not needed.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Replace existing licenses with SPDX license tags for those
files authored by Cisco.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
There is really no point in using libv4l2 when dealing with
radio/rds devices.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
All three utilities use the 'files.erase(iter)' construct inside a
for-loop over 'files'. This should be 'iter = files.erase(iter)'.
It works by accident only as long as you don't erase the last element,
after that iter is suddenly invalid. I discovered this with rds-ctl, but
the same problem is in all three utilities.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
If just the TA bit changed, then nothing was printed by rds-ctl.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
And sync up all the various capability-print functions so they
all have the same set of caps that they print. Except for rds-ctl
that just cares about radio related caps.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The PI code encodes a station's call sign for RBDS. Decode it and
print the call sign name.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
This bit was never printed for some reason.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
You can't use files.erase() in list_devices, since if the last element
is removed, then the for-loop will still do a ++iter, which will cause
a segfault the next time iter is derefenced.
This situation happens if there are radio *transmitter* devices, which
do not support G_TUNER.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Detected by Coverity.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Fixed a number of obvious coding issues found by Coverity.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
In order to be consistent with other v4l utilities support the '-d<num>' option
for num >= 10.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
- added functionality to print RDS-EON information
- added functionality to print RDS-TMC tuning information
- clarify option description, change
trigger condition for printing TMC Tuning information
Signed-off-by: Konke Radlow <koradlow@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The block_cnt can be 0, and in that case the percentage becomes -nan.
Fix this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The parse_subopt function did a wrong NULL check, which could cause an
application crash if the sub-option wasn't specified.
This function is used in rds-ctl, v4l2-ctl and v4l2-dbg and is now fixed
in all three.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Signed-off-by: Konke Radlow <koradlow@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
v4l2-ctl mentioned --silent in the usage text, but did not actually add
the option, and rds-ctl added the option, but didn't mention it in the
usage text.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
v4l2-ctl was missing some RDS caps and rds-ctl did have those caps, but printed
it with spaces instead of dashes, making it hard to read.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Added a new rbds option to select RBDS decoding instead of the default RDS
decoding. Note that this also fixes a bug where RBDS decoding was the
default.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: Konke Radlow <koradlow@gmail.com>
|
|
Signed-off-by: Konke Radlow <koradlow@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Replace the Cisco email address with the private email address since the
Cisco summer job has finished.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Signed-off-by: Konke Radlow <koradlow@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|