dmx.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * dmx.h
  3. *
  4. * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
  5. * & Ralph Metzler <ralph@convergence.de>
  6. * for convergence integrated media GmbH
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public License
  10. * as published by the Free Software Foundation; either version 2.1
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. *
  22. */
  23. #ifndef _DVBDMX_H_
  24. #define _DVBDMX_H_
  25. #include <linux/types.h>
  26. #include <time.h>
  27. #define DMX_FILTER_SIZE 16
  28. enum dmx_output
  29. {
  30. DMX_OUT_DECODER, /* Streaming directly to decoder. */
  31. DMX_OUT_TAP, /* Output going to a memory buffer */
  32. /* (to be retrieved via the read command).*/
  33. DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */
  34. /* (to be retrieved by reading from the */
  35. /* logical DVR device). */
  36. DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
  37. };
  38. typedef enum dmx_output dmx_output_t;
  39. typedef enum dmx_input
  40. {
  41. DMX_IN_FRONTEND, /* Input from a front-end device. */
  42. DMX_IN_DVR /* Input from the logical DVR device. */
  43. } dmx_input_t;
  44. typedef enum dmx_ts_pes
  45. {
  46. DMX_PES_AUDIO0,
  47. DMX_PES_VIDEO0,
  48. DMX_PES_TELETEXT0,
  49. DMX_PES_SUBTITLE0,
  50. DMX_PES_PCR0,
  51. DMX_PES_AUDIO1,
  52. DMX_PES_VIDEO1,
  53. DMX_PES_TELETEXT1,
  54. DMX_PES_SUBTITLE1,
  55. DMX_PES_PCR1,
  56. DMX_PES_AUDIO2,
  57. DMX_PES_VIDEO2,
  58. DMX_PES_TELETEXT2,
  59. DMX_PES_SUBTITLE2,
  60. DMX_PES_PCR2,
  61. DMX_PES_AUDIO3,
  62. DMX_PES_VIDEO3,
  63. DMX_PES_TELETEXT3,
  64. DMX_PES_SUBTITLE3,
  65. DMX_PES_PCR3,
  66. DMX_PES_OTHER
  67. } dmx_pes_type_t;
  68. #define DMX_PES_AUDIO DMX_PES_AUDIO0
  69. #define DMX_PES_VIDEO DMX_PES_VIDEO0
  70. #define DMX_PES_TELETEXT DMX_PES_TELETEXT0
  71. #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
  72. #define DMX_PES_PCR DMX_PES_PCR0
  73. typedef struct dmx_filter
  74. {
  75. __u8 filter[DMX_FILTER_SIZE];
  76. __u8 mask[DMX_FILTER_SIZE];
  77. __u8 mode[DMX_FILTER_SIZE];
  78. } dmx_filter_t;
  79. struct dmx_sct_filter_params
  80. {
  81. __u16 pid;
  82. dmx_filter_t filter;
  83. __u32 timeout;
  84. __u32 flags;
  85. #define DMX_CHECK_CRC 1
  86. #define DMX_ONESHOT 2
  87. #define DMX_IMMEDIATE_START 4
  88. #define DMX_KERNEL_CLIENT 0x8000
  89. };
  90. struct dmx_pes_filter_params
  91. {
  92. __u16 pid;
  93. dmx_input_t input;
  94. dmx_output_t output;
  95. dmx_pes_type_t pes_type;
  96. __u32 flags;
  97. };
  98. typedef struct dmx_caps {
  99. __u32 caps;
  100. int num_decoders;
  101. } dmx_caps_t;
  102. typedef enum dmx_source {
  103. DMX_SOURCE_FRONT0 = 0,
  104. DMX_SOURCE_FRONT1,
  105. DMX_SOURCE_FRONT2,
  106. DMX_SOURCE_FRONT3,
  107. DMX_SOURCE_DVR0 = 16,
  108. DMX_SOURCE_DVR1,
  109. DMX_SOURCE_DVR2,
  110. DMX_SOURCE_DVR3
  111. } dmx_source_t;
  112. struct dmx_stc {
  113. unsigned int num; /* input : which STC? 0..N */
  114. unsigned int base; /* output: divisor for stc to get 90 kHz clock */
  115. __u64 stc; /* output: stc in 'base'*90 kHz units */
  116. };
  117. #define DMX_START _IO('o', 41)
  118. #define DMX_STOP _IO('o', 42)
  119. #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
  120. #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
  121. #define DMX_SET_BUFFER_SIZE _IO('o', 45)
  122. #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
  123. #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
  124. #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
  125. #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
  126. #define DMX_ADD_PID _IOW('o', 51, __u16)
  127. #define DMX_REMOVE_PID _IOW('o', 52, __u16)
  128. #endif /* _DVBDMX_H_ */