Mauro Carvalho Chehab [Sun, 31 Aug 2014 23:53:30 +0000 (20:53 -0300)]
libdvbv5: Don't go past the size of dvb_v5_name
As reported by Coverity:
4. cond_between: Checking cmd < 256 implies that cmd has the value which is between 0 and 255 (inclusive) on the true branch.
460 if (cmd >= 0 && cmd < DTV_USER_COMMAND_START)
CID 1054605 (#1 of 1): Out-of-bounds read (OVERRUN)5. overrun-local: Overrunning array dvb_v5_name of 71 8-byte elements at element index 255 (byte offset 2040) using index cmd (which evaluates to 255).
461 return dvb_v5_name[cmd];
462 else if (cmd >= 0 && cmd <= DTV_MAX_STAT_COMMAND)
463 return dvb_user_name[cmd - DTV_USER_COMMAND_START];
464 return NULL;
This wouldn't be a problem if the function was just internal,
but this is part of the public functions.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sun, 31 Aug 2014 23:08:53 +0000 (20:08 -0300)]
libdvbv5: reimplement the spaces filling logic
Coverity doesn't like this construction:
1371 for (i = strlen(hex); i < 49; i++)
CID 1228899 (#1 of 1): Out-of-bounds access (OVERRUN)20. overrun-buffer-arg: Overrunning array spaces of 50 bytes by passing it to a function which accesses it at byte offset 50 using argument 50UL.
1372 strncat(spaces, " ", sizeof(spaces));
1373 ascii[j] = '\0';
1374 dvb_loginfo("%s%s %s %s", prefix, hex, spaces, ascii);
Neither do I: strncat implementation is complex and have likely
a loop inside it, in order to find the end of the array. So, this
likely have O(n^2) complexity for no good reason.
Reimplement the logic. This should likely make coverty happy too.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sun, 31 Aug 2014 22:55:12 +0000 (19:55 -0300)]
libdvbv5: fix a memory leak at descriptors
If we call dvb_fe_dummy(), we need to free it latter.
*** CID 1233565: Resource leak (RESOURCE_LEAK)
/lib/libdvbv5/descriptors.c: 79 in dvb_desc_default_print()
73
74 static void dvb_desc_default_print(struct dvb_v5_fe_parms *parms, const struct dvb_desc *desc)
75 {
76 if (!parms)
77 parms = dvb_fe_dummy();
78 dvb_hexdump(parms, "| ", desc->data, desc->length);
>>> CID 1233565: Resource leak (RESOURCE_LEAK)
>>> Returning without freeing "parms" leaks the storage that it points to.
79 }
80
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sun, 31 Aug 2014 22:49:08 +0000 (19:49 -0300)]
libdvbv5: Rename internally-defined poll function as dvb_poll
poll() is the name of a glibc function. Rename it as dvb_poll().
That should likely fix a Coverity warning:
278 do {
>>> CID 1233564: Out-of-bounds access (ARRAY_VS_SINGLETON)
>>> Passing "&parms->p" to function "poll" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. [Note: The source code implementation of the function has been overridden by a builtin model.]
279 available = poll(&parms->p, dmx_fd, timeout);
280 } while (available < 0 && errno == EOVERFLOW);
Also, as this function is static, use the private struct directly.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:29:06 +0000 (17:29 -0300)]
libdvbv5: add the private structure to the tree
Changeset b8c9e78 forgot to include dvb-fe-priv.h.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:22:03 +0000 (17:22 -0300)]
libdvbv5: Add documentation for dvb-fe.h
Add documentation for the functions and data structures that should
be used for DVB frontend setup with dvb-fe.h
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:16:45 +0000 (17:16 -0300)]
libdvbv5: Fix return values for dvb_fe_get_event()
On most places at dvb-fe, the error values are positive
numbers. Fix it also at dvb_fe_get_event().
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 20:15:35 +0000 (17:15 -0300)]
libdvbv5: Fix parameters dvb_add_parms_for_sys()
The way this function is declared, userspace cannot
actually use, as the properties are opaque.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 18:18:32 +0000 (15:18 -0300)]
libdvbv5: Properly document struct dvb_v5_fe_parms
Now that all elements there are public, document the contents
of the structure.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 16:41:32 +0000 (13:41 -0300)]
libdvbv5: move internal parameters to a separate structure
We don't want that struct dvb_v5_fe_parms size to change on
future versions of the API. Due to that, move all parameters
that shouldn't be visible to userspace into a private structure,
called struct dvb_v5_fe_parms_priv.
With this change, the dvb-fe will now allocate memory for the
private struct, but only the non-priv fields are visible at
the external structure.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 14:05:37 +0000 (11:05 -0300)]
libdvbv5: Move charsets to be inside the parms struct
Instead of using global vars and expose them to the library API,
move the charset definition to be part of the parms struct.
The default changesets can vary from Country to Country.
Also, the output changeset should match whatever is defined at
the system. So, applications may need to change them.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 30 Aug 2014 14:03:05 +0000 (11:03 -0300)]
libdvbv5: be coherent with parse_string.h header
This header is included on several places without being
used. Also, always use it with as <parse_string.h>.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Mon, 25 Aug 2014 12:53:47 +0000 (14:53 +0200)]
v4l2-compliance: require G/S_PRIORITY support for m2m devices
M2M devices didn't support G/S_PRIORITY in the past, but after a
recent kernel change they gained prio support. While that was
actually unintended I realized that it does make sense there as well
since it makes it possible for a filehandle to get exclusive access
to the M2M hardware. So drop the exception for M2M devices.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Gregor Jasny [Sat, 23 Aug 2014 16:42:43 +0000 (13:42 -0300)]
libdvbv5: Make dummy_fe static
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Sat, 23 Aug 2014 16:42:41 +0000 (13:42 -0300)]
libdvbv5: Hide unused and unexposed cnr_to_qual_s tables
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Sat, 23 Aug 2014 16:42:40 +0000 (13:42 -0300)]
libdvbv5: Rename and hide charset definitions
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Sat, 23 Aug 2014 16:42:39 +0000 (13:42 -0300)]
libdvbv5: Remove dvbsat_polarization_name (same as dvb_sat_pol_name)
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Fri, 22 Aug 2014 15:41:30 +0000 (17:41 +0200)]
Start v4l-utils 1.3.91 development cycle
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Gregor Jasny [Fri, 22 Aug 2014 15:03:39 +0000 (17:03 +0200)]
Prepare for 1.3.90 release
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Gregor Jasny [Fri, 22 Aug 2014 15:20:12 +0000 (17:20 +0200)]
qv4l2: Clean up icon distribution list
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Hans Verkuil [Wed, 13 Aug 2014 14:20:19 +0000 (16:20 +0200)]
qv4l2: reset bytesperline when changing pixelformat.
When changing the width or the pixelformat, make sure to zero bytesperline
when setting the format to force the driver to recalculate bytesperline.
This was done for the width, but not the pixelformat.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 11 Aug 2014 15:18:27 +0000 (17:18 +0200)]
qv4l2: fix broken SDR support
Commit
fb1334e60cf2541c630e15c4883cd0eabf0581b5 broke the SDR support.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 11 Aug 2014 14:06:17 +0000 (16:06 +0200)]
v4l2-ctl/qv4l2: fix movement counter calculation
The calculation that determines the 'scrolling' of the test pattern
could 'jump': the counters could become negative and taking the
modulus of a negative number doesn't always do what you expect.
Ensure that the step values are always positive to prevent this issue.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 11 Aug 2014 13:25:35 +0000 (15:25 +0200)]
qv4l2: allow '-d1' option
The v4l2-ctl utility supports -d1 to select /dev/video1. qv4l2 requires
you to write '-d 1'. I do that wrong all the time, so now qv4l2 supports both
versions.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 10 Aug 2014 11:02:07 +0000 (13:02 +0200)]
qv4l2: fix audio looping
The audio loopback never really works well with qv4l2. After comparing it
with the xawtv3 implementation it became clear that the core problem was
that the wrong alsa device was chosen as the capture device.
The alsa handling has been simplified and only 'hw' devices are shown as
this is what the alsa loop code wants. The "Show All Audio Devices" menu
option has been removed.
In addition, a bug was fixed for radio devices: no associated alsa device
was found and the 'Play' button was disabled, so the audio loop was never
started.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 9 Aug 2014 09:36:33 +0000 (11:36 +0200)]
qv4l2: fix segfault when openGL is not compiled in.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 8 Aug 2014 12:10:05 +0000 (14:10 +0200)]
v4l2-compliance: reset control counters
The controls are checked for every input, but the counters that count
the number of standard and private controls are not reset to 0 before
doing the check for the current input. This gave wrong control counts.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Ove Brynestad [Fri, 8 Aug 2014 06:22:48 +0000 (08:22 +0200)]
qv4l2: Add option to enable linear scaling filter
New menu option to enable linear scaling filter when using OpenGL. Default is to
use nearest neighbour
Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Ove Brynestad [Thu, 7 Aug 2014 10:58:39 +0000 (12:58 +0200)]
qv4l2: Fixed cropping bug
Pillar/letterboxing was assumed given by m_cropMethod, but is also depending on
pixelAspectRatio and frame aspect ratio
Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Ove Brynestad [Mon, 4 Aug 2014 13:31:29 +0000 (15:31 +0200)]
qv4l2: refactored cropSize to deliver cropped size
cropFrameSize returned the delta between the full frame and the cropped frame
instead of just returning the cropped frame. This made the code hard to read,
so switch to returning the cropped frame.
Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 8 Aug 2014 09:04:50 +0000 (11:04 +0200)]
v4l2-compliance: allow EIO for control ioctls
The uvc driver has to pass on the new control values to the hardware,
and that may not always accept the new value, even though it was
reported as within the valid range. In that case EIO is returned
and v4l2-compliance should accept that as a valid error code. It's
not the uvc driver's fault that there are many devices with crappy
firmware.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 8 Aug 2014 08:34:26 +0000 (10:34 +0200)]
qv4l2/v4l2-ctl: add support for 14x9 video aspect ratio.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 8 Aug 2014 08:06:30 +0000 (10:06 +0200)]
v4l2-compliance: add test for S_EDID and the E2BIG corner case
If you try to write a larger EDID than the driver/hardware can handle,
the driver should return E2BIG and edid.blocks should be set to the
maximum number of blocks allowed.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Tue, 5 Aug 2014 13:38:27 +0000 (15:38 +0200)]
qv4l2: Adding width and height scaling to the status bar
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 6 Aug 2014 09:31:51 +0000 (11:31 +0200)]
qv4l2: correct PAL pixel aspect values
There are two almost-identical-but-not-quite possible pixel aspect
ratios in use for PAL: either 59:54 or 12:11. Since all our drivers
report 59:54 this is the one we should use in qv4l2 as well.
See also http://en.wikipedia.org/wiki/Pixel_aspect_ratio for more
information on why there are two competing pixel aspect ratios.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 6 Aug 2014 09:30:28 +0000 (11:30 +0200)]
v4l2-ctl/qv4l2: sync to latest vivid-tpg.c
Main change: the 16x9 widescreen vertical lines for PAL/NTSC have been
corrected.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 5 Aug 2014 09:14:20 +0000 (11:14 +0200)]
qv4l2: keep the "Controls" text
Don't chop off the "Controls" text in the tab name: it turns out that
leaving that off makes it hard to tell the difference between tabs
that are setup by qv4l2 and tabs that contain controls from the driver.
If someone can come up with a better way of doing this then that would
be welcome, but for now this is the best I can come up with.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Mon, 4 Aug 2014 09:24:51 +0000 (11:24 +0200)]
qv4l2: Removed bottom layout from capturewin
The information shown can be seen in the status bar
of the main window. The eventfilter that shows the bottom
layout can also be percieved as annoying.
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 4 Aug 2014 07:22:50 +0000 (09:22 +0200)]
libv4l2: valgrind fixes
Initialize reserved fields and a v4l2_format struct.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 4 Aug 2014 07:21:08 +0000 (09:21 +0200)]
qv4l2: fix valgrind warnings
Mostly uninitialized fields, but there was also one inverted get_interval result
check.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 30 Jul 2014 09:28:38 +0000 (11:28 +0200)]
qv4l2: use "ADC Frequency" for SDR instead of just "Frequency"
This makes it more obvious what is going on.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 30 Jul 2014 07:34:05 +0000 (09:34 +0200)]
qv4l2: zero m_tpgLimRGBRange when the device is closed
The m_tpgLimRGBRange pointer was non-NULL when it shouldn't
be. Set it to NULL when the device is closed, that's the correct
place since after that it is invalid until a new device is opened.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Gregor Jasny [Sat, 26 Jul 2014 19:36:16 +0000 (21:36 +0200)]
libv4l2: Lazily allocate convert_mmap_buf
From Hans de Goede:
Originally this was not possible, which is why I went with the fixed buffer
(IIRC). But later on we started dis-allowing changing various parameters
with buffers mapped, because allowing that was just a bad idea.
In order to allow dynamic allocation of convert_mmap_buf, we need to make
sure that:
a) It is not used whenever dest_fmt changes, since it is used
to store destination fmt data and should always be at least
dest_fmt.fmt.pix.sizeimage bytes. I've just checked and all
places which change dest_fmt first call v4l2_check_buffer_change_ok()
which ensures that convert_mmap_buf is not used, frees it and marks
it as MAP_FAILED.
b) It is not allocated before dest_fmt gets set. It is allocated in
2 places:
1) On DQBUF, which only can be done after a stream-on, at which point
dest_fmt must be set.
2) on v4l2_mmap, which requires the caller having done a QUERYBUF,
and thus a REQBUFS, so dest_fmt must be set at this point.
So long story short, yes doing dynamic alloc should work fine. I
suggest introducing a v4l2_ensure_convert_mmap_buf function for
this which checks if convert_mmap_buf == MAP_FAILED and when it
is allocs a buffer of dest_fmt.fmt.pix.sizeimage bytes rounded
up to a multiple PAGE_SIZE. If convert_mmap_buf != MAP_FAILED
and thus the buffer is already allocated it should simply
return success.
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans Verkuil [Fri, 25 Jul 2014 09:48:44 +0000 (11:48 +0200)]
libv4l-mplane: make it aware of the extended pix_format fields
The v4l2_pix_format struct has been extended with new fields. Let libv4l-mplane
make use of that so that the v4l2_pix_format_mplane 'flags' field can be reported
in v4l2_pix_format as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 28 Jul 2014 14:21:56 +0000 (16:21 +0200)]
qv4l2: convert the last direct ioctl calls to a cv4l-helper.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 28 Jul 2014 14:15:25 +0000 (16:15 +0200)]
(c)v4l-helpers: fix broken tests for existence of ioctls.
Instead of checking for success, check for a result != ENOTTY.
Unfortunately this will fail for kernels older than 3.1 when the
default return code for a non-existing ioctl was EINVAL. All I
can say is: upgrade your kernel, there is a reason EINVAL was a
bad idea...
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 21:02:13 +0000 (23:02 +0200)]
qv4l2: missed one more place where QLineEdits were disabled.
Use setReadOnly instead for QLineEdit widgets.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 20:27:07 +0000 (22:27 +0200)]
qv4l2: use setResdOnly for disabled QLineEdit controls
This allows you to copy-and-paste the text and to scroll through
it if the text is longer than the widget.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 19:31:16 +0000 (21:31 +0200)]
libv4l2rds: DI segment order was swapped
The segment number of bit 3 of the DI code is 0, increasing to segment
number 3 for bit 0. The code assumed segment S matched bit S, but it
is bit (3 - S) instead.
Very confusing choice in the standard, so I'm not surprised this was
broken.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 18:57:28 +0000 (20:57 +0200)]
rds-ctl: changes in the TA bit weren't detected.
If just the TA bit changed, then nothing was printed by rds-ctl.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 13:30:59 +0000 (15:30 +0200)]
qv4l2: implement cropping and composing for video output.
To simplify this work g/s_selection helper functions are added to the
helper headers that will fallback to S/G_CROP if necessary.
This patch also fixes a bug where the buffer field was never set when
generating a FIELD_ALTERNATE video output stream.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 13:28:03 +0000 (15:28 +0200)]
v4l2-ctl: the field setting of the initially queued buffer is wrong.
buf.field was set to the next field instead of the current field.
Reordered the code to keep both buf.field and tpg_s_field in sync.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 11:46:45 +0000 (13:46 +0200)]
v4l2-ctl/qv4l2: init mv_hor/vert_mode correctly.
Those fields were initialized to 0 instead of to TPG_MOVE_NONE.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 27 Jul 2014 11:44:16 +0000 (13:44 +0200)]
v4l2-ctl: --clear-bitmap or --clear-clips didn't actually clear it
If --clear-bitmap or --clear-clips were combined with --set-fmt-overlay without
any other changes, then those options were ignored and VIDIOC_S_FMT was never
called. Add a check whether those options were defined to ensure S_FMT is
actually called.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 22:40:40 +0000 (19:40 -0300)]
ir-keytable.1: add XMP protocol at manpage
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Marcel J.E. Mol [Sat, 26 Jul 2014 20:47:25 +0000 (17:47 -0300)]
[v4l-utils] keytable: add support for XMP IR protocol
Signed-off-by: Marcel Mol <marcel@mesa.nl>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
André Roth [Sun, 6 Jul 2014 18:20:30 +0000 (15:20 -0300)]
libdvbv5: provide crc32 to c++
allow C++ apps to use crc32
Signed-off-by: André Roth <neolynx@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reynaldo H. Verdejo Pinochet [Tue, 24 Jun 2014 21:35:40 +0000 (18:35 -0300)]
[libdvbv5] dvb-sat: add universal Ku band (extended) LNBF def
These are quite common and off the shelf, universal
Ku band LBNFs. They started been used in Europe
after the lunch of the Astra 1E and can be found
pretty much everywhere.
Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Sun, 22 Jun 2014 12:49:47 +0000 (09:49 -0300)]
Prefix exported functions with dvb_
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Gregor Jasny [Sun, 22 Jun 2014 12:49:46 +0000 (09:49 -0300)]
Hide parse_string.h content in shared library interface
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Thiago Santos [Mon, 9 Jun 2014 13:51:55 +0000 (10:51 -0300)]
v4l2grab: Add threaded producer/consumer option
Adds options to allow the buffer dqbuf to happen on one thread while
the qbuf happens on another. This is useful to test concurrency access to
the v4l2 features. To enable this, 3 new options were added:
t: enable threaded mode (off by default and will use the loop)
b: enable blocking io mode (off by default
s: how much the consumer thread will sleep after reading a buffer, this is to
simulate the time that it takes to process a buffer in a real application
(in ms)
For example, you can simulate an application that takes 1s to process a buffer
with:
v4l2grab -t -b -s 1000
Signed-off-by: Thiago Santos <ts.santos@sisa.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Sat, 26 Jul 2014 05:34:28 +0000 (07:34 +0200)]
descriptors.h: include <arpa/inet.h> for ntohs
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 26 Jul 2014 05:30:05 +0000 (07:30 +0200)]
v4l-utils: sync with latest kernel headers
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Rob Barker [Thu, 29 May 2014 14:47:16 +0000 (11:47 -0300)]
v4l-utils: libdvbv5: fix compilation issue
Removed unnecessary header file to fix issue with some compilers.
Signed-off-by: Rob Barker <robert.barker@redembedded.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 02:02:00 +0000 (23:02 -0300)]
keytable: Mask selected protocols with the supported ones
It should never try to enable a protocol not supported, as
the Kernel will give an error and reset to none.
That's a problem when -p all option is used. So, mask the
protocols to make this option to work.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:47:47 +0000 (22:47 -0300)]
parse_au0828.pl: fix I2C read payload
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:45:55 +0000 (22:45 -0300)]
dvb-file: fix memory-deallocation bug
channel should be a pointer, as it will be allocated internally,
otherwise we'll have a double de-allocation when freeing DVB
scan structures.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:42:42 +0000 (22:42 -0300)]
parse_au0828.pl: Add a parser to help with au0828 debug
This parser is not 100%, but it properly handles the I2C
registers, making easier to understand the parsed logic.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:39:57 +0000 (22:39 -0300)]
keytable: add support for sharp and mce-kbd protocols
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:25:05 +0000 (22:25 -0300)]
ir-keytable: add the list of supported protocols at man page
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Mauro Carvalho Chehab [Sat, 26 Jul 2014 01:21:00 +0000 (22:21 -0300)]
keytable: add a way to add all protocols on raw decoders
With raw decoders, sometimes it is interesting to be able to
select all decoders, as it helps to use a raw driver to test if
a given IR is producing scancodes.
Add "all" to the list of accepted protocols.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Fri, 25 Jul 2014 14:24:39 +0000 (16:24 +0200)]
qv4l2: add support for output video devices
Hook the test pattern generator into qv4l2, allowing it to be used
as a generator for video output devices. Careful attention has been
given to correct colorspace and RGB quantization handling.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Mauro Carvalho Chehab [Fri, 25 Jul 2014 14:17:13 +0000 (11:17 -0300)]
parse_usb.pl: fix handling of ./parse_tcpdump_log.pl logs
The regex were not parsing right those logs. Fix it, and add
the timestamps to the dumps.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Hans Verkuil [Thu, 24 Jul 2014 12:37:54 +0000 (14:37 +0200)]
v4l2-ctl: fix csc colorbar color pre-calculation
Colors not belonging to the CSC colorbar should just be accepted as is.
The contrast color for the CSC colorbar should be suitable for CSC
conversion as well.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Hans Verkuil [Wed, 23 Jul 2014 16:59:40 +0000 (18:59 +0200)]
qv4l2: add SDR visualization.
Just show a simple waveform of the first 1025 samples of the I and Q samples
in each captured buffer. It's simple but remarkably effective.
Currently only the CU8 format is supported.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 23 Jul 2014 15:27:37 +0000 (17:27 +0200)]
v4l2-ctl: upgrade to the latest version of the test pattern generator
Very minor changes only, mostly a file rename, but this makes it easier
to keep things synchronized.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 23 Jul 2014 13:47:50 +0000 (15:47 +0200)]
qv4l2: fix layout issues related to stacked widgets
I've been digging into why on my laptop the stacked frames in the Input section
appear shifted to the right.
The reason is that the initial loop in fixWidth() sets the minimumwidth
without looking at what the widget is. After some debugging I found out that it
was setting the minimumwidth for the wFrameSR widget.
So I added checks that it only changes it for comboboxes, spinboxes and sliders.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 23 Jul 2014 11:35:15 +0000 (13:35 +0200)]
qv4l2: fix querystd and query_dv_timings
Error messages in case of a missing signal were not displayed, and the
querystd return code check was inverted.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 22 Jul 2014 11:29:28 +0000 (13:29 +0200)]
qv4l2: support output devices
Rework qv4l2 so that output devices (vbi and video out) are supported.
Also disable the streaming option for devices that do not support it.
This is (for now) also disabled for SDR since I don't know how to show
the captured SDR data in a meaningful way.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Tue, 22 Jul 2014 08:25:42 +0000 (10:25 +0200)]
qv4l2: removed redundant set size
The widgets individual minimum sizes are enough
and the height calculation causes problems on
high dpi screens.
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 22 Jul 2014 07:33:46 +0000 (09:33 +0200)]
v4l2-compliance: add sdr buffersize check
Make sure buffersize is set.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 22 Jul 2014 07:24:26 +0000 (09:24 +0200)]
v4l2-ctl: print new SDR buffersize format field.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 22 Jul 2014 06:33:03 +0000 (08:33 +0200)]
v4l-utils: sync with latest kernel
Some more V4L2 API enhancements were merged, so sync with that.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 21 Jul 2014 18:16:39 +0000 (20:16 +0200)]
qv4l2: bug fix in re-subscribing source change events
The source change event was only subscribed for the first event, not
for any of the others. Apparently an 'if-while' construct is legal (?!),
but I meant to write 'if () { do {} while() }'.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 21 Jul 2014 08:19:34 +0000 (10:19 +0200)]
qv4l2: honor the fullscreen setting when starting capturing
The resetSize method would always go out of fullscreen mode for no
good reason. Since it is called when you start capturing it would
also revert the fullscreen setting. So just leave the fullscreen
mode alone.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Mon, 21 Jul 2014 07:25:25 +0000 (09:25 +0200)]
qv4l2: hopefully fix a i386 ubuntu build error
Add 'class' keyword after 'friend' declaration.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 21:44:31 +0000 (23:44 +0200)]
qv4l2: use new control helpers
Instead of trying to handle the various levels of control support that
drivers provide in every application, add helper functions that abstract
away the differences and that simplify working with controls.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 07:18:35 +0000 (09:18 +0200)]
libv4lconvert: fix RGB32 conversion
The RGB32 formats start with an alpha byte in memory. So before calling the
v4lconvert_rgb32_to_rgb24 or v4lconvert_rgb24_to_yuv420 function skip that initial
alpha byte so the src pointer is aligned with the first color component, since
that is what those functions expect.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Hans Verkuil [Sun, 20 Jul 2014 15:53:33 +0000 (17:53 +0200)]
qv4l2: add 'Use Record Priority' option
When set switch to V4L2_PRIORITY_RECORD when streaming.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 15:48:15 +0000 (17:48 +0200)]
qv4l2: correctly resubscribe events after a reopen.
The reopen() call closes the original filehandle and at the same time any
subscribed events. So resubscribe the events.
In addition both the ApplicationWindow and the GeneralTab had a cv4l_fd
instance with the same fd. With reopen that means that those fd's are
no longer in sync.
GeneralTab now has a pointer to the cv4l_fd of the ApplicationWindow, so
they remain synchronized.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 15:35:23 +0000 (17:35 +0200)]
qv4l2: set the new value immediately when updating a control range.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 13:36:47 +0000 (15:36 +0200)]
qv4l2: add Trace IOCTLs option
Useful for debugging and understanding what is happening.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 13:19:15 +0000 (15:19 +0200)]
qv4l2: force bytesperline recalculation when changing the width.
Most drivers will always recalculate bytesperline, but some allow for
applications to set it in order to support line padding.
In that case you need to set the bytesperline to 0 when setting a new
format in order to force the recalculation.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 12:38:42 +0000 (14:38 +0200)]
qv4l2: integrate with the cv4l-helpers.h header
Replace the old v4l2-api.cpp/.h files by the cv4l-helpers.h.
It's a major change, but without any functional changes involved,
just refactoring.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sun, 20 Jul 2014 12:20:09 +0000 (14:20 +0200)]
v4l2-compliance: reworked the (c)v4l-helpers.h headers
These headers were designed to easy coding for the V4L2 API, in particular
hiding the complexity relating to single and multiplanar formats.
These reworked headers resolve a number of design issues and they are now ready
to be used elsewhere.
As an example, the C++ code below works for single and multiplanar video capture and
output, vbi capture and output and sdr capture. By replacing V4L2_MEMORY_MMAP with
_USERPTR it will work with userptr streaming as well. But note that the code is
missing error handling, so a real application will need to do a bit more.
int main(int argc, char **argv)
{
cv4l_fd fd;
unsigned cnt = 0;
fd.open(argc >= 2 ? argv[1] : "/dev/video0");
cv4l_queue q(fd.g_type(), V4L2_MEMORY_MMAP);
q.reqbufs(&fd, 4);
q.obtain_bufs(&fd);
q.queue_all(&fd);
fd.streamon();
cv4l_buffer buf(q);
while (fd.dqbuf(buf) == 0) {
printf("seqnr: %u bytesused[0]: %u bytesused[1]: %u\n", buf.g_sequence(),
buf.g_bytesused(0), buf.g_bytesused(1));
fd.qbuf(buf);
if (cnt++ >= 60)
break;
}
q.free(&fd);
fd.close();
}
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 22:23:46 +0000 (00:23 +0200)]
qv4l2: QImage could be the wrong size
The QImage should be re-created every time the resolution changes, but
sometimes that didn't happen due to bad condition. Updated the condition
ensuring a correct QImage.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 22:08:51 +0000 (00:08 +0200)]
qv4l2: add Q shortcut to close the video window
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 21:45:58 +0000 (23:45 +0200)]
qv4l2: center frame and drop margins in full screen mode
The video was never properly centered in the window, this has now
been fixed.
In addition there were still non-zero margins when in full screen mode,
so the image was scaled even if it should be the native screen resolution.
This is now also working properly.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 20:29:24 +0000 (22:29 +0200)]
qv4l2: improve full-screen handling
Improved the full screen handling. In particular selecting the fullscreen
mode will no longer automatically start streaming, that was not meant to
happen. Also route all fullscreen handling through the correct QAction
rather than duplicating it in the capture window. This ensures a consistent
internal state.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Sat, 19 Jul 2014 07:31:07 +0000 (09:31 +0200)]
v4l2-compliance: fix broken priv test
After the recent addition of V4L2_PIX_FMT_PRIV_MAGIC the priv test
in v4l2-compliance was no longer correct. Fix it by making
V4L2_PIX_FMT_PRIV_MAGIC a valid value.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>