dmx.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 <asm/types.h>
  26. #ifdef __KERNEL__
  27. #include <linux/time.h>
  28. #else
  29. #include <time.h>
  30. #endif
  31. #define DMX_FILTER_SIZE 16
  32. typedef enum
  33. {
  34. DMX_OUT_DECODER, /* Streaming directly to decoder. */
  35. DMX_OUT_TAP, /* Output going to a memory buffer */
  36. /* (to be retrieved via the read command).*/
  37. DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
  38. /* (to be retrieved by reading from the */
  39. /* logical DVR device). */
  40. } dmx_output_t;
  41. typedef enum
  42. {
  43. DMX_IN_FRONTEND, /* Input from a front-end device. */
  44. DMX_IN_DVR /* Input from the logical DVR device. */
  45. } dmx_input_t;
  46. typedef enum
  47. {
  48. DMX_PES_AUDIO0,
  49. DMX_PES_VIDEO0,
  50. DMX_PES_TELETEXT0,
  51. DMX_PES_SUBTITLE0,
  52. DMX_PES_PCR0,
  53. DMX_PES_AUDIO1,
  54. DMX_PES_VIDEO1,
  55. DMX_PES_TELETEXT1,
  56. DMX_PES_SUBTITLE1,
  57. DMX_PES_PCR1,
  58. DMX_PES_AUDIO2,
  59. DMX_PES_VIDEO2,
  60. DMX_PES_TELETEXT2,
  61. DMX_PES_SUBTITLE2,
  62. DMX_PES_PCR2,
  63. DMX_PES_AUDIO3,
  64. DMX_PES_VIDEO3,
  65. DMX_PES_TELETEXT3,
  66. DMX_PES_SUBTITLE3,
  67. DMX_PES_PCR3,
  68. DMX_PES_OTHER
  69. } dmx_pes_type_t;
  70. #define DMX_PES_AUDIO DMX_PES_AUDIO0
  71. #define DMX_PES_VIDEO DMX_PES_VIDEO0
  72. #define DMX_PES_TELETEXT DMX_PES_TELETEXT0
  73. #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
  74. #define DMX_PES_PCR DMX_PES_PCR0
  75. typedef enum
  76. {
  77. DMX_SCRAMBLING_EV,
  78. DMX_FRONTEND_EV
  79. } dmx_event_t;
  80. typedef enum
  81. {
  82. DMX_SCRAMBLING_OFF,
  83. DMX_SCRAMBLING_ON
  84. } dmx_scrambling_status_t;
  85. typedef struct dmx_filter
  86. {
  87. __u8 filter[DMX_FILTER_SIZE];
  88. __u8 mask[DMX_FILTER_SIZE];
  89. __u8 mode[DMX_FILTER_SIZE];
  90. } dmx_filter_t;
  91. struct dmx_sct_filter_params
  92. {
  93. __u16 pid;
  94. dmx_filter_t filter;
  95. __u32 timeout;
  96. __u32 flags;
  97. #define DMX_CHECK_CRC 1
  98. #define DMX_ONESHOT 2
  99. #define DMX_IMMEDIATE_START 4
  100. #define DMX_KERNEL_CLIENT 0x8000
  101. };
  102. struct dmx_pes_filter_params
  103. {
  104. __u16 pid;
  105. dmx_input_t input;
  106. dmx_output_t output;
  107. dmx_pes_type_t pes_type;
  108. __u32 flags;
  109. };
  110. struct dmx_event
  111. {
  112. dmx_event_t event;
  113. time_t timeStamp;
  114. union
  115. {
  116. dmx_scrambling_status_t scrambling;
  117. } u;
  118. };
  119. typedef struct dmx_caps {
  120. __u32 caps;
  121. int num_decoders;
  122. } dmx_caps_t;
  123. typedef enum {
  124. DMX_SOURCE_FRONT0 = 0,
  125. DMX_SOURCE_FRONT1,
  126. DMX_SOURCE_FRONT2,
  127. DMX_SOURCE_FRONT3,
  128. DMX_SOURCE_DVR0 = 16,
  129. DMX_SOURCE_DVR1,
  130. DMX_SOURCE_DVR2,
  131. DMX_SOURCE_DVR3
  132. } dmx_source_t;
  133. struct dmx_stc {
  134. unsigned int num; /* input : which STC? 0..N */
  135. unsigned int base; /* output: divisor for stc to get 90 kHz clock */
  136. __u64 stc; /* output: stc in 'base'*90 kHz units */
  137. };
  138. #define DMX_START _IO('o', 41)
  139. #define DMX_STOP _IO('o', 42)
  140. #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
  141. #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
  142. #define DMX_SET_BUFFER_SIZE _IO('o', 45)
  143. #define DMX_GET_EVENT _IOR('o', 46, struct dmx_event)
  144. #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
  145. #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
  146. #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
  147. #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
  148. #endif /*_DVBDMX_H_*/