File indexing completed on 2024-05-05 04:52:05

0001 /*
0002  * dmx.h
0003  *
0004  * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
0005  *                  & Ralph  Metzler <ralph@convergence.de>
0006  *                    for convergence integrated media GmbH
0007  *
0008  * This program is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public License
0010  * as published by the Free Software Foundation; either version 2.1
0011  * of the License, or (at your option) any later version.
0012  *
0013  * This program is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0016  * GNU General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public License
0019  * along with this program; if not, write to the Free Software
0020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
0021  *
0022  */
0023 
0024 #ifndef _DVBDMX_H_
0025 #define _DVBDMX_H_
0026 
0027 #include "linuxtypes.h"
0028 #include <time.h>
0029 
0030 
0031 #define DMX_FILTER_SIZE 16
0032 
0033 enum dmx_output
0034 {
0035     DMX_OUT_DECODER, /* Streaming directly to decoder. */
0036     DMX_OUT_TAP,     /* Output going to a memory buffer */
0037              /* (to be retrieved via the read command).*/
0038     DMX_OUT_TS_TAP,  /* Output multiplexed into a new TS  */
0039              /* (to be retrieved by reading from the */
0040              /* logical DVR device).                 */
0041     DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
0042 };
0043 
0044 typedef enum dmx_output dmx_output_t;
0045 
0046 typedef enum dmx_input
0047 {
0048     DMX_IN_FRONTEND, /* Input from a front-end device.  */
0049     DMX_IN_DVR       /* Input from the logical DVR device.  */
0050 } dmx_input_t;
0051 
0052 
0053 typedef enum dmx_ts_pes
0054 {
0055     DMX_PES_AUDIO0,
0056     DMX_PES_VIDEO0,
0057     DMX_PES_TELETEXT0,
0058     DMX_PES_SUBTITLE0,
0059     DMX_PES_PCR0,
0060 
0061     DMX_PES_AUDIO1,
0062     DMX_PES_VIDEO1,
0063     DMX_PES_TELETEXT1,
0064     DMX_PES_SUBTITLE1,
0065     DMX_PES_PCR1,
0066 
0067     DMX_PES_AUDIO2,
0068     DMX_PES_VIDEO2,
0069     DMX_PES_TELETEXT2,
0070     DMX_PES_SUBTITLE2,
0071     DMX_PES_PCR2,
0072 
0073     DMX_PES_AUDIO3,
0074     DMX_PES_VIDEO3,
0075     DMX_PES_TELETEXT3,
0076     DMX_PES_SUBTITLE3,
0077     DMX_PES_PCR3,
0078 
0079     DMX_PES_OTHER
0080 } dmx_pes_type_t;
0081 
0082 #define DMX_PES_AUDIO    DMX_PES_AUDIO0
0083 #define DMX_PES_VIDEO    DMX_PES_VIDEO0
0084 #define DMX_PES_TELETEXT DMX_PES_TELETEXT0
0085 #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
0086 #define DMX_PES_PCR      DMX_PES_PCR0
0087 
0088 
0089 typedef struct dmx_filter
0090 {
0091     __u8  filter[DMX_FILTER_SIZE];
0092     __u8  mask[DMX_FILTER_SIZE];
0093     __u8  mode[DMX_FILTER_SIZE];
0094 } dmx_filter_t;
0095 
0096 
0097 struct dmx_sct_filter_params
0098 {
0099     __u16          pid;
0100     dmx_filter_t   filter;
0101     __u32          timeout;
0102     __u32          flags;
0103 #define DMX_CHECK_CRC       1
0104 #define DMX_ONESHOT         2
0105 #define DMX_IMMEDIATE_START 4
0106 #define DMX_KERNEL_CLIENT   0x8000
0107 };
0108 
0109 
0110 struct dmx_pes_filter_params
0111 {
0112     __u16          pid;
0113     dmx_input_t    input;
0114     dmx_output_t   output;
0115     dmx_pes_type_t pes_type;
0116     __u32          flags;
0117 };
0118 
0119 typedef struct dmx_caps {
0120     __u32 caps;
0121     int num_decoders;
0122 } dmx_caps_t;
0123 
0124 typedef enum dmx_source {
0125     DMX_SOURCE_FRONT0 = 0,
0126     DMX_SOURCE_FRONT1,
0127     DMX_SOURCE_FRONT2,
0128     DMX_SOURCE_FRONT3,
0129     DMX_SOURCE_DVR0   = 16,
0130     DMX_SOURCE_DVR1,
0131     DMX_SOURCE_DVR2,
0132     DMX_SOURCE_DVR3
0133 } dmx_source_t;
0134 
0135 struct dmx_stc {
0136     unsigned int num;   /* input : which STC? 0..N */
0137     unsigned int base;  /* output: divisor for stc to get 90 kHz clock */
0138     __u64 stc;      /* output: stc in 'base'*90 kHz units */
0139 };
0140 
0141 #define DMX_START                _IO('o', 41)
0142 #define DMX_STOP                 _IO('o', 42)
0143 #define DMX_SET_FILTER           _IOW('o', 43, struct dmx_sct_filter_params)
0144 #define DMX_SET_PES_FILTER       _IOW('o', 44, struct dmx_pes_filter_params)
0145 #define DMX_SET_BUFFER_SIZE      _IO('o', 45)
0146 #define DMX_GET_PES_PIDS         _IOR('o', 47, __u16[5])
0147 #define DMX_GET_CAPS             _IOR('o', 48, dmx_caps_t)
0148 #define DMX_SET_SOURCE           _IOW('o', 49, dmx_source_t)
0149 #define DMX_GET_STC              _IOWR('o', 50, struct dmx_stc)
0150 #define DMX_ADD_PID              _IOW('o', 51, __u16)
0151 #define DMX_REMOVE_PID           _IOW('o', 52, __u16)
0152 
0153 #endif /* _DVBDMX_H_ */