platform/upstream/v4l-utils.git
10 years agov4l2-ctl: --clear-bitmap or --clear-clips didn't actually clear it
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>
10 years agoir-keytable.1: add XMP protocol at manpage
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>
10 years ago[v4l-utils] keytable: add support for XMP IR protocol
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>
10 years agolibdvbv5: provide crc32 to c++
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>
10 years ago[libdvbv5] dvb-sat: add universal Ku band (extended) LNBF def
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>
10 years agoPrefix exported functions with dvb_
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>
10 years agoHide parse_string.h content in shared library interface
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>
10 years agov4l2grab: Add threaded producer/consumer option
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>
10 years agodescriptors.h: include <arpa/inet.h> for ntohs
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>
10 years agov4l-utils: sync with latest kernel headers
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>
10 years agov4l-utils: libdvbv5: fix compilation issue
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>
10 years agokeytable: Mask selected protocols with the supported ones
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>
10 years agoparse_au0828.pl: fix I2C read payload
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>
10 years agodvb-file: fix memory-deallocation bug
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>
10 years agoparse_au0828.pl: Add a parser to help with au0828 debug
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>
10 years agokeytable: add support for sharp and mce-kbd protocols
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>
10 years agoir-keytable: add the list of supported protocols at man page
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>
10 years agokeytable: add a way to add all protocols on raw decoders
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>
10 years agoqv4l2: add support for output video devices
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>
10 years agoparse_usb.pl: fix handling of ./parse_tcpdump_log.pl logs
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>
10 years agov4l2-ctl: fix csc colorbar color pre-calculation
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>
10 years agoqv4l2: add SDR visualization.
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>
10 years agov4l2-ctl: upgrade to the latest version of the test pattern generator
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>
10 years agoqv4l2: fix layout issues related to stacked widgets
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>
10 years agoqv4l2: fix querystd and query_dv_timings
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>
10 years agoqv4l2: support output devices
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>
10 years agoqv4l2: removed redundant set size
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>
10 years agov4l2-compliance: add sdr buffersize check
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>
10 years agov4l2-ctl: print new SDR buffersize format field.
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>
10 years agov4l-utils: sync with latest kernel
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>
10 years agoqv4l2: bug fix in re-subscribing source change events
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>
10 years agoqv4l2: honor the fullscreen setting when starting capturing
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>
10 years agoqv4l2: hopefully fix a i386 ubuntu build error
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>
10 years agoqv4l2: use new control helpers
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>
10 years agolibv4lconvert: fix RGB32 conversion
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>
10 years agoqv4l2: add 'Use Record Priority' option
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>
10 years agoqv4l2: correctly resubscribe events after a reopen.
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>
10 years agoqv4l2: set the new value immediately when updating a control range.
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>
10 years agoqv4l2: add Trace IOCTLs option
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>
10 years agoqv4l2: force bytesperline recalculation when changing the width.
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>
10 years agoqv4l2: integrate with the cv4l-helpers.h header
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>
10 years agov4l2-compliance: reworked the (c)v4l-helpers.h headers
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>
10 years agoqv4l2: QImage could be the wrong size
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>
10 years agoqv4l2: add Q shortcut to close the video window
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>
10 years agoqv4l2: center frame and drop margins in full screen mode
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>
10 years agoqv4l2: improve full-screen handling
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>
10 years agov4l2-compliance: fix broken priv test
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>
10 years agoqv4l2: add the two new png's to the EXTRA_DIST list
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>
10 years agoqv4l2: fix a coverity defect
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>
10 years agoqv4l2: adding fullscreen option to toolbar main window
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>
10 years agoqv4l2: added right click menu to capturewin
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>
10 years agoqv4l2: added fullscreen functionality for capture window
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>
10 years agoqv4l2: bypass libv4l2 when obtaining the colorspace
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>
10 years agov4l2-ctl: fix returned pixelformats that map to fbdev
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>
10 years agolibv4lconvert: add support for new pixelformats
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>
10 years agov4l2-ctl: add support for the new alpha-aware pixelformats.
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>
10 years agoqv4l2: add support for new alpha-aware pixelformats.
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>
10 years agov4l2-compliance: also check for V4L2_CAP_EXT_PIX_FORMAT in device_caps
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>
10 years agov4l2-ctl: add support for new extended format flags field.
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>
10 years agov4l2-compliance: check for the presence of V4L2_CAP_EXT_PIX_FORMAT
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>
10 years agov4l-utils: add new V4L2_CAP_EXT_PIX_FORMAT capability
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>
10 years agov4l2-ctl: allow setting/getting subsets
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>
10 years agov4l2-ctl: add support for array controls
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>
10 years agov4l2-ctl: add support for the motion detection event
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>
10 years agov4l-utils: update the headers to the latest kernel version.
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>
10 years agocontrib/freebsd/Makefile.am: fix syntax error.
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>
10 years agoqv4l2: use the new toolbutton for three buttons in the general tab
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>
10 years agoqv4l2: add new png to the list of distributed files
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>
10 years agoqv4l2: added icon and moved label
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>
10 years agoqv4l2: m_useGLAct is only available if HAVE_QTGL is set.
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>
10 years agoqv4l2: always do updateVidCapFormat when changing crop/compose
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>
10 years agov4l2-compliance: fix problems with vbi streaming.
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>
10 years agov4l2-compliance: add v4l2_format support to cv4l-helpers.h
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>
10 years agov4l2-compliance: improved v4l helpers header, add tracing
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>
10 years agoqv4l2: removed colon and correct rowcount
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>
10 years agoqv4l2: fix a confusing error message when capturing VBI.
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>
10 years agoqv4l2: bugfix and dynamic adjustments
Anton Arbring [Mon, 14 Jul 2014 14:23:57 +0000 (16:23 +0200)]
qv4l2: bugfix and dynamic adjustments

* defined a few hard coded values as consts
* calculate height of window in a more dynamic manner
* recalculate width of columns when subchannels label is changed
* changed horizontal stretch

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: refactoring general-tab.cpp
Anton Arbring [Mon, 14 Jul 2014 10:02:49 +0000 (12:02 +0200)]
qv4l2: refactoring general-tab.cpp

To get a better overview of what's going on, a lot of the
code in the constructor is moved to functions where a section
of the GUI is created.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: allow frequency bands of just one frequency
Hans Verkuil [Tue, 15 Jul 2014 03:48:49 +0000 (05:48 +0200)]
v4l2-compliance: allow frequency bands of just one frequency

Also improve some of the ENUM_FREQ_BANDS checks.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4lcontrol: sync control strings/flags with the kernel
Hans Verkuil [Tue, 8 Jul 2014 11:07:27 +0000 (13:07 +0200)]
libv4lcontrol: sync control strings/flags with the kernel

The emulated control names and control flags were different from
what the kernel uses.  Sync them up.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed by: Hans de Goede <hdegoede@redhat.com>

10 years agolibv4lconvert: add support for extended controls
Hans Verkuil [Tue, 8 Jul 2014 11:04:21 +0000 (13:04 +0200)]
libv4lconvert: add support for extended controls

libv4lconvert did not support the extended control API so qv4l2, which
uses it, didn't work properly with libv4l2 since passing software
emulated controls using the extended control API will fail as those
controls are obviously not known to the driver.

This patch adds support for this API.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed by: Hans de Goede <hdegoede@redhat.com>

10 years agov4l2-compliance: only discrete framesizes are not allowed for output
Hans Verkuil [Sun, 13 Jul 2014 00:15:45 +0000 (02:15 +0200)]
v4l2-compliance: only discrete framesizes are not allowed for output

Stepwise/continuous framesizes can be valid for output as well, so
relax this test.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fix control test
Hans Verkuil [Sat, 12 Jul 2014 10:35:54 +0000 (12:35 +0200)]
v4l2-compliance: fix control test

The test 'step > max - min' doesn't make sense if min == max.
So check for that corner case.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agords-ctl: print RBDS call sign.
Hans Verkuil [Sat, 12 Jul 2014 07:54:42 +0000 (09:54 +0200)]
rds-ctl: print RBDS call sign.

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>
10 years agolibv4l2rds: Area Coverage is only partially available for RBDS
Hans Verkuil [Sat, 12 Jul 2014 07:32:19 +0000 (09:32 +0200)]
libv4l2rds: Area Coverage is only partially available for RBDS

RBDS supports area coverage codes only for B, D and E PI code blocks.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l2rds: handle V4L2_RDS_BLOCK_INVALID.
Hans Verkuil [Sat, 12 Jul 2014 07:28:50 +0000 (09:28 +0200)]
libv4l2rds: handle V4L2_RDS_BLOCK_INVALID.

This possible block value was not understood by libv4l2rds.

This can happen if obsolete so-called 'E' blocks were received.
This should never happen in practice, but it is still good to
handle it, just in case.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: better handling of string controls with a step > 1
Hans Verkuil [Sat, 12 Jul 2014 00:28:56 +0000 (02:28 +0200)]
qv4l2: better handling of string controls with a step > 1

The strings will be filled-out to the end of the step size. That way the user
doesn't have to count spaces just to make sure the right string length is
returned.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: make tab labels more compact.
Hans Verkuil [Sat, 12 Jul 2014 00:14:58 +0000 (02:14 +0200)]
qv4l2: make tab labels more compact.

If you have lots of control classes, then the size of the tab bar gets
too big. The " Controls" suffix of the class name can easily be removed,
which actually improves the look and feel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix coverity defect
Hans Verkuil [Fri, 11 Jul 2014 22:20:19 +0000 (00:20 +0200)]
qv4l2: fix coverity defect

** CID 1225222:  Array compared against 0  (NO_EFFECT)
/utils/qv4l2/ctrl-tab.cpp: 150 in ApplicationWindow::addTabs(int *)()

*** CID 1225222:  Array compared against 0  (NO_EFFECT)
/utils/qv4l2/ctrl-tab.cpp: 150 in ApplicationWindow::addTabs(int *)()
144      QVBoxLayout *vbox = new QVBoxLayout(t);
145      QWidget *w = new QWidget(t);
146
147      vbox->addWidget(w);
148
149      QGridLayout *grid = new QGridLayout(w);
>>>     CID 1225222:  Array compared against 0  (NO_EFFECT)
>>>     Comparing an array to null is not useful: "(char *)qctrl.name".
150      if((char *)qctrl.name) {
151      QLabel *title_tab = new QLabel((char *)qctrl.name, parentWidget());
152      QFont f = title_tab->font();
153      f.setBold(true);
154      title_tab->setFont(f);
155      grid->addWidget(title_tab, m_row, m_col, 1, m_cols, Qt::AlignLeft);

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l2rds: fix date-time handling
Hans Verkuil [Fri, 11 Jul 2014 18:55:35 +0000 (20:55 +0200)]
libv4l2rds: fix date-time handling

The way the offset was handled was wrong: the fact that RDS specifies
the timezone offset in units of 30 minutes clearly was confusing.

Fixed the calculations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: drop setSizeAdjustPolicy(QComboBox::AdjustToContents)
Hans Verkuil [Fri, 11 Jul 2014 13:41:36 +0000 (15:41 +0200)]
qv4l2: drop setSizeAdjustPolicy(QComboBox::AdjustToContents)

This made the combobox width just look weird. Only a few comboboxes had this
policy, all others used the default, so use that for all of them.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: reset size after changing aspect ratios or scaling mode
Hans Verkuil [Fri, 11 Jul 2014 13:36:50 +0000 (15:36 +0200)]
qv4l2: reset size after changing aspect ratios or scaling mode

When the video or pixel aspect ratio is changed by the user, or if
scaling is enabled/disabled, reset the window size to the optimal
size. This behavior is much more natural.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: refactor window size setting at capture start
Hans Verkuil [Fri, 11 Jul 2014 13:36:08 +0000 (15:36 +0200)]
qv4l2: refactor window size setting at capture start

- Renamed resize(), may conflict with inherited QWidget functions
- Clear separation between window size and frame size in setWindowSize()
- Use QSize and its methods where applicable
- Reset (window) size also refactored accordingly

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: refactor crop size calculation
Ove Brynestad [Thu, 10 Jul 2014 14:24:39 +0000 (16:24 +0200)]
qv4l2: refactor crop size calculation

Improve readability by using QSize members and operators for size calculations

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: refactor aspect size calculation
Ove Brynestad [Thu, 10 Jul 2014 12:40:53 +0000 (14:40 +0200)]
qv4l2: refactor aspect size calculation

Improve readability by using QSize members and operators for size calculations

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: refactored capwin variables
Ove Brynestad [Thu, 10 Jul 2014 07:21:10 +0000 (09:21 +0200)]
qv4l2: refactored capwin variables

Use QSize instead of int w,h; to store sizes
Name improvements
Move non-common variables back to renderer specific class

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: moved scaling calculations from setRenderFrame
Ove Brynestad [Tue, 8 Jul 2014 13:39:24 +0000 (15:39 +0200)]
qv4l2: moved scaling calculations from setRenderFrame

Ongoing work to move aspect/crop/scale calculations from individual render
classes to the common capture-win class. Currently different renderers use
slightly different code to calculate the various cropping/scaling/etc. data.
This makes it hard to maintain.

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: update common size variables at GL resize
Ove Brynestad [Tue, 8 Jul 2014 07:22:08 +0000 (09:22 +0200)]
qv4l2: update common size variables at GL resize

Ongoing work to move aspect/crop/scale calculations from individual render
classes to the common capture-win class. Currently different renderers use
slightly different code to calculate the various cropping/scaling/etc. data.
This makes it hard to maintain.

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: moved crop calculation out of GL renderer
Ove Brynestad [Mon, 7 Jul 2014 14:32:41 +0000 (16:32 +0200)]
qv4l2: moved crop calculation out of GL renderer

Ongoing work to move aspect/crop/scale calculations from individual render
classes to the common capture-win class. Currently different renderers use
slightly different code to calculate the various cropping/scaling/etc. data.
This makes it hard to maintain.

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: moved frame/rate count assignment to common class
Ove Brynestad [Mon, 7 Jul 2014 13:55:29 +0000 (15:55 +0200)]
qv4l2: moved frame/rate count assignment to common class

Ongoing work to move aspect/crop/scale calculations from individual render
classes to the common capture-win class. Currently different renderers use
slightly different code to calculate the various cropping/scaling/etc. data.
This makes it hard to maintain.

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>