From dc199241624a2fd85d9b0d8303babd60feadd0e6 Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Mon, 4 May 2015 07:51:05 -0300 Subject: [media] videodev2: Add V4L2_BUF_FLAG_LAST This v4l2_buffer flag can be used by drivers to mark a capture buffer as the last generated buffer, for example after a V4L2_DEC_CMD_STOP command was issued. Signed-off-by: Peter Seiderer Signed-off-by: Philipp Zabel Acked-by: Hans Verkuil Signed-off-by: Kamil Debski Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index fa376f7..0f5a467 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -810,6 +810,8 @@ struct v4l2_buffer { #define V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000 #define V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000 #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 +/* mem2mem encoder/decoder */ +#define V4L2_BUF_FLAG_LAST 0x00100000 /** * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor -- cgit v1.1 From 4c12adad26f059fa207d6b07aa61f39bc459211b Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 9 Apr 2015 16:36:49 -0300 Subject: [media] dvb: Document FE_SCALE_DECIBEL units consistently In comments and in the documentation, the units of properties marked with the FE_SCALE_DECIBEL scale are specified in terms of 1/1000 dB or 0.0001 dB. This is inconsistent, however, as 1/1000 is 0.001, not 0.0001. Note that the v4l-utils divide the value by 1000 for the signal strength suggesting that the 1/1000 is correct. Settle on millidecibels, ie. 1/1000dB or 0.001dB. Signed-off-by: David Howells Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c56d77c..466f569 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -467,7 +467,7 @@ struct dtv_cmds_h { * @FE_SCALE_NOT_AVAILABLE: That QoS measure is not available. That * could indicate a temporary or a permanent * condition. - * @FE_SCALE_DECIBEL: The scale is measured in 0.0001 dB steps, typically + * @FE_SCALE_DECIBEL: The scale is measured in 0.001 dB steps, typically * used on signal measures. * @FE_SCALE_RELATIVE: The scale is a relative percentual measure, * ranging from 0 (0%) to 0xffff (100%). @@ -516,7 +516,7 @@ struct dtv_stats { __u8 scale; /* enum fecap_scale_params type */ union { __u64 uvalue; /* for counters and relative scales */ - __s64 svalue; /* for 0.0001 dB measures */ + __s64 svalue; /* for 0.001 dB measures */ }; } __attribute__ ((packed)); -- cgit v1.1 From 97f411d9175f018503e67e7552f92bc28844001b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 26 May 2015 07:34:21 -0300 Subject: [media] dvb: split enum from typedefs at frontend.h Using typedefs is already bad enough, but doing it together with enum declaration is even worse. Also, it breaks the scripts at DocBook that would be generating reference pointers for the enums. Well, we can't get rid of typedef right now, but let's at least declare it on a separate line, and let the scripts to generate the cross-reference, as this is needed for the next DocBook patches. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 466f569..ae481bc 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -36,7 +36,7 @@ typedef enum fe_type { } fe_type_t; -typedef enum fe_caps { +enum fe_caps { FE_IS_STUPID = 0, FE_CAN_INVERSION_AUTO = 0x1, FE_CAN_FEC_1_2 = 0x2, @@ -68,7 +68,9 @@ typedef enum fe_caps { FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ -} fe_caps_t; +}; + +typedef enum fe_caps fe_caps_t; struct dvb_frontend_info { @@ -134,7 +136,7 @@ typedef enum fe_sec_mini_cmd { * to reset DiSEqC, tone and parameters */ -typedef enum fe_status { +enum fe_status { FE_HAS_SIGNAL = 0x01, FE_HAS_CARRIER = 0x02, FE_HAS_VITERBI = 0x04, @@ -142,7 +144,9 @@ typedef enum fe_status { FE_HAS_LOCK = 0x10, FE_TIMEDOUT = 0x20, FE_REINIT = 0x40, -} fe_status_t; +}; + +typedef enum fe_status fe_status_t; typedef enum fe_spectral_inversion { INVERSION_OFF, -- cgit v1.1 From d6b6d346e5605ee2af0f0349e71901121b984258 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 26 May 2015 19:33:58 -0300 Subject: [media] DocBook: better document FE_SET_VOLTAGE ioctl Use the proper format for FE_SET_VOLTAGE documentation and fix the documentation. The description for the enum is not 100%, and it is missing the voltage off value. Also, it is better to keep the enum description together with the ioctl, as both are used together. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index ae481bc..c1ccbc8 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -105,11 +105,13 @@ struct dvb_diseqc_slave_reply { }; /* errorcode when no message was received */ -typedef enum fe_sec_voltage { +enum fe_sec_voltage { SEC_VOLTAGE_13, SEC_VOLTAGE_18, SEC_VOLTAGE_OFF -} fe_sec_voltage_t; +}; + +typedef enum fe_sec_voltage fe_sec_voltage_t; typedef enum fe_sec_tone_mode { -- cgit v1.1 From 6dc59e7a195fc8852e98d64805f44c46c35e40cd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 27 May 2015 07:15:50 -0300 Subject: [media] DocBook: better document FE_SET_TONE ioctl Use the proper format for FE_SET_TONE documentation and improve the documentation. Keep the enum fe_sec_tone_mode description together with the ioctl, as both are used together. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c1ccbc8..1a09881 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -114,10 +114,12 @@ enum fe_sec_voltage { typedef enum fe_sec_voltage fe_sec_voltage_t; -typedef enum fe_sec_tone_mode { +enum fe_sec_tone_mode { SEC_TONE_ON, SEC_TONE_OFF -} fe_sec_tone_mode_t; +}; + +typedef enum fe_sec_tone_mode fe_sec_tone_mode_t; typedef enum fe_sec_mini_cmd { -- cgit v1.1 From 81959d996a3b6ea542ebffc7e394530f4638c6ca Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 27 May 2015 22:20:14 -0300 Subject: [media] DocBook: better document FE_DISEQC_SEND_BURST ioctl Use the proper format for FE_DISEQC_SEND_BURST documentation and improve the documentation. Keep the enum fe_sec_mini_cmd description together with the ioctl, as both are used together. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 1a09881..dd64e6d 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -122,10 +122,12 @@ enum fe_sec_tone_mode { typedef enum fe_sec_tone_mode fe_sec_tone_mode_t; -typedef enum fe_sec_mini_cmd { +enum fe_sec_mini_cmd { SEC_MINI_A, SEC_MINI_B -} fe_sec_mini_cmd_t; +}; + +typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t; /** -- cgit v1.1 From 997eb9039df27dfd5b1901e26ebae09d5dbe6cff Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 17:21:05 -0300 Subject: [media] DocBook: Better document enum fe_modulation Instead of using programlisting, use a table, as this provides a better view of the structure. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index dd64e6d..d4b1718 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -178,7 +178,7 @@ typedef enum fe_code_rate { } fe_code_rate_t; -typedef enum fe_modulation { +enum fe_modulation { QPSK, QAM_16, QAM_32, @@ -193,7 +193,9 @@ typedef enum fe_modulation { APSK_32, DQPSK, QAM_4_NR, -} fe_modulation_t; +}; + +typedef enum fe_modulation fe_modulation_t; typedef enum fe_transmit_mode { TRANSMISSION_MODE_2K, -- cgit v1.1 From 58e11cc3c1f7d7e9fa70ba6c3d363456151fcffd Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 20:00:43 -0300 Subject: [media] DocBook: improve documentation for DVB spectral inversion Format it as a table and provide more details. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index d4b1718..2239055 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -154,12 +154,13 @@ enum fe_status { typedef enum fe_status fe_status_t; -typedef enum fe_spectral_inversion { +enum fe_spectral_inversion { INVERSION_OFF, INVERSION_ON, INVERSION_AUTO -} fe_spectral_inversion_t; +}; +typedef enum fe_spectral_inversion fe_spectral_inversion_t; typedef enum fe_code_rate { FEC_NONE = 0, -- cgit v1.1 From 0577a2f6d84a08da96c908a885db16b4d3532dc4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 20:52:52 -0300 Subject: [media] DocBook: improve documentation for OFDM transmission mode Format it as a table and add more details, in special, for the DTMB modes. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 2239055..c42e6d8 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -198,7 +198,7 @@ enum fe_modulation { typedef enum fe_modulation fe_modulation_t; -typedef enum fe_transmit_mode { +enum fe_transmit_mode { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, @@ -208,7 +208,9 @@ typedef enum fe_transmit_mode { TRANSMISSION_MODE_32K, TRANSMISSION_MODE_C1, TRANSMISSION_MODE_C3780, -} fe_transmit_mode_t; +}; + +typedef enum fe_transmit_mode fe_transmit_mode_t; #if defined(__DVB_CORE__) || !defined (__KERNEL__) typedef enum fe_bandwidth { -- cgit v1.1 From b174fb71e82eef2355aabece4b50fe1540e67544 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 20:57:53 -0300 Subject: [media] DocBook: move fe_bandwidth to the frontend legacy section fe_bandwidth/fe_bandwidth_t is used only on DVBv3 API. So, move it to the frontend legacy xml, and convert it into a table. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c42e6d8..43e6faf 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -213,7 +213,7 @@ enum fe_transmit_mode { typedef enum fe_transmit_mode fe_transmit_mode_t; #if defined(__DVB_CORE__) || !defined (__KERNEL__) -typedef enum fe_bandwidth { +enum fe_bandwidth { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_6_MHZ, @@ -221,7 +221,9 @@ typedef enum fe_bandwidth { BANDWIDTH_5_MHZ, BANDWIDTH_10_MHZ, BANDWIDTH_1_712_MHZ, -} fe_bandwidth_t; +}; + +typedef enum fe_bandwidth fe_bandwidth_t; #endif typedef enum fe_guard_interval { -- cgit v1.1 From 2d457b8a9054b9c5b1fcfbc5702b7d0e9f6cda2b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 21:38:44 -0300 Subject: [media] DocBook: improve documentation for FEC fields Format it as a table and add more details. Also, remove the duplicated occurrences. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 43e6faf..49f6e98 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -162,7 +162,7 @@ enum fe_spectral_inversion { typedef enum fe_spectral_inversion fe_spectral_inversion_t; -typedef enum fe_code_rate { +enum fe_code_rate { FEC_NONE = 0, FEC_1_2, FEC_2_3, @@ -176,7 +176,9 @@ typedef enum fe_code_rate { FEC_3_5, FEC_9_10, FEC_2_5, -} fe_code_rate_t; +}; + +typedef enum fe_code_rate fe_code_rate_t; enum fe_modulation { -- cgit v1.1 From 903142e53c648ee61c00f5c3b420b16bc6336ad7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 22:01:41 -0300 Subject: [media] DocBook: improve documentation for guard interval Format it as a table and add more details, in special for DTMB guard intervals. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 49f6e98..1d2b7c6 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -228,7 +228,7 @@ enum fe_bandwidth { typedef enum fe_bandwidth fe_bandwidth_t; #endif -typedef enum fe_guard_interval { +enum fe_guard_interval { GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, @@ -240,8 +240,9 @@ typedef enum fe_guard_interval { GUARD_INTERVAL_PN420, GUARD_INTERVAL_PN595, GUARD_INTERVAL_PN945, -} fe_guard_interval_t; +}; +typedef enum fe_guard_interval fe_guard_interval_t; typedef enum fe_hierarchy { HIERARCHY_NONE, -- cgit v1.1 From 9df4fc5b8f34383d116a160809e782b4ca50a808 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 28 May 2015 22:06:56 -0300 Subject: [media] DocBook: improve documentation for hierarchy Format it as a table and links it with the legacy API xml. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 1d2b7c6..3a7ff90 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -244,13 +244,15 @@ enum fe_guard_interval { typedef enum fe_guard_interval fe_guard_interval_t; -typedef enum fe_hierarchy { +enum fe_hierarchy { HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_4, HIERARCHY_AUTO -} fe_hierarchy_t; +}; + +typedef enum fe_hierarchy fe_hierarchy_t; enum fe_interleaving { INTERLEAVING_NONE, -- cgit v1.1 From 2e5e435fb4fdcc64db49e903baddb1ea8827385e Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Date: Mon, 4 May 2015 05:07:30 -0300 Subject: [media] media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE 16 bit greyscale format, structured in Big Endian. Such a format can be converted into a PMN image just by adding a header. Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 0f5a467..bda496a 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -404,6 +404,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ +#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */ /* Grey bit-packed formats */ #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */ -- cgit v1.1 From e01dfc01914ab9a078ca8d08287c19c6663b5438 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 15 May 2015 09:29:05 -0300 Subject: [media] videodev2.h: add COLORSPACE_DEFAULT V4L2_COLORSPACE_DEFAULT is added so we have a specific define for the default case where applications do not set it but leave it to 0. In that case the driver will set the colorspace based on what it captures. This is already used, but we never had a define for the value 0. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index bda496a..c5e89ab 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -178,6 +178,12 @@ enum v4l2_memory { /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ enum v4l2_colorspace { + /* + * Default colorspace, i.e. let the driver figure it out. + * Can only be used with video capture. + */ + V4L2_COLORSPACE_DEFAULT = 0, + /* SMPTE 170M: used for broadcast NTSC/PAL SDTV */ V4L2_COLORSPACE_SMPTE170M = 1, -- cgit v1.1 From addad1050827136e4f8d22c5c81df42f88f44651 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 15 May 2015 09:29:07 -0300 Subject: [media] videodev2.h: add COLORSPACE_RAW V4L2_COLORSPACE_RAW is added for raw image formats where the picture is minimally processed and is in the internal colorspace of the sensor. This is typically used in digital cameras where the image processing is done later. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index c5e89ab..81045aa 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -226,6 +226,9 @@ enum v4l2_colorspace { /* BT.2020 colorspace, used for UHDTV. */ V4L2_COLORSPACE_BT2020 = 10, + + /* Raw colorspace: for RAW unprocessed images */ + V4L2_COLORSPACE_RAW = 11, }; enum v4l2_ycbcr_encoding { -- cgit v1.1 From 3818c4da43af9e67fed66174cc25f8fce4043d99 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 15 May 2015 09:29:09 -0300 Subject: [media] videodev2.h: add macros to map colorspace defaults The mapping of COLORSPACE_DEFAULT, YCBCR_ENC_DEFAULT or QUANTIZATION_DEFAULT to proper non-default values is fairly complex, and it is something that needs to be done both in the kernel and in userspace. So add macros that can do this conversion, making this available to both kernel and userspace. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 81045aa..003a912 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -231,6 +231,15 @@ enum v4l2_colorspace { V4L2_COLORSPACE_RAW = 11, }; +/* + * Determine how COLORSPACE_DEFAULT should map to a proper colorspace. + * This depends on whether this is a SDTV image (use SMPTE 170M), an + * HDTV image (use Rec. 709), or something else (use sRGB). + */ +#define V4L2_MAP_COLORSPACE_DEFAULT(is_sdtv, is_hdtv) \ + ((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : \ + ((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB)) + enum v4l2_ycbcr_encoding { /* * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the @@ -275,6 +284,16 @@ enum v4l2_ycbcr_encoding { V4L2_YCBCR_ENC_SMPTE240M = 8, }; +/* + * Determine how YCBCR_ENC_DEFAULT should map to a proper Y'CbCr encoding. + * This depends on the colorspace. + */ +#define V4L2_MAP_YCBCR_ENC_DEFAULT(colsp) \ + ((colsp) == V4L2_COLORSPACE_REC709 ? V4L2_YCBCR_ENC_709 : \ + ((colsp) == V4L2_COLORSPACE_BT2020 ? V4L2_YCBCR_ENC_BT2020 : \ + ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_YCBCR_ENC_SMPTE240M : \ + V4L2_YCBCR_ENC_601))) + enum v4l2_quantization { /* * The default for R'G'B' quantization is always full range, except @@ -287,6 +306,17 @@ enum v4l2_quantization { V4L2_QUANTIZATION_LIM_RANGE = 2, }; +/* + * Determine how QUANTIZATION_DEFAULT should map to a proper quantization. + * This depends on whether the image is RGB or not, the colorspace and the + * Y'CbCr encoding. + */ +#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \ + (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \ + (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \ + (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \ + V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) + enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, /* not initialized */ V4L2_PRIORITY_BACKGROUND = 1, -- cgit v1.1 From 74fdcb2ee1786a92584e89c91006e449813527ce Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 28 Apr 2015 08:49:09 -0300 Subject: [media] videodev2.h: add support for transfer functions In the past the transfer function was implied by the colorspace. However, it is an independent entity in its own right. Add support for explicitly choosing the transfer function. This change will allow us to represent linear RGB (as is used by openGL), and it will make it easier to work with decoded video material since most codecs store the transfer function as a separate property as well. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/v4l2-mediabus.h | 4 +++- include/uapi/linux/videodev2.h | 41 +++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h index 26db206..9cac632 100644 --- a/include/uapi/linux/v4l2-mediabus.h +++ b/include/uapi/linux/v4l2-mediabus.h @@ -24,6 +24,7 @@ * @colorspace: colorspace of the data (from enum v4l2_colorspace) * @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding) * @quantization: quantization of the data (from enum v4l2_quantization) + * @xfer_func: transfer function of the data (from enum v4l2_xfer_func) */ struct v4l2_mbus_framefmt { __u32 width; @@ -33,7 +34,8 @@ struct v4l2_mbus_framefmt { __u32 colorspace; __u16 ycbcr_enc; __u16 quantization; - __u32 reserved[6]; + __u16 xfer_func; + __u16 reserved[11]; }; #ifndef __KERNEL__ diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 003a912..3d5fc72 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -240,6 +240,42 @@ enum v4l2_colorspace { ((is_sdtv) ? V4L2_COLORSPACE_SMPTE170M : \ ((is_hdtv) ? V4L2_COLORSPACE_REC709 : V4L2_COLORSPACE_SRGB)) +enum v4l2_xfer_func { + /* + * Mapping of V4L2_XFER_FUNC_DEFAULT to actual transfer functions + * for the various colorspaces: + * + * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, + * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_REC709 and + * V4L2_COLORSPACE_BT2020: V4L2_XFER_FUNC_709 + * + * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB + * + * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB + * + * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M + * + * V4L2_COLORSPACE_RAW: V4L2_XFER_FUNC_NONE + */ + V4L2_XFER_FUNC_DEFAULT = 0, + V4L2_XFER_FUNC_709 = 1, + V4L2_XFER_FUNC_SRGB = 2, + V4L2_XFER_FUNC_ADOBERGB = 3, + V4L2_XFER_FUNC_SMPTE240M = 4, + V4L2_XFER_FUNC_NONE = 5, +}; + +/* + * Determine how XFER_FUNC_DEFAULT should map to a proper transfer function. + * This depends on the colorspace. + */ +#define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ + ((colsp) == V4L2_XFER_FUNC_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ + ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ + ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ + ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? \ + V4L2_XFER_FUNC_SRGB : V4L2_XFER_FUNC_709)))) + enum v4l2_ycbcr_encoding { /* * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the @@ -409,6 +445,7 @@ struct v4l2_pix_format { __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ __u32 ycbcr_enc; /* enum v4l2_ycbcr_encoding */ __u32 quantization; /* enum v4l2_quantization */ + __u32 xfer_func; /* enum v4l2_xfer_func */ }; /* Pixel format FOURCC depth Description */ @@ -1907,6 +1944,7 @@ struct v4l2_plane_pix_format { * @flags: format flags (V4L2_PIX_FMT_FLAG_*) * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding * @quantization: enum v4l2_quantization, colorspace quantization + * @xfer_func: enum v4l2_xfer_func, colorspace transfer function */ struct v4l2_pix_format_mplane { __u32 width; @@ -1920,7 +1958,8 @@ struct v4l2_pix_format_mplane { __u8 flags; __u8 ycbcr_enc; __u8 quantization; - __u8 reserved[8]; + __u8 xfer_func; + __u8 reserved[7]; } __attribute__ ((packed)); /** -- cgit v1.1 From 448bac10318977e2c41548d7e6a1d87f9d48784d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 11:18:16 -0300 Subject: [media] DocBook: document DVB-S2 pilot in a table Putting it into a table allows to comment each possible values, with makes more clear what field means. Also, it allows to do cross-references with the frontend.h. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 3a7ff90..bb222eb 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -399,11 +399,13 @@ struct dvb_frontend_event { #define DTV_MAX_COMMAND DTV_STAT_TOTAL_BLOCK_COUNT -typedef enum fe_pilot { +enum fe_pilot { PILOT_ON, PILOT_OFF, PILOT_AUTO, -} fe_pilot_t; +}; + +typedef enum fe_pilot fe_pilot_t; typedef enum fe_rolloff { ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ -- cgit v1.1 From b35f6ba97882ef4e00c1faae1d66232f7314fe91 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 11:59:27 -0300 Subject: [media] DocBook: better document the DVB-S2 rolloff factor Instead of using a program listing, use a table and make clearer what each define means. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index bb222eb..cdd9e2f 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -407,12 +407,14 @@ enum fe_pilot { typedef enum fe_pilot fe_pilot_t; -typedef enum fe_rolloff { +enum fe_rolloff { ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ ROLLOFF_20, ROLLOFF_25, ROLLOFF_AUTO, -} fe_rolloff_t; +}; + +typedef enum fe_rolloff fe_rolloff_t; typedef enum fe_delivery_system { SYS_UNDEFINED, -- cgit v1.1 From d21ddba826d8704525fa637e69cf90b8e034d94a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 14:21:09 -0300 Subject: [media] DocBook: properly document the delivery systems Use a table for the delivery systems. The table is organized by the type (cable, satellite, terrestrial) and shows what standards are not fully implemented. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index cdd9e2f..66499f2 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -416,7 +416,7 @@ enum fe_rolloff { typedef enum fe_rolloff fe_rolloff_t; -typedef enum fe_delivery_system { +enum fe_delivery_system { SYS_UNDEFINED, SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_B, @@ -436,7 +436,9 @@ typedef enum fe_delivery_system { SYS_DVBT2, SYS_TURBO, SYS_DVBC_ANNEX_C, -} fe_delivery_system_t; +}; + +typedef enum fe_delivery_system fe_delivery_system_t; /* backward compatibility */ #define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A -- cgit v1.1 From fe557e40f576741308d3546906eba7094e940de4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 14:31:13 -0300 Subject: [media] DocBook: add xrefs for enum fe_type The only enum that was missing xrefs at frontend.h is fe_type. Add xrefs for them. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 66499f2..a36d802 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -28,12 +28,14 @@ #include -typedef enum fe_type { +enum fe_type { FE_QPSK, FE_QAM, FE_OFDM, FE_ATSC -} fe_type_t; +}; + +typedef enum fe_type fe_type_t; enum fe_caps { -- cgit v1.1 From 0df289a209e02f0926042ab07d7d2595ea2d2e9b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 14:53:52 -0300 Subject: [media] dvb: Get rid of typedev usage for enums The DVB API was originally defined using typedefs. This is against Kernel CodingStyle, and there's no good usage here. While we can't remove its usage on userspace, we can avoid its usage in Kernelspace. So, let's do it. This patch was generated by this shell script: for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done While here, make CodingStyle fixes on the affected lines. Signed-off-by: Mauro Carvalho Chehab Acked-by: Stefan Richter # for drivers/media/firewire/* --- include/uapi/linux/dvb/frontend.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index a36d802..7f829c9 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -77,7 +77,7 @@ typedef enum fe_caps fe_caps_t; struct dvb_frontend_info { char name[128]; - fe_type_t type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ + enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ __u32 frequency_min; __u32 frequency_max; __u32 frequency_stepsize; @@ -86,7 +86,7 @@ struct dvb_frontend_info { __u32 symbol_rate_max; __u32 symbol_rate_tolerance; /* ppm */ __u32 notifier_delay; /* DEPRECATED */ - fe_caps_t caps; + enum fe_caps caps; }; -- cgit v1.1 From af6392dec9421ad9de973d1f0558813f52537eba Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 15:00:17 -0300 Subject: [media] frontend: Move legacy API enums/structs to the end In order to better organize the header file, move the legacy API (DVBv3) support to the end, just before the ioctl definitions. This way, we can use just one #if for all of them. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 116 +++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 7f829c9..75605a7 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -216,19 +216,6 @@ enum fe_transmit_mode { typedef enum fe_transmit_mode fe_transmit_mode_t; -#if defined(__DVB_CORE__) || !defined (__KERNEL__) -enum fe_bandwidth { - BANDWIDTH_8_MHZ, - BANDWIDTH_7_MHZ, - BANDWIDTH_6_MHZ, - BANDWIDTH_AUTO, - BANDWIDTH_5_MHZ, - BANDWIDTH_10_MHZ, - BANDWIDTH_1_712_MHZ, -}; - -typedef enum fe_bandwidth fe_bandwidth_t; -#endif enum fe_guard_interval { GUARD_INTERVAL_1_32, @@ -263,51 +250,6 @@ enum fe_interleaving { INTERLEAVING_720, }; -#if defined(__DVB_CORE__) || !defined (__KERNEL__) -struct dvb_qpsk_parameters { - __u32 symbol_rate; /* symbol rate in Symbols per second */ - fe_code_rate_t fec_inner; /* forward error correction (see above) */ -}; - -struct dvb_qam_parameters { - __u32 symbol_rate; /* symbol rate in Symbols per second */ - fe_code_rate_t fec_inner; /* forward error correction (see above) */ - fe_modulation_t modulation; /* modulation type (see above) */ -}; - -struct dvb_vsb_parameters { - fe_modulation_t modulation; /* modulation type (see above) */ -}; - -struct dvb_ofdm_parameters { - fe_bandwidth_t bandwidth; - fe_code_rate_t code_rate_HP; /* high priority stream code rate */ - fe_code_rate_t code_rate_LP; /* low priority stream code rate */ - fe_modulation_t constellation; /* modulation type (see above) */ - fe_transmit_mode_t transmission_mode; - fe_guard_interval_t guard_interval; - fe_hierarchy_t hierarchy_information; -}; - - -struct dvb_frontend_parameters { - __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ - /* intermediate frequency in kHz for QPSK */ - fe_spectral_inversion_t inversion; - union { - struct dvb_qpsk_parameters qpsk; - struct dvb_qam_parameters qam; - struct dvb_ofdm_parameters ofdm; - struct dvb_vsb_parameters vsb; - } u; -}; - -struct dvb_frontend_event { - fe_status_t status; - struct dvb_frontend_parameters parameters; -}; -#endif - /* S2API Commands */ #define DTV_UNDEFINED 0 #define DTV_TUNE 1 @@ -582,6 +524,64 @@ struct dtv_properties { struct dtv_property *props; }; +#if defined(__DVB_CORE__) || !defined (__KERNEL__) + +enum fe_bandwidth { + BANDWIDTH_8_MHZ, + BANDWIDTH_7_MHZ, + BANDWIDTH_6_MHZ, + BANDWIDTH_AUTO, + BANDWIDTH_5_MHZ, + BANDWIDTH_10_MHZ, + BANDWIDTH_1_712_MHZ, +}; + +typedef enum fe_bandwidth fe_bandwidth_t; + +struct dvb_qpsk_parameters { + __u32 symbol_rate; /* symbol rate in Symbols per second */ + fe_code_rate_t fec_inner; /* forward error correction (see above) */ +}; + +struct dvb_qam_parameters { + __u32 symbol_rate; /* symbol rate in Symbols per second */ + fe_code_rate_t fec_inner; /* forward error correction (see above) */ + fe_modulation_t modulation; /* modulation type (see above) */ +}; + +struct dvb_vsb_parameters { + fe_modulation_t modulation; /* modulation type (see above) */ +}; + +struct dvb_ofdm_parameters { + fe_bandwidth_t bandwidth; + fe_code_rate_t code_rate_HP; /* high priority stream code rate */ + fe_code_rate_t code_rate_LP; /* low priority stream code rate */ + fe_modulation_t constellation; /* modulation type (see above) */ + fe_transmit_mode_t transmission_mode; + fe_guard_interval_t guard_interval; + fe_hierarchy_t hierarchy_information; +}; + + +struct dvb_frontend_parameters { + __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ + /* intermediate frequency in kHz for QPSK */ + fe_spectral_inversion_t inversion; + union { + struct dvb_qpsk_parameters qpsk; + struct dvb_qam_parameters qam; + struct dvb_ofdm_parameters ofdm; + struct dvb_vsb_parameters vsb; + } u; +}; + +struct dvb_frontend_event { + fe_status_t status; + struct dvb_frontend_parameters parameters; +}; +#endif + #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) -- cgit v1.1 From b1e28ffaebb96feb2d3a07be9468a52d0782d427 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 15:01:15 -0300 Subject: [media] frontend: move legacy typedefs to the end Just userspace need those typedefs. So, put it in the compat part of the header. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 59 +++++++++++---------------------------- 1 file changed, 16 insertions(+), 43 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 75605a7..46c7fd1 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -35,9 +35,6 @@ enum fe_type { FE_ATSC }; -typedef enum fe_type fe_type_t; - - enum fe_caps { FE_IS_STUPID = 0, FE_CAN_INVERSION_AUTO = 0x1, @@ -72,9 +69,6 @@ enum fe_caps { FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ }; -typedef enum fe_caps fe_caps_t; - - struct dvb_frontend_info { char name[128]; enum fe_type type; /* DEPRECATED. Use DTV_ENUM_DELSYS instead */ @@ -99,39 +93,28 @@ struct dvb_diseqc_master_cmd { __u8 msg_len; /* valid values are 3...6 */ }; - struct dvb_diseqc_slave_reply { __u8 msg [4]; /* { framing, data [3] } */ __u8 msg_len; /* valid values are 0...4, 0 means no msg */ int timeout; /* return from ioctl after timeout ms with */ }; /* errorcode when no message was received */ - enum fe_sec_voltage { SEC_VOLTAGE_13, SEC_VOLTAGE_18, SEC_VOLTAGE_OFF }; -typedef enum fe_sec_voltage fe_sec_voltage_t; - - enum fe_sec_tone_mode { SEC_TONE_ON, SEC_TONE_OFF }; -typedef enum fe_sec_tone_mode fe_sec_tone_mode_t; - - enum fe_sec_mini_cmd { SEC_MINI_A, SEC_MINI_B }; -typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t; - - /** * enum fe_status - enumerates the possible frontend status * @FE_HAS_SIGNAL: found something above the noise level @@ -143,7 +126,6 @@ typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t; * @FE_REINIT: frontend was reinitialized, application is recommended * to reset DiSEqC, tone and parameters */ - enum fe_status { FE_HAS_SIGNAL = 0x01, FE_HAS_CARRIER = 0x02, @@ -154,16 +136,12 @@ enum fe_status { FE_REINIT = 0x40, }; -typedef enum fe_status fe_status_t; - enum fe_spectral_inversion { INVERSION_OFF, INVERSION_ON, INVERSION_AUTO }; -typedef enum fe_spectral_inversion fe_spectral_inversion_t; - enum fe_code_rate { FEC_NONE = 0, FEC_1_2, @@ -180,9 +158,6 @@ enum fe_code_rate { FEC_2_5, }; -typedef enum fe_code_rate fe_code_rate_t; - - enum fe_modulation { QPSK, QAM_16, @@ -200,8 +175,6 @@ enum fe_modulation { QAM_4_NR, }; -typedef enum fe_modulation fe_modulation_t; - enum fe_transmit_mode { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, @@ -214,9 +187,6 @@ enum fe_transmit_mode { TRANSMISSION_MODE_C3780, }; -typedef enum fe_transmit_mode fe_transmit_mode_t; - - enum fe_guard_interval { GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, @@ -231,8 +201,6 @@ enum fe_guard_interval { GUARD_INTERVAL_PN945, }; -typedef enum fe_guard_interval fe_guard_interval_t; - enum fe_hierarchy { HIERARCHY_NONE, HIERARCHY_1, @@ -241,8 +209,6 @@ enum fe_hierarchy { HIERARCHY_AUTO }; -typedef enum fe_hierarchy fe_hierarchy_t; - enum fe_interleaving { INTERLEAVING_NONE, INTERLEAVING_AUTO, @@ -349,8 +315,6 @@ enum fe_pilot { PILOT_AUTO, }; -typedef enum fe_pilot fe_pilot_t; - enum fe_rolloff { ROLLOFF_35, /* Implied value in DVB-S, default for DVB-S2 */ ROLLOFF_20, @@ -358,8 +322,6 @@ enum fe_rolloff { ROLLOFF_AUTO, }; -typedef enum fe_rolloff fe_rolloff_t; - enum fe_delivery_system { SYS_UNDEFINED, SYS_DVBC_ANNEX_A, @@ -382,8 +344,6 @@ enum fe_delivery_system { SYS_DVBC_ANNEX_C, }; -typedef enum fe_delivery_system fe_delivery_system_t; - /* backward compatibility */ #define SYS_DVBC_ANNEX_AC SYS_DVBC_ANNEX_A #define SYS_DMBTH SYS_DTMB /* DMB-TH is legacy name, use DTMB instead */ @@ -536,7 +496,23 @@ enum fe_bandwidth { BANDWIDTH_1_712_MHZ, }; +/* This is needed for legacy userspace support */ +typedef enum fe_sec_voltage fe_sec_voltage_t; +typedef enum fe_caps fe_caps_t; +typedef enum fe_type fe_type_t; +typedef enum fe_sec_tone_mode fe_sec_tone_mode_t; +typedef enum fe_sec_mini_cmd fe_sec_mini_cmd_t; +typedef enum fe_status fe_status_t; +typedef enum fe_spectral_inversion fe_spectral_inversion_t; +typedef enum fe_code_rate fe_code_rate_t; +typedef enum fe_modulation fe_modulation_t; +typedef enum fe_transmit_mode fe_transmit_mode_t; typedef enum fe_bandwidth fe_bandwidth_t; +typedef enum fe_guard_interval fe_guard_interval_t; +typedef enum fe_hierarchy fe_hierarchy_t; +typedef enum fe_pilot fe_pilot_t; +typedef enum fe_rolloff fe_rolloff_t; +typedef enum fe_delivery_system fe_delivery_system_t; struct dvb_qpsk_parameters { __u32 symbol_rate; /* symbol rate in Symbols per second */ @@ -563,7 +539,6 @@ struct dvb_ofdm_parameters { fe_hierarchy_t hierarchy_information; }; - struct dvb_frontend_parameters { __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ /* intermediate frequency in kHz for QPSK */ @@ -585,7 +560,6 @@ struct dvb_frontend_event { #define FE_SET_PROPERTY _IOW('o', 82, struct dtv_properties) #define FE_GET_PROPERTY _IOR('o', 83, struct dtv_properties) - /** * When set, this flag will disable any zigzagging or other "normal" tuning * behaviour. Additionally, there will be no automatic monitoring of the lock @@ -595,7 +569,6 @@ struct dvb_frontend_event { */ #define FE_TUNE_MODE_ONESHOT 0x01 - #define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info) #define FE_DISEQC_RESET_OVERLOAD _IO('o', 62) -- cgit v1.1 From 76add03db97c11142e30d1e63c6f19e179b8b6c6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 16:28:33 -0300 Subject: [media] frontend: Fix a typo at the comments The description of struct dtv_stats has a spmall typo: FE_SCALE_DECIBELS instead of FE_SCALE_DECIBEL Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 46c7fd1..0380e62 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -435,13 +435,13 @@ enum fecap_scale_params { * * In other words, for ISDB, those values should be filled like: * u.st.stat.svalue[0] = global statistics; - * u.st.stat.scale[0] = FE_SCALE_DECIBELS; + * u.st.stat.scale[0] = FE_SCALE_DECIBEL; * u.st.stat.value[1] = layer A statistics; * u.st.stat.scale[1] = FE_SCALE_NOT_AVAILABLE (if not available); * u.st.stat.svalue[2] = layer B statistics; - * u.st.stat.scale[2] = FE_SCALE_DECIBELS; + * u.st.stat.scale[2] = FE_SCALE_DECIBEL; * u.st.stat.svalue[3] = layer C statistics; - * u.st.stat.scale[3] = FE_SCALE_DECIBELS; + * u.st.stat.scale[3] = FE_SCALE_DECIBEL; * u.st.len = 4; */ struct dtv_stats { -- cgit v1.1 From 81a7c6d9bb14956d9feb619ae724aaa90ea55288 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 16:33:30 -0300 Subject: [media] dvb: frontend.h: improve dvb_frontent_parameters comment The comment for struct dvb_frontend_parameters is weird, as it mixes delivery system name (ATSC) with modulation names (QPSK, QAM, OFDM). Use delivery system names there on the frequency comment, as this is clearer, specially after 2GEN delivery systems. While here, add comments at the union, to make live easier for ones that may try to understand the convention used by the legacy API. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index 0380e62..e764fd8 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -540,14 +540,14 @@ struct dvb_ofdm_parameters { }; struct dvb_frontend_parameters { - __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ - /* intermediate frequency in kHz for QPSK */ + __u32 frequency; /* (absolute) frequency in Hz for DVB-C/DVB-T/ATSC */ + /* intermediate frequency in kHz for DVB-S */ fe_spectral_inversion_t inversion; union { - struct dvb_qpsk_parameters qpsk; - struct dvb_qam_parameters qam; - struct dvb_ofdm_parameters ofdm; - struct dvb_vsb_parameters vsb; + struct dvb_qpsk_parameters qpsk; /* DVB-S */ + struct dvb_qam_parameters qam; /* DVB-C */ + struct dvb_ofdm_parameters ofdm; /* DVB-T */ + struct dvb_vsb_parameters vsb; /* ATSC */ } u; }; -- cgit v1.1 From 486ef85e93a4829e8f49d3bfe3ee3a29379868d3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 16:44:21 -0300 Subject: [media] dvb: frontend.h: add a note for the deprecated enums/structs Let be clear, at the header, about what got deprecated. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/frontend.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index e764fd8..00a20cd 100644 --- a/include/uapi/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h @@ -486,6 +486,12 @@ struct dtv_properties { #if defined(__DVB_CORE__) || !defined (__KERNEL__) +/* + * DEPRECATED: The DVBv3 ioctls, structs and enums should not be used on + * newer programs, as it doesn't support the second generation of digital + * TV standards, nor supports newer delivery systems. + */ + enum fe_bandwidth { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, -- cgit v1.1 From 6c72edab024757267f43de337f093203efea714b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 19:34:50 -0300 Subject: [media] dvb: dmx.h: don't use anonymous enums There are several anonymous enums here, used via a typedef. Well, we don't like typedefs on Kernel, so let's de-anonimize those enums. Then, latter, we may be able to get rid of the typedefs, at least from Kernelspace. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/dmx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h index b4fb650..ece3661 100644 --- a/include/uapi/linux/dvb/dmx.h +++ b/include/uapi/linux/dvb/dmx.h @@ -32,7 +32,7 @@ #define DMX_FILTER_SIZE 16 -typedef enum +typedef enum dmx_output { DMX_OUT_DECODER, /* Streaming directly to decoder. */ DMX_OUT_TAP, /* Output going to a memory buffer */ @@ -44,7 +44,7 @@ typedef enum } dmx_output_t; -typedef enum +typedef enum dmx_input { DMX_IN_FRONTEND, /* Input from a front-end device. */ DMX_IN_DVR /* Input from the logical DVR device. */ @@ -122,7 +122,7 @@ typedef struct dmx_caps { int num_decoders; } dmx_caps_t; -typedef enum { +typedef enum dmx_source { DMX_SOURCE_FRONT0 = 0, DMX_SOURCE_FRONT1, DMX_SOURCE_FRONT2, -- cgit v1.1 From 6eab8043f9b91a998dc06ce0b770b9664e51bfc3 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 19:29:43 -0300 Subject: [media] DocBook: Change format for enum dmx_output documentation Use a table for the Demux output. No new information added here. They were all merged inside the table. Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/dvb/dmx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h index ece3661..427e489 100644 --- a/include/uapi/linux/dvb/dmx.h +++ b/include/uapi/linux/dvb/dmx.h @@ -32,7 +32,7 @@ #define DMX_FILTER_SIZE 16 -typedef enum dmx_output +enum dmx_output { DMX_OUT_DECODER, /* Streaming directly to decoder. */ DMX_OUT_TAP, /* Output going to a memory buffer */ @@ -41,8 +41,9 @@ typedef enum dmx_output /* (to be retrieved by reading from the */ /* logical DVR device). */ DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ -} dmx_output_t; +}; +typedef enum dmx_output dmx_output_t; typedef enum dmx_input { @@ -139,7 +140,6 @@ struct dmx_stc { __u64 stc; /* output: stc in 'base'*90 kHz units */ }; - #define DMX_START _IO('o', 41) #define DMX_STOP _IO('o', 42) #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) -- cgit v1.1 From f8d5556fa9dbf6b88e1a8fe88e47ad1b8ddb4742 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 15 Jun 2015 10:52:40 -0300 Subject: [media] videodev2.h: fix copy-and-paste error in V4L2_MAP_XFER_FUNC_DEFAULT The colorspace argument was compared against a V4L2_XFER_FUNC define instead of against a V4L2_COLORSPACE define, returning the wrong answer. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/uapi/linux/videodev2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/uapi/linux') diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 3d5fc72..3228fbe 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -270,7 +270,7 @@ enum v4l2_xfer_func { * This depends on the colorspace. */ #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ - ((colsp) == V4L2_XFER_FUNC_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ + ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ ((colsp) == V4L2_COLORSPACE_SRGB || (colsp) == V4L2_COLORSPACE_JPEG ? \ -- cgit v1.1