platform/upstream/v4l-utils.git
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>
10 years agoqv4l2: Made cropsize available to glengine
Ove Brynestad [Fri, 4 Jul 2014 14:35:09 +0000 (16:35 +0200)]
qv4l2: Made cropsize available to glengine

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: removed separate crop offset function
Ove Brynestad [Tue, 1 Jul 2014 10:11:29 +0000 (12:11 +0200)]
qv4l2: removed separate crop offset function

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 Qt scale/crop to common class
Ove Brynestad [Tue, 1 Jul 2014 10:11:29 +0000 (12:11 +0200)]
qv4l2: moved Qt scale/crop 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>
10 years agoqv4l2: move setFrame out of renderer specific classes
Ove Brynestad [Tue, 1 Jul 2014 10:11:29 +0000 (12:11 +0200)]
qv4l2: move setFrame out of renderer specific classes

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: add and use storage for renderer independent frame info
Ove Brynestad [Mon, 30 Jun 2014 11:32:59 +0000 (13:32 +0200)]
qv4l2: add and use storage for renderer independent frame info

This starts 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: fix square aspect ratio handling and improve Video Aspect Ratio
Hans Verkuil [Fri, 11 Jul 2014 12:52:40 +0000 (14:52 +0200)]
qv4l2: fix square aspect ratio handling and improve Video Aspect Ratio

Overriding the pixel aspect ratio to a square ratio never worked since
it was somehow missing in the switch statement.

The "4x3" video aspect ratio was moved from last to third position in
the Video Aspect Ratio list, before the widescreen formats. That is a
more logical place for it to be.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: fix various VBI tests.
Hans Verkuil [Fri, 11 Jul 2014 11:29:50 +0000 (13:29 +0200)]
v4l2-compliance: fix various VBI tests.

The VBI ioctls only make sense if the current input is a SDTV input (CAP_STD).
So skip any VBI related tests if the current input is not an SDTV input.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix height calculation when overriding pixel aspect ratio
Hans Verkuil [Fri, 11 Jul 2014 10:58:27 +0000 (12:58 +0200)]
qv4l2: fix height calculation when overriding pixel aspect ratio

When you override the pixel aspect ratio you still need to call
g_pixel_aspect to get the correct w and h values. Otherwise the
correction for top/bottom/alternate fields will go wrong.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: added titles and moved settings
Anton Arbring [Fri, 11 Jul 2014 07:51:16 +0000 (09:51 +0200)]
qv4l2: added titles and moved settings

Sorting related settings by type and adding titles for
explanation and structure.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: alignment and size mods
Anton Arbring [Wed, 9 Jul 2014 08:31:03 +0000 (10:31 +0200)]
qv4l2: alignment and size mods

To get a more structured and professional look, everything is
left aligned. All buttons, line edits etc. gets a fixed minimum
width and expand stepwise. The window minimum size is set
accordingly.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: hiding disabled GUI items
Anton Arbring [Thu, 10 Jul 2014 14:51:53 +0000 (16:51 +0200)]
qv4l2: hiding disabled GUI items

To make the GUI less cluttered, the input settings are shown only
if they match the current input field. A new function called updateGUI()
is called every time the input changes and shows the settings accordingly.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix sliced vbi support
Hans Verkuil [Thu, 10 Jul 2014 08:01:43 +0000 (10:01 +0200)]
qv4l2: fix sliced vbi support

A spurious updatePixelAspectRatio() call broke the sliced VBI capture support.
There were also a few missing checks that caused sliced VBI capture to
attempt to access the capture window, but for sliced VBI there is no capture
window.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix broken handling of V4L2_VBI_INTERLACED.
Hans Verkuil [Wed, 9 Jul 2014 21:05:13 +0000 (23:05 +0200)]
qv4l2: fix broken handling of V4L2_VBI_INTERLACED.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoRevert "qv4l2: hiding disabled GUI items"
Hans Verkuil [Tue, 8 Jul 2014 21:34:15 +0000 (23:34 +0200)]
Revert "qv4l2: hiding disabled GUI items"

This reverts commit e61dfa54b1b7212e7911ae140bb370d13f361991.

10 years agoRevert "qv4l2: alignment and size mods"
Hans Verkuil [Tue, 8 Jul 2014 21:34:13 +0000 (23:34 +0200)]
Revert "qv4l2: alignment and size mods"

This reverts commit 59fae23b008f4f12a655f35cecdb1248412524a7.

10 years agoRevert "qv4l2: added titles and moved settings"
Hans Verkuil [Tue, 8 Jul 2014 21:33:55 +0000 (23:33 +0200)]
Revert "qv4l2: added titles and moved settings"

This reverts commit 5d216dd34a194bb19481818c5496f4517822f150.

10 years agov4l2-ctl: missing support for continuous frameintervals.
Hans Verkuil [Tue, 8 Jul 2014 21:28:57 +0000 (23:28 +0200)]
v4l2-ctl: missing support for continuous frameintervals.

If VIDIOC_ENUM_FRAMEINTERVALS returns a continuous interval, then v4l2-ctl
wouldn't print the results at all.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: added titles and moved settings
Anton Arbring [Tue, 8 Jul 2014 12:20:08 +0000 (14:20 +0200)]
qv4l2: added titles and moved settings

Sorting related settings by type and adding titles for
explanation and structure.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
10 years agoqv4l2: alignment and size mods
Anton Arbring [Tue, 8 Jul 2014 13:00:29 +0000 (15:00 +0200)]
qv4l2: alignment and size mods

To get a more structured and professional look, everything is
left aligned. All buttons, line edits etc. gets a fixed minimum
width and expand stepwise. The window minimum size is set
accordingly.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
10 years agoqv4l2: hiding disabled GUI items
Anton Arbring [Mon, 7 Jul 2014 14:22:52 +0000 (16:22 +0200)]
qv4l2: hiding disabled GUI items

To make the GUI less cluttered, the input settings are shown only
if they match the current input field. A new function called updateGUI()
is called every time the input changes and shows the settings accordingly.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
10 years agoqv4l2: fix a bug in vidFieldChanged
Hans Verkuil [Tue, 8 Jul 2014 09:19:10 +0000 (11:19 +0200)]
qv4l2: fix a bug in vidFieldChanged

updateVidFormat should be called, not updateVidCapFormat. This method
can be called for both capture and output devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add support for generating limited range RGB
Hans Verkuil [Tue, 8 Jul 2014 07:39:11 +0000 (09:39 +0200)]
v4l2-ctl: add support for generating limited range RGB

The test pattern generator also supports limited range RGB. Add
an option to select this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: the alpha flags are mutually exclusive.
Hans Verkuil [Tue, 8 Jul 2014 07:41:23 +0000 (09:41 +0200)]
v4l2-ctl: the alpha flags are mutually exclusive.

The alpha flags for a framebuffer are mutually exclusive. Implement
this in v4l2-ctl-overlay.cpp.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: add missing source chromakey support.
Hans Verkuil [Tue, 8 Jul 2014 06:56:30 +0000 (08:56 +0200)]
v4l2-ctl: add missing source chromakey support.

Standard chromakey handling was implemented, but the source-chromakey
implementation was missing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-ctl: vastly improve the test pattern generator.
Hans Verkuil [Mon, 7 Jul 2014 19:04:27 +0000 (21:04 +0200)]
v4l2-ctl: vastly improve the test pattern generator.

Replace the simplistic test pattern generator by a much improved
version that supports many more test patterns, support colorspace
conversions and a host of other features.

This code is based on the test pattern generator of the upcoming
vivi rewrite and excepts for some small changes in vivi-tpg.h the
code is identical to that driver. In the future the sync-with-kernel
make target of v4l-utils will just copy the code from the kernel,
making the kernel vivi driver the master copy.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: improve pixel aspect detection
Hans Verkuil [Mon, 7 Jul 2014 18:59:27 +0000 (20:59 +0200)]
qv4l2: improve pixel aspect detection

If CROPCAP is not supported, then try g_std. If that's not supported,
then try g_dv_timings. If all else failed, then just return a square
pixel aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: improve video output support, esp. multiplanar.
Hans Verkuil [Mon, 7 Jul 2014 18:30:46 +0000 (20:30 +0200)]
qv4l2: improve video output support, esp. multiplanar.

There was rudimentary video output support in qv4l2, at least sufficient
to use it to change things like the format.

But this didn't work if the video output driver used the multiplanar API.
Improved qv4l2 to support this.

Note that qv4l2 assumes that you either have video capture or video output.
Memory-to-memory devices are not currently supported.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: get rid of unused v4l2 class methods.
Hans Verkuil [Mon, 7 Jul 2014 18:25:21 +0000 (20:25 +0200)]
qv4l2: get rid of unused v4l2 class methods.

Clean up in preparation of improving video output support in qv4l2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix enabling/disable frame width/height/size
Hans Verkuil [Mon, 7 Jul 2014 12:22:10 +0000 (14:22 +0200)]
qv4l2: fix enabling/disable frame width/height/size

The logic that dealt with when the frame width, height and size
fields had to be enabled and disabled was flawed. Starting and
stopping streaming would just enable all those field unconditionally,
and updating the format state could enable them while streaming.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: zero initial buffers
Hans Verkuil [Mon, 7 Jul 2014 11:51:53 +0000 (13:51 +0200)]
qv4l2: zero initial buffers

If the initial compose rectangle doesn't cover the full buffer,
then there will be a lot of garbage in the buffer if it isn't
zeroed.

Changing the compose rectangle while streaming will correctly
clear buffers as well, it was just this initial setup that caused
problems.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix incorrect disabling of the blending mode
Hans Verkuil [Mon, 7 Jul 2014 09:51:14 +0000 (11:51 +0200)]
qv4l2: fix incorrect disabling of the blending mode

When the blending mode was disabled, the blending function
wasn't turned off. Reworked the code to fix this and to make
the glBlendFunc call sequence easier to follow.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l-mplane: fix compile warning
Hans Verkuil [Mon, 7 Jul 2014 08:17:04 +0000 (10:17 +0200)]
libv4l-mplane: fix compile warning

libv4l-mplane.c:356:24: warning: unused variable 'plugin' [-Wunused-variable]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l-mplane: v4l2-compliance fixes
Hans Verkuil [Sun, 6 Jul 2014 21:59:52 +0000 (23:59 +0200)]
libv4l-mplane: v4l2-compliance fixes

Fixed a variety of issues with this plugin. Found by running
v4l2-compliance -w with my multiplanar-enabled vivi driver.

- v4l2_pix_format's priv field wasn't zeroed.
- attempts to use the multiplanar buf types should return an error
  since they are disabled in the querycap capabilities.
- implement read() and write(): let the driver decide what to do with
  them.
- don't convert the buf type for the cropping ioctls. Just like the
  selection ioctls these shouldn't be converted.
- the memory field of v4l2_buffer should be copied back.
- errno was set to a negative value in at least one place.
- the create_bufs_ioctl() implementation was completely wrong.
- the querycap code didn't convert the device_caps field.

There are still a few issues left, but those come from the libv4l2
library, not from this plugin.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agolibv4l-mplane: copy back v4l2_buffer.m, fix type problems
Hans Verkuil [Sun, 6 Jul 2014 21:01:06 +0000 (23:01 +0200)]
libv4l-mplane: copy back v4l2_buffer.m, fix type problems

The ioctls operating on v4l2_buffer structs should copy back the
v4l2_plane.m to v4l2_buffer.m. Applications (like qv4l2) rely on
VIDIOC_QUERYBUF to return the correct m.offset, etc.

The format ioctls and create_bufs would call the ioctl directly
if the buffer type wasn't one of VIDEO_CAPTURE or VIDEO_OUTPUT.
However, it used the local zeroed format/v4l2_create_buffers
struct instead of the real struct. This is now fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: make the destination sizeimage large enough
Hans Verkuil [Sun, 6 Jul 2014 20:57:04 +0000 (22:57 +0200)]
qv4l2: make the destination sizeimage large enough

Normally v4lconvert_try_format() will make sure that sizeimage is
large enough by calling try_fmt(). But if the multiplanar plugin is
in use, then v4lconvert_try_format() bypasses that plugin and try_fmt()
will fail since the driver expects the _MPLANE buffer types.

Normal programs won't use this function, so it won't be a problem there.
But in our case the solution is fairly simple: just calculate sizeimage
ourselves.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: remove two forgotten debug printfs
Hans Verkuil [Sun, 6 Jul 2014 20:09:33 +0000 (22:09 +0200)]
qv4l2: remove two forgotten debug printfs

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: implement SEQ_TB/BT support for the openGL renderer
Hans Verkuil [Sun, 6 Jul 2014 19:48:56 +0000 (21:48 +0200)]
qv4l2: implement SEQ_TB/BT support for the openGL renderer

Add openGL support for frames captured using the V4L2_FIELD_SEQ_TB/BT
field setting. This was the only field type that wasn't yet supported.

The software renderer still doesn't support it, only openGL does.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add support for crop and compose
Hans Verkuil [Sun, 6 Jul 2014 13:36:05 +0000 (15:36 +0200)]
qv4l2: add support for crop and compose

Implement GUI support to set the crop and compose rectangles if that
is supported by the driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix pixel aspect handling and set compose rectangle
Hans Verkuil [Sat, 5 Jul 2014 21:21:07 +0000 (23:21 +0200)]
qv4l2: fix pixel aspect handling and set compose rectangle

The pixel aspect ratio handling did not take scaling into account.

When changing the format the compose rectangle should be set to the
same size as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix control range handling and broken slider disabling.
Hans Verkuil [Fri, 4 Jul 2014 08:08:52 +0000 (10:08 +0200)]
qv4l2: fix control range handling and broken slider disabling.

The introduction of slider + spinbox widgets for simple integer controls
missed that when such a control is disabled both widgets have to be
disabled, instead only the spinbox was disabled.

Changing the control range on the fly was never properly implemented, this
is now fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: fix compilation error if HAVE_QTGL is undefined
Hans Verkuil [Thu, 3 Jul 2014 21:18:53 +0000 (23:18 +0200)]
qv4l2: fix compilation error if HAVE_QTGL is undefined

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: revert most of the previous patch
Hans Verkuil [Thu, 3 Jul 2014 15:55:50 +0000 (17:55 +0200)]
qv4l2: revert most of the previous patch

The driver I was testing this swapped the numerator and denominator,
causing me to think that the qv4l2 code was wrong. However, it is
correct except for a status message that swapped it as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agodvb-file: better store channels without SDT
Mauro Carvalho Chehab [Thu, 3 Jul 2014 15:34:21 +0000 (12:34 -0300)]
dvb-file: better store channels without SDT

There's  a risk of two channels with different frequencies to have
the same name, as they could have the same service ID.

So, add the frequency to the channel name, to avoid such risk.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoqv4l2: fix pixel aspect ratio calculation
Hans Verkuil [Thu, 3 Jul 2014 15:35:16 +0000 (17:35 +0200)]
qv4l2: fix pixel aspect ratio calculation

The autodetect of the aspect ratio failed (swapped numerator and
denominator) due to the confusing calculation.

Ensure that the numerator always applies to the height of the pixel
and denominator to the width of the pixel (as returned by cropcap).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agodvb-file: store services even when SDT is not found
Mauro Carvalho Chehab [Thu, 3 Jul 2014 14:19:18 +0000 (11:19 -0300)]
dvb-file: store services even when SDT is not found

Sometimes, both PAT and PMT tables are properly parsed, but SDT
table is missing. Without SDT, we don't know the program names,
but it is still possible to store the services. So, do it.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agolibdvbv5: Improve debug logs while scanning PMT
Mauro Carvalho Chehab [Thu, 3 Jul 2014 13:48:53 +0000 (10:48 -0300)]
libdvbv5: Improve debug logs while scanning PMT

Better display what's happening during PMT program scan.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoqv4l2: added user controls
Anton Arbring [Thu, 3 Jul 2014 12:06:54 +0000 (14:06 +0200)]
qv4l2: added user controls

Autogenerated integer controls where the range is less than or equal to
0xFFFF now have both a Slider and a SpinBox to change the value.
Using unsigned to get relevant result in range comparison.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: correctly disable two menu items
Anton Arbring [Thu, 3 Jul 2014 12:00:04 +0000 (14:00 +0200)]
qv4l2: correctly disable two menu items

The "Save Raw Frames" menu item should be disabled if no video device is open,
the "Use OpenGL Rendering" menu item should be disabled if streaming is in
progress.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: changed and removed icons
Anton Arbring [Thu, 3 Jul 2014 08:17:03 +0000 (10:17 +0200)]
qv4l2: changed and removed icons

The new start icon is more intuitive than the old record button.
Some color added to the snapshot icon to make it more visible when enabled.
The close window and show frames icons are removed from the toolbar as they
are not used very frequently.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: clarified two strings
Anton Arbring [Thu, 3 Jul 2014 07:30:44 +0000 (09:30 +0200)]
qv4l2: clarified two strings

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add a 'blending' mode to test images with an alpha channel.
Hans Verkuil [Thu, 3 Jul 2014 07:12:04 +0000 (09:12 +0200)]
qv4l2: add a 'blending' mode to test images with an alpha channel.

When enabled the tool will draw a black square on a white background
and use the alpha channel to make the image transparent so the square
becomes visible.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: GL_RED is not supported everywhere, use GL_LUMINANCE.
Hans Verkuil [Thu, 3 Jul 2014 05:52:54 +0000 (07:52 +0200)]
qv4l2: GL_RED is not supported everywhere, use GL_LUMINANCE.

While GL_RED works fine on my nvidia card, it fails when used under
vmware. Replace by GL_LUMINANCE which is accepted by both.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: colorspace & opengl improvements
Hans Verkuil [Wed, 2 Jul 2014 20:30:18 +0000 (22:30 +0200)]
qv4l2: colorspace & opengl improvements

Handle unknown colorspaces gracefully and refactor the default
pixelformat handling in the opengl renderer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agov4l2-compliance: improve colorspace checks.
Hans Verkuil [Wed, 2 Jul 2014 16:52:02 +0000 (18:52 +0200)]
v4l2-compliance: improve colorspace checks.

Check that V4L2_COLORSPACE_BT878 is never used and that V4L2_COLORSPACE_JPEG
is only used in combination with V4L2_PIX_FMT_JPEG.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoqv4l2: add extensive colorspace support
Hans Verkuil [Wed, 2 Jul 2014 14:40:43 +0000 (16:40 +0200)]
qv4l2: add extensive colorspace support

Support for colorspace handling has been added to the qv4l2 tool.
Two new comboboxes have been added: one to select the colorspace
of the captured video (by default it will use the colorspace as
returned by the driver), and one to select the colorspace of the
display which is sRGB by default.

Special care has been taken to do the correct Y'CbCr to R'G'B'
conversion, the R'G'B' to RGB conversion, the actual colorspace
conversion and the conversion to the display colorspace.

Note that colorspace handling is only supported with the openGL
acceleration. Doing this in the software implementation would be
much too slow.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agodvbv5-zap: Fix LNBf selection
Mauro Carvalho Chehab [Tue, 1 Jul 2014 00:55:26 +0000 (21:55 -0300)]
dvbv5-zap: Fix LNBf selection

There were a number of issues with LNBf selection:

1) the test if lnb parameter was specified was wrong;
2) if LNB is provided on both channel file and command line, use
the latest.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoFix kFreeBSD build
Gregor Jasny [Sun, 29 Jun 2014 10:30:41 +0000 (12:30 +0200)]
Fix kFreeBSD build
* fixed BSDfication of V4L related headers
* Disabled libdvbv5 and v4l-utils build

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoqv4l2: Fix typo
Gregor Jasny [Sat, 28 Jun 2014 17:39:14 +0000 (19:39 +0200)]
qv4l2: Fix typo

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoRevert "libdvbv5: Do not install libdvbv5 by default"
Gregor Jasny [Sat, 28 Jun 2014 16:48:56 +0000 (18:48 +0200)]
Revert "libdvbv5: Do not install libdvbv5 by default"

This reverts commit 4fe1165ab5239bb2fadeed60f9cc8f0f1d6253f5.

10 years agoStart v4l-utils 1.3.x development
Gregor Jasny [Sat, 28 Jun 2014 16:48:47 +0000 (18:48 +0200)]
Start v4l-utils 1.3.x development

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoPrepare for 1.2.0 release v4l-utils-1.2.0
Gregor Jasny [Sat, 28 Jun 2014 15:59:10 +0000 (17:59 +0200)]
Prepare for 1.2.0 release

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: Do not install libdvbv5 by default
Gregor Jasny [Sat, 28 Jun 2014 16:24:22 +0000 (18:24 +0200)]
libdvbv5: Do not install libdvbv5 by default

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoqv4l2: Distribute manpage
Gregor Jasny [Sat, 28 Jun 2014 16:21:14 +0000 (18:21 +0200)]
qv4l2: Distribute manpage

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agov4l2-compliance: Distribute internal header, too
Gregor Jasny [Sat, 28 Jun 2014 16:16:58 +0000 (18:16 +0200)]
v4l2-compliance: Distribute internal header, too

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agobuildsystem: Distribute Android.mk files
Gregor Jasny [Sat, 28 Jun 2014 16:16:30 +0000 (18:16 +0200)]
buildsystem: Distribute Android.mk files

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agomediactl: Distribute internal header, too
Gregor Jasny [Sat, 28 Jun 2014 16:12:44 +0000 (18:12 +0200)]
mediactl: Distribute internal header, too

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agolibdvbv5: Distribute internal header, too
Gregor Jasny [Sat, 28 Jun 2014 16:08:04 +0000 (18:08 +0200)]
libdvbv5: Distribute internal header, too

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
10 years agoparse_dib0700.pl: parse REQUEST_GET_VERSION
Mauro Carvalho Chehab [Sat, 28 Jun 2014 12:45:06 +0000 (09:45 -0300)]
parse_dib0700.pl: parse REQUEST_GET_VERSION

Identify the firmware version on the parsed logs.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoparse_dib0700.pl: Parse REQUEST_SET_I2C_PARAM
Mauro Carvalho Chehab [Sat, 28 Jun 2014 12:25:22 +0000 (09:25 -0300)]
parse_dib0700.pl: Parse REQUEST_SET_I2C_PARAM

Parses I2C speed changes.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agov4l2-compliance: M2M cap + input or output caps should be an error.
Hans Verkuil [Fri, 27 Jun 2014 09:03:51 +0000 (11:03 +0200)]
v4l2-compliance: M2M cap + input or output caps should be an error.

Currently this is a warning, but this is now an obsolete combination
and should never be used.

In the very beginning when m2m devices were introduced they were marked
as capture+output devices, but some applications scan video devices for
those that have the CAPTURE cap set (quite reasonable), and they would
also match such m2m devices. Quite soon we realized that this was a
problem and we introduced the m2m cap.

Because of this the combination of M2M + CAPTURE or OUTPUT caps is
illegal and should not be used anymore.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
10 years agoRevert "wip"
Laurent Pinchart [Wed, 25 Jun 2014 09:37:24 +0000 (11:37 +0200)]
Revert "wip"

The commit was pushed by mistake, revert it.

This reverts commit 83d0df45745873f856c8a63bf4a86fec70559fca.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 years agoparse_dib0700.pl: autoflush writes
Mauro Carvalho Chehab [Tue, 24 Jun 2014 21:47:07 +0000 (18:47 -0300)]
parse_dib0700.pl: autoflush writes

Autoflushing avoids loosing message when CTRL-C is pressed.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoparse_dib0700.pl: Make the delays multiple of 10ms
Mauro Carvalho Chehab [Tue, 24 Jun 2014 21:42:59 +0000 (18:42 -0300)]
parse_dib0700.pl: Make the delays multiple of 10ms

That makes it more real to what the Kernel would provide.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoparse_dib0700.pl: add support to identify delays
Mauro Carvalho Chehab [Tue, 24 Jun 2014 20:31:21 +0000 (17:31 -0300)]
parse_dib0700.pl: add support to identify delays

This could be relevant for GPIO settings and similar stuff.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoparse_dib0700.pl: improve parser
Mauro Carvalho Chehab [Tue, 24 Jun 2014 19:34:26 +0000 (16:34 -0300)]
parse_dib0700.pl: improve parser

When using ./parse_tcpdump_log.pl|parse_dib0700.pl, it were not
parsing properly.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoparse_dib0700.pl: parse the remaining messages on dib0700
Mauro Carvalho Chehab [Tue, 24 Jun 2014 17:28:10 +0000 (14:28 -0300)]
parse_dib0700.pl: parse the remaining messages on dib0700

Parse the remaining messages on dib0700, except for the newer
I2C read/write formats.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agocontrib: add a parser for dib0700
Mauro Carvalho Chehab [Tue, 24 Jun 2014 16:29:20 +0000 (13:29 -0300)]
contrib: add a parser for dib0700

Add an initial parser for dib0700. While here, change the file
permisions of contrib scripts to be executable.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years agoqv4l2: fix opengl support for RGB32/BGR32.
Hans Verkuil [Mon, 23 Jun 2014 14:14:54 +0000 (16:14 +0200)]
qv4l2: fix opengl support for RGB32/BGR32.

For whatever reason the GL_RGBA4 internal format was used instead of
GL_RGB8, so each color component was just 4 bits instead of 8.

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