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>
Hans Verkuil [Fri, 18 Jul 2014 23:20:39 +0000 (01:20 +0200)]
qv4l2: add the two new png's to the EXTRA_DIST list
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 18 Jul 2014 22:21:01 +0000 (00:21 +0200)]
qv4l2: fix a coverity defect
*** CID 1226677: Unused pointer value (UNUSED_VALUE)
/utils/qv4l2/ctrl-tab.cpp: 64 in ApplicationWindow::addWidget(QGridLayout *, QWidget *, QFlags<Qt::AlignmentFlag>)()
58 }
59 }
60
61 void ApplicationWindow::addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align)
62 {
63 QToolButton *tb;
>>> CID 1226677: Unused pointer value (UNUSED_VALUE)
>>> Pointer "tb" returned by "qobject_cast(w)" is never used.
64 if (m_col % 2 && !(tb = qobject_cast<QToolButton*>(w)))
65 w->setMinimumWidth(m_minWidth);
66 if (w->sizeHint().width() > m_maxw[m_col])
67 m_maxw[m_col] = w->sizeHint().width();
68 if (w->sizeHint().height() > m_maxh)
69 m_maxh = w->sizeHint().height();
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Fri, 18 Jul 2014 13:26:41 +0000 (15:26 +0200)]
qv4l2: adding fullscreen option to toolbar main window
To get the possibility to start capturing in fullscreen
mode from capture menu and main toolbar
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Fri, 18 Jul 2014 12:45:30 +0000 (14:45 +0200)]
qv4l2: added right click menu to capturewin
Making it possible to do certain actions in
and out of fullscreen mode
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Fri, 18 Jul 2014 10:54:34 +0000 (12:54 +0200)]
qv4l2: added fullscreen functionality for capture window
One can enter fullscreen mode by a push button, the F key
or by a double click. To go back to window mode; all
the same options plus the escape key.
An eventfilter is added to show a status bar when moving
the mouse to the bottom of the screen while in fullscreen mode.
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Fri, 18 Jul 2014 11:57:29 +0000 (13:57 +0200)]
qv4l2: bypass libv4l2 when obtaining the colorspace
libv4l2 does not update the colorspace information when it should.
So just for the purpose of reading the colorspace information we
bypass libv4l2 and do a direct VIDIOC_G_FMT to the driver.
I kept forgetting why I wasn't getting the right colorspace results
and everytime it took me a while before I realized that the colorspace
was wrong.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Hans Verkuil [Fri, 18 Jul 2014 11:47:28 +0000 (13:47 +0200)]
v4l2-ctl: fix returned pixelformats that map to fbdev
fbdev cannot report if the hardware can actually make use of the
alpha channel, so just assume that it does when v4l2-ctl translates
the fbdev pixel format information to V4L2 pixformat defines.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 22:27:42 +0000 (00:27 +0200)]
libv4lconvert: add support for new pixelformats
Support for alpha-channel aware pixelformats was added. Recognize those formats
in libv4lconvert.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Hans Verkuil [Thu, 17 Jul 2014 22:25:00 +0000 (00:25 +0200)]
v4l2-ctl: add support for the new alpha-aware pixelformats.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 22:15:43 +0000 (00:15 +0200)]
qv4l2: add support for new alpha-aware pixelformats.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 21:37:53 +0000 (23:37 +0200)]
v4l2-compliance: also check for V4L2_CAP_EXT_PIX_FORMAT in device_caps
It must be present in both capability sets.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 21:36:15 +0000 (23:36 +0200)]
v4l2-ctl: add support for new extended format flags field.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 20:50:15 +0000 (22:50 +0200)]
v4l2-compliance: check for the presence of V4L2_CAP_EXT_PIX_FORMAT
This cap is set by the core, so any driver that doesn't have it is
bypassing the v4l2 core.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 20:47:14 +0000 (22:47 +0200)]
v4l-utils: add new V4L2_CAP_EXT_PIX_FORMAT capability
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>
Hans Verkuil [Wed, 11 Jun 2014 09:42:55 +0000 (11:42 +0200)]
v4l2-ctl: allow setting/getting subsets
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 10 Jun 2014 14:10:17 +0000 (16:10 +0200)]
v4l2-ctl: add support for array controls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 10 Jun 2014 11:50:52 +0000 (13:50 +0200)]
v4l2-ctl: add support for the motion detection event
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 17:26:17 +0000 (19:26 +0200)]
v4l-utils: update the headers to the latest kernel version.
Ran 'make sync-with-kernel' to get everything synced up again.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 17:19:35 +0000 (19:19 +0200)]
contrib/freebsd/Makefile.am: fix syntax error.
Add missing semi-colons.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 10:52:20 +0000 (12:52 +0200)]
qv4l2: use the new toolbutton for three buttons in the general tab
Replace the old pushbutton for Refresh Tuner Status and Query Standard
and Timings with the new, much better looking tool button.
This allows us to put the label on the left and the tuner status on
the right of the tool button, which looks much better.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Thu, 17 Jul 2014 10:12:15 +0000 (12:12 +0200)]
qv4l2: add new png to the list of distributed files
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Thu, 17 Jul 2014 09:06:51 +0000 (11:06 +0200)]
qv4l2: added icon and moved label
For auto generated buttons, the text of the button
is now used as labels and the buttons are now
QToolButtons with enter key icons
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 16 Jul 2014 22:00:17 +0000 (00:00 +0200)]
qv4l2: m_useGLAct is only available if HAVE_QTGL is set.
Put #ifdef HAVE_QTGL around it to prevent a crash if it wasn't compiled
with opengl.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 16 Jul 2014 11:47:10 +0000 (13:47 +0200)]
qv4l2: always do updateVidCapFormat when changing crop/compose
Changing the crop size can change the format size at the same
time, so we need to update all the formatting parameters.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Hans Verkuil [Wed, 16 Jul 2014 09:55:59 +0000 (11:55 +0200)]
v4l2-compliance: fix problems with vbi streaming.
VBI is only valid for SDTV inputs/outputs. In addition, when you
start streaming make sure to call s_fmt with the right VBI type
(raw vs sliced) otherwise streaming might not work if it is in the
wrong mode.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 16 Jul 2014 07:07:18 +0000 (09:07 +0200)]
v4l2-compliance: add v4l2_format support to cv4l-helpers.h
And use it in v4l2-compliance. This should simplify format handling
in the code.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Wed, 16 Jul 2014 06:03:57 +0000 (08:03 +0200)]
v4l2-compliance: improved v4l helpers header, add tracing
The v4l-helpers.h header was missing ioctl tracing capabilities, this was
fairly annoying. This has now been added.
Also added additional inlines for capability checks.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Anton Arbring [Tue, 15 Jul 2014 11:10:49 +0000 (13:10 +0200)]
qv4l2: removed colon and correct rowcount
removed colon from info labels in general info section
and changed getheight to count rows in the gui, like it
is already done in ctrl-tab.cpp
Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Hans Verkuil [Tue, 15 Jul 2014 09:41:42 +0000 (11:41 +0200)]
qv4l2: fix a confusing error message when capturing VBI.
The message says "non-grey pixelformat not supported for VBI", but what
it really should say is: "this input does not support VBI".
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>