dvb-v5-std.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. /*
  2. * Copyright (c) 2011-2014 - Mauro Carvalho Chehab
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation version 2
  7. * of the License.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  18. *
  19. * Per-delivery system properties defined at libdvbv5 scope, following
  20. * the same model as defined at the Linux DVB media specs:
  21. * http://linuxtv.org/downloads/v4l-dvb-apis/FE_GET_SET_PROPERTY.html
  22. */
  23. #ifndef _DVB_V5_STD_H
  24. #define _DVB_V5_STD_H
  25. #include <stddef.h>
  26. #include "dvb-frontend.h"
  27. /**
  28. * @file dvb-v5-std.h
  29. * @ingroup frontend
  30. * @brief Provides libdvbv5 defined properties for the frontend.
  31. * @copyright GNU General Public License version 2 (GPLv2)
  32. * @author Mauro Carvalho Chehab
  33. *
  34. * @par Bug Report
  35. * Please submit bug reports and patches to linux-media@vger.kernel.org
  36. */
  37. /*
  38. * User DTV codes, for internal usage. There are two sets of
  39. * properties. One for DTV properties and another one for statistics
  40. */
  41. /*
  42. * First set: DTV properties that don't belong to Kernelspace
  43. *
  44. * Those properties contain data that comes from the MPEG-TS
  45. * tables, like audio/video/other PIDs, and satellite config
  46. */
  47. /**
  48. * @def DTV_USER_COMMAND_START
  49. * @brief Start number for libdvbv5 user commands
  50. * @ingroup frontend
  51. * @def DTV_POLARIZATION
  52. * @brief Satellite polarization (for Satellite delivery systems)
  53. * @ingroup frontend
  54. * @def DTV_AUDIO_PID
  55. * @brief Audio PID
  56. * @ingroup frontend
  57. * @def DTV_VIDEO_PID
  58. * @brief Video PID
  59. * @ingroup frontend
  60. * @def DTV_SERVICE_ID
  61. * @brief MPEG TS service ID
  62. * @ingroup frontend
  63. * @def DTV_CH_NAME
  64. * @brief Digital TV service name
  65. * @ingroup frontend
  66. * @def DTV_VCHANNEL
  67. * @brief Digital TV channel number. May contain symbols
  68. * @ingroup frontend
  69. * @def DTV_SAT_NUMBER
  70. * @brief Number of the satellite (used on multi-dish Satellite systems)
  71. * @ingroup frontend
  72. * @def DTV_DISEQC_WAIT
  73. * @brief Extra time needed to wait for DiSeqC to complete, in ms.
  74. * The minimal wait time is 15 ms. The time here will be
  75. * added to the minimal time.
  76. * @ingroup frontend
  77. * @def DTV_DISEQC_LNB
  78. * @brief LNBf name
  79. * @ingroup frontend
  80. * @def DTV_FREQ_BPF
  81. * @brief SCR/Unicable band-pass filter frequency in kHz
  82. * @ingroup frontend
  83. * @def DTV_PLS_CODE
  84. * @brief DVB-T2 PLS code. Not used internally. It is needed
  85. * only for file conversion.
  86. * @ingroup frontend
  87. * @def DTV_PLS_MODE
  88. * @brief DVB-T2 PLS mode. Not used internally. It is needed
  89. * only for file conversion.
  90. * @ingroup frontend
  91. * @def DTV_COUNTRY_CODE
  92. * @brief Country variant of international delivery system standard.
  93. in ISO 3166-1 two letter code.
  94. * @ingroup frontend
  95. * @def DTV_MAX_USER_COMMAND
  96. * @brief Last user command
  97. * @ingroup frontend
  98. * @def DTV_USER_NAME_SIZE
  99. * @brief Number of user commands
  100. * @ingroup frontend
  101. */
  102. #define DTV_USER_COMMAND_START 256
  103. #define DTV_POLARIZATION (DTV_USER_COMMAND_START + 0)
  104. #define DTV_VIDEO_PID (DTV_USER_COMMAND_START + 1)
  105. #define DTV_AUDIO_PID (DTV_USER_COMMAND_START + 2)
  106. #define DTV_SERVICE_ID (DTV_USER_COMMAND_START + 3)
  107. #define DTV_CH_NAME (DTV_USER_COMMAND_START + 4)
  108. #define DTV_VCHANNEL (DTV_USER_COMMAND_START + 5)
  109. #define DTV_SAT_NUMBER (DTV_USER_COMMAND_START + 6)
  110. #define DTV_DISEQC_WAIT (DTV_USER_COMMAND_START + 7)
  111. #define DTV_DISEQC_LNB (DTV_USER_COMMAND_START + 8)
  112. #define DTV_FREQ_BPF (DTV_USER_COMMAND_START + 9)
  113. #define DTV_PLS_CODE (DTV_USER_COMMAND_START + 10)
  114. #define DTV_PLS_MODE (DTV_USER_COMMAND_START + 11)
  115. #define DTV_COUNTRY_CODE (DTV_USER_COMMAND_START + 12)
  116. #define DTV_MAX_USER_COMMAND DTV_COUNTRY_CODE
  117. #define DTV_USER_NAME_SIZE (1 + DTV_MAX_USER_COMMAND - DTV_USER_COMMAND_START)
  118. /**
  119. * @enum dvb_sat_polarization
  120. * @brief Polarization types for Satellite systems
  121. * @ingroup satellite
  122. *
  123. * @param POLARIZATION_OFF Polarization disabled/unused.
  124. * @param POLARIZATION_H Horizontal polarization
  125. * @param POLARIZATION_V Vertical polarization
  126. * @param POLARIZATION_L Left circular polarization (C-band)
  127. * @param POLARIZATION_R Right circular polarization (C-band)
  128. */
  129. enum dvb_sat_polarization {
  130. POLARIZATION_OFF = 0,
  131. POLARIZATION_H = 1,
  132. POLARIZATION_V = 2,
  133. POLARIZATION_L = 3,
  134. POLARIZATION_R = 4,
  135. };
  136. /*
  137. * Second set: DTV statistics
  138. *
  139. * Those properties contain statistics measurements that aren't
  140. * either provided by the Kernel via property cmd/value pair,
  141. * like status (with has its own ioctl), or that are derivated
  142. * measures from two or more Kernel reported stats.
  143. */
  144. /**
  145. * @def DTV_STAT_COMMAND_START
  146. * @brief Start number for libdvbv5 statistics commands
  147. * @ingroup frontend
  148. * @def DTV_STATUS
  149. * @brief Lock status of a DTV frontend. This actually comes from
  150. * the Kernel, but it uses a separate ioctl.
  151. * @ingroup frontend
  152. * @def DTV_BER
  153. * @brief Bit Error Rate. This is a parameter that it is
  154. * derivated from two counters at the Kernel side
  155. * @ingroup frontend
  156. * @def DTV_PER
  157. * @brief Packet Error Rate. This is a parameter that it is
  158. * derivated from two counters at the Kernel side
  159. * @ingroup frontend
  160. * @def DTV_QUALITY
  161. * @brief A quality indicator that represents if a locked
  162. * channel provides a good, OK or poor signal. This is
  163. * estimated considering the error rates, signal strengh
  164. * and/or S/N ratio of the carrier.
  165. * @ingroup frontend
  166. * @def DTV_PRE_BER
  167. * @brief Bit Error Rate before Viterbi. This is the error rate
  168. * before applying the Forward Error Correction. This is
  169. * a parameter that it is derivated from two counters
  170. * at the Kernel side.
  171. * @ingroup frontend
  172. * @def DTV_MAX_STAT_COMMAND
  173. * @brief Last statistics command
  174. * @ingroup frontend
  175. * @def DTV_STAT_NAME_SIZE
  176. * @brief Number of statistics commands
  177. * @ingroup frontend
  178. * @def DTV_NUM_KERNEL_STATS
  179. * @brief Number of statistics commands provided by the Kernel
  180. * @ingroup frontend
  181. * @def DTV_NUM_STATS_PROPS
  182. * @brief Total number of statistics commands
  183. * @ingroup frontend
  184. */
  185. #define DTV_STAT_COMMAND_START 512
  186. #define DTV_STATUS (DTV_STAT_COMMAND_START + 0)
  187. #define DTV_BER (DTV_STAT_COMMAND_START + 1)
  188. #define DTV_PER (DTV_STAT_COMMAND_START + 2)
  189. #define DTV_QUALITY (DTV_STAT_COMMAND_START + 3)
  190. #define DTV_PRE_BER (DTV_STAT_COMMAND_START + 4)
  191. #define DTV_MAX_STAT_COMMAND DTV_PRE_BER
  192. #define DTV_STAT_NAME_SIZE (1 + DTV_MAX_STAT_COMMAND - DTV_STAT_COMMAND_START)
  193. /* There are currently 8 stats provided on Kernelspace */
  194. #define DTV_NUM_KERNEL_STATS 8
  195. #define DTV_NUM_STATS_PROPS (DTV_NUM_KERNEL_STATS + DTV_STAT_NAME_SIZE)
  196. /**
  197. * @enum dvb_quality
  198. * @brief Provides an estimation about the user's experience
  199. * while watching to a given MPEG stream
  200. * @ingroup frontend
  201. *
  202. * @param DVB_QUAL_UNKNOWN Quality could not be estimated, as the Kernel driver
  203. * doesn't provide enough statistics
  204. *
  205. * @param DVB_QUAL_POOR The signal reception is poor. Signal loss or packets
  206. * can be lost too frequently.
  207. * @param DVB_QUAL_OK The signal reception is ok. Eventual artifacts could
  208. * be expected, but it should work.
  209. * @param DVB_QUAL_GOOD The signal is good, and not many errors are happening.
  210. * The user should have a good experience watching the
  211. * stream.
  212. */
  213. enum dvb_quality {
  214. DVB_QUAL_UNKNOWN = 0,
  215. DVB_QUAL_POOR,
  216. DVB_QUAL_OK,
  217. DVB_QUAL_GOOD,
  218. };
  219. #ifndef _DOXYGEN
  220. /*
  221. * Some tables to translate from value to string
  222. *
  223. * These tables are raw ways to translate from some DTV values into strings.
  224. * Please use the API-provided function dvb_cmd_name() and dvb_dvb_attr_names(),
  225. * instead of using the tables directly.
  226. */
  227. extern const unsigned int sys_dvbt_props[];
  228. extern const unsigned int sys_dvbt2_props[];
  229. extern const unsigned int sys_isdbt_props[];
  230. extern const unsigned int sys_atsc_props[];
  231. extern const unsigned int sys_atscmh_props[];
  232. extern const unsigned int sys_dvbc_annex_ac_props[];
  233. extern const unsigned int sys_dvbc_annex_b_props[];
  234. extern const unsigned int sys_dvbs_props[];
  235. extern const unsigned int sys_dvbs2_props[];
  236. extern const unsigned int sys_turbo_props[];
  237. extern const unsigned int sys_isdbs_props[];
  238. extern const unsigned int *dvb_v5_delivery_system[];
  239. extern const char *dvb_sat_pol_name[6];
  240. extern const char *dvb_user_name[DTV_USER_NAME_SIZE + 1];
  241. extern const char *dvb_stat_name[DTV_STAT_NAME_SIZE + 1];
  242. extern const void *dvb_user_attr_names[];
  243. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  244. #endif