aboutsummaryrefslogtreecommitdiffstats
path: root/utils/rds-ctl/rds-ctl.cpp
AgeCommit message (Collapse)AuthorFilesLines
2022-07-28v4l2-ctl/rds-ctl: move tuner info helpers to v4l2-info.cppHEADmasterHans Verkuil1-76/+1
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>
2022-07-28rds-ctl: drop cap2s(), use v4l2_info_capability() insteadHans Verkuil1-43/+2
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>
2021-11-25v4l-utils: use v4l_getsubopt instead of getsuboptHans Verkuil1-1/+2
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>
2021-05-26mass constexpr conversionsRosen Penev1-1/+1
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>
2021-04-21remove unused ARRAY_SIZERosen Penev1-2/+0
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>
2021-04-21clang-tidy: use using instead of typedefRosen Penev1-1/+1
Found with modernize-use-using Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-30clang-tidy: use nullptrRosen Penev1-29/+29
Found with modernize-use-nullptr Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-09clean up includes and convert C includes to C++Rosen Penev1-23/+14
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>
2020-08-03convert files to referenceRosen Penev1-1/+1
Found with performance-unnecessary-value-param Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-08-03use using instead of typedefRosen Penev1-1/+1
Found with modernize-use-using Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-08-03use autoRosen Penev1-1/+1
Found with modernize-use-auto Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-08-03convert to range based loopsRosen Penev1-7/+5
Found with modernize-loop-convert Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-28utils: replace exit with std variantRosen Penev1-10/+10
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>
2020-04-24utils: fix double promotionsRosen Penev1-2/+2
Found with -Wdouble-promotion Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-24utils: fix compilation with C++98Rosen Penev1-1/+1
Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-04-21utils: do not use empty void with C++Rosen Penev1-6/+6
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>
2020-04-21utils: use bool literalsRosen Penev1-1/+1
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>
2020-04-21treewide: replace C casts with C++Rosen Penev1-6/+6
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>
2020-04-20treewide: fix math problemsRosen Penev1-2/+3
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>
2020-04-20treewide: do not use return after elseRosen Penev1-1/+2
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]
2020-04-17utils: checks for empty instead of size in ifRosen Penev1-1/+1
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>
2019-01-22treewide: Fix compilation with uClibc++Rosen Penev1-0/+2
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]
2018-07-30stress-buffer/libmedia_dev/rds-ctl: fix gcc-8.1 warningsHans Verkuil1-1/+1
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>
2018-02-28rds-ctl: improve usage messagesHans Verkuil1-6/+6
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>
2018-02-07v4l-utils: add SPDX license tagsHans Verkuil1-14/+1
Replace existing licenses with SPDX license tags for those files authored by Cisco. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-02-02rds-ctl: drop pointless wrapper library supportHans Verkuil1-26/+6
There is really no point in using libv4l2 when dealing with radio/rds devices. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2017-11-27cec/rds/v4l2-ctl: fix --list-devices optionHans Verkuil1-3/+6
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>
2014-07-27rds-ctl: changes in the TA bit weren't detected.Hans Verkuil1-6/+7
If just the TA bit changed, then nothing was printed by rds-ctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2014-07-17v4l-utils: add new V4L2_CAP_EXT_PIX_FORMAT capabilityHans Verkuil1-4/+0
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>
2014-07-12rds-ctl: print RBDS call sign.Hans Verkuil1-0/+31
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>
2014-02-07rds-ctl: add support for dynamic/static PTYHans Verkuil1-2/+6
This bit was never printed for some reason. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2013-08-15rds-ctl: fix segfault in list_devices()Hans Verkuil1-7/+7
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>
2013-07-31rds-ctl: Always terminate strings properlyGregor Jasny1-7/+7
Detected by Coverity. Signed-off-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
2013-07-30rds-ctl: fix coverity issues.Hans Verkuil1-16/+3
Fixed a number of obvious coding issues found by Coverity. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2013-06-07rds-ctl: support -d10 to refer to radio10.Hans Verkuil1-4/+5
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>
2013-06-07rds-ctl: support RDS-EON and TMC-tuning infoKonke Radlow1-2/+57
- 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>
2013-06-02rds-ctl: fix percentage handling.Hans Verkuil1-5/+12
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>
2012-12-06v4l-utils/utils: fix bug in parse_subopt()Hans Verkuil1-1/+1
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>
2012-10-06rds-ctl.cpp: add a default value for the wait_limit for RDS-DataKonke Radlow1-0/+3
Signed-off-by: Konke Radlow <koradlow@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2012-09-26v4l2-ctl/rds-ctl: fix --silent handling.Hans Verkuil1-0/+2
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>
2012-08-26v4l2-ctl/rds-ctl: fix tuner capabilities listHans Verkuil1-2/+2
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>
2012-08-26rds-ctl: fix wrong device name in usage text.Hans Verkuil1-1/+1
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2012-08-24rds-ctl: add --rbds option.Hans Verkuil1-14/+11
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>
2012-08-17Add core TMC (Traffic Message Channel) supportKonke Radlow1-1/+30
Signed-off-by: Konke Radlow <koradlow@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2012-08-13rds: update email addresses.Hans Verkuil1-1/+1
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>
2012-08-13Add rds-ctl toolKonke Radlow1-0/+938
Signed-off-by: Konke Radlow <koradlow@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Privacy Policy