qv4l2/v4l2-ctl: fix buffer overrun in vivid-tpg.

The test pattern generator allocated only half the size for
random_line that it really needed, causing the tpg to write
right passed the end of the buffer.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 1f7dfb79bdf6ebad19f2acaabb982e2f5aaade89)
qv4l2: Fix out-of-source build

Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 56676348e48648146250aaf2770b2f8a6bd796cd)
libdvbv5: properly represent Satellite frequencies

Satellite frequencies are stored in kHz instead of Hz.

[mchehab@osg.samsung.com: Got just one hunk from Akihiro's patch,
 as his patch got a merge conflict. The rest of his patch were
 actually trying to fix a memory leak bug that were supposed to be
 already fixed]

Reported-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit d1792f71800d60c3b1ab3030062eaa3583dcc77f)
v4l2-compliance: Explicitely link against rt library

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
(cherry picked from commit 3dcb945bfcab4e58f1bf5d34365b1a830d916924)
v4l2-ctl: Explicitely link against rt library

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
(cherry picked from commit e81fe13e8c22a2ca2dec345d048fceca0c497733)
README: better document the package

The README file got a little bit outdated as time goes by.
Update it to reflect the current status of this tree.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit db6a15ad3bc302a886801c73a94f60a628eeb4af)
ir-keytable: fix a regression introduced by fe2aa5f767eba

Changeset fe2aa5f767eba introduced a regression on RC6 based
tables: they now announce the protocol as RC6_MCE. This causes
failure when loading those two tables.

Reported-by: Stephan Raue <mailinglists@openelec.tv>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 2d374130360c9efeb5244490076de81a97031197)
rc: Update the protocol name at RC6 tables

The name of the protocol is RC6, and not RC6_MCE. Rename it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit fb827027d5acc5ad814ef2de55ea6aaabdb753ed)
rc_keymaps: allwinner: S/KEY_HOME/KEY_HOMEPAGE/

Correct the mapping for the key with the little house icon on it, as the
house icon surely does not stand for goto beginning of line, which KEY_HOME
is.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 108139f1892ba3d50f78419ae75e03944a7e6dd0)
v4lconvert: Fix decoding of jpeg data with no vertical sub-sampling

Our YUV output is always 2x subsampled in both vertical and horizontal
direction, but some cameras generate JPEG data which is only subsampled in
the horizontal direction.

Since averaging the extra UV data these JPEGs contains is seomwhat slow,
and UV data is not all that important anyways, we simple take every other
line. Or at least that is the intent.

But before this commit the code was not doing this properly, for each 16
Y input lines 1 - 16 we also get 16 UV input lines 1 - 16, but we only need
8 output lines. so we should store input line 1 or 2 in output line 1, input
line 3 or 4 in output line 2, etc. Instead we were storing input lines
9 - 16 into output lines 1 - 8, which leads to some unwanted color bleeding.

More over this also leads for 1920x1080 JPEG to us writing (1080 / 8 + 1) / 2
* 8 = 544 UV output lines rather then 540, this means that the last 4 U output
lines overwrite the first 4 V output lines, and worse that the last 4 V output
lines overrun the output buffer.

So far this only lead to some wrong colors in various places, but since that
we dynamically allocate the output buffer to just the right size this actually
causes a crash.

This commit fixes both the crash, and the wrong colors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 757d7910ddf43d9a9187dddae4f51a57fb723e8d)
Prepare for 1.6.1 release
v4l2-ctl: fix sliced vbi mode parsing

--set-fmt-sliced-vbi=cc didn't work, you had to do --set-fmt-sliced-vbi=cc=1.
This has now been fixed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 6cc971e98bc4aa5444db301781e0d72bde07b27d)
v4l2-compliance: when streaming used at least 2 buffers.

While streaming with 1 buffer is possible with some drivers (uvc), this
will lead to dropped frames. So ask at least two buffers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 533212be053c9f08e168d9c7eb94a522b3266871)
v4l2-compliance: add initial checks for VIDIOC_QUERY_EXT_CTRL

These initial compliance checks do not yet check compound control
support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 769b87bef8b9bfd96a8e1e984569cb7d502f88ca)
v4l2-ctl: add support for U32 control type.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 62fa03e21a73d64e364071085727034cbf182bf9)
v4l2-ctl: fix array handling

Both printing and setting of array controls was wrong. Handling subsets was
also completely broken since it used the wrong key in the subset map.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
(cherry picked from commit 1b0fc6cb7256f44f73e6f2db4a82707bcc13e7fe)
Prepare for 1.6.2 release
Synchronize with the Kernel

Add dvbsky table, update the location of the media-buf format
and syncronize some other changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 4eca43a0f76ebecf1923bd64e06562a4d4f911b7)
vivid-tpg.h.patch: update to match current upstream tree

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 1e94b3b009de2aec630825d4cb4342241acb6033)
sync-with-kernel: add include/linux/media.h

Without this, build breaks when compiling a package for RHEL6,
with uses an older media stack.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit 68d7abc1da327e1f6dae84949ffeda18cdd5e3ed)