Annotation of margi2/dvb_demux.h, revision 1.1
1.1 ! mocm 1: /*
! 2: * dvb_demux.h - DVB kernel demux API
! 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:
! 24: #ifndef _DVB_DEMUX_H_
! 25: #define _DVB_DEMUX_H_
! 26:
! 27: #if LINUX_VERSION_CODE < 0x020300
! 28: #define WAIT_QUEUE struct wait_queue*
! 29: #define init_waitqueue_head(wq) *(wq) = NULL;
! 30: #define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL }
! 31: #define list_for_each(pos, head) \
! 32: for (pos = (head)->next; pos != (head); pos = pos->next)
! 33: #else
! 34: #define WAIT_QUEUE wait_queue_head_t
! 35: #endif
! 36:
! 37: #include "dvbdev.h"
! 38:
! 39: #ifdef __DVB_PACK__
! 40: #include <ost/demux.h>
! 41: #else
! 42: #include <linux/ost/demux.h>
! 43: #endif
! 44:
! 45: #define DMX_TYPE_TS 0
! 46: #define DMX_TYPE_SEC 1
! 47: #define DMX_TYPE_PES 2
! 48:
! 49: #define DMX_STATE_FREE 0
! 50: #define DMX_STATE_ALLOCATED 1
! 51: #define DMX_STATE_SET 2
! 52: #define DMX_STATE_READY 3
! 53: #define DMX_STATE_GO 4
! 54:
! 55: #define DVB_DEMUX_MASK_MAX 18
! 56: #define DVB_DEMUX_FILTER_MAX 32
! 57: #define DVB_DEMUX_FEED_MAX 32
! 58:
! 59: typedef struct dvb_demux_filter_s {
! 60: dmx_section_filter_t filter;
! 61: struct dvb_demux_filter_s *next;
! 62: struct dvb_demux_feed_s *feed;
! 63: int index;
! 64: int state;
! 65: int type;
! 66: int pesto;
! 67:
! 68: u32 flags;
! 69: u16 handle;
! 70: u16 hw_handle;
! 71: struct timer_list timer;
! 72: int ts_state;
! 73:
! 74: u16 pid; //to be removed
! 75: } dvb_demux_filter_t;
! 76:
! 77: typedef struct dvb_demux_feed_s {
! 78: union {
! 79: dmx_ts_feed_t ts;
! 80: dmx_section_feed_t sec;
! 81: dmx_pes_feed_t pes;
! 82: } feed;
! 83:
! 84: union {
! 85: dmx_ts_cb ts;
! 86: dmx_section_cb sec;
! 87: dmx_pes_cb pes;
! 88: } cb;
! 89:
! 90: struct dvb_demux_s *demux;
! 91: int type;
! 92: int state;
! 93: u16 pid;
! 94: u8 *buffer;
! 95: int buffer_size;
! 96: int descramble;
! 97: int check_crc;
! 98:
! 99: struct timespec timeout;
! 100: dvb_demux_filter_t *filter;
! 101: int cb_length;
! 102:
! 103: int ts_type;
! 104: dmx_ts_pes_t pes_type;
! 105:
! 106: u8 secbuf[4096];
! 107: int secbufp;
! 108: int seclen;
! 109: int cc;
! 110:
! 111: u16 peslen;
! 112: } dvb_demux_feed_t;
! 113:
! 114: typedef struct dvb_demux_s {
! 115: dmx_demux_t dmx;
! 116:
! 117: int users;
! 118: #define MAX_DVB_DEMUX_USERS 10
! 119: int filternum;
! 120: dvb_demux_filter_t *filter;
! 121: dvb_demux_feed_t feed[DVB_DEMUX_FEED_MAX];
! 122:
! 123: struct list_head frontend_list;
! 124: void *priv;
! 125:
! 126: dvb_demux_feed_t *pesfilter[DMX_TS_PES_OTHER]; //special PES filters
! 127: u16 pids[5];
! 128: int playing;
! 129: int recording;
! 130:
! 131: dvb_demux_feed_t *pid2feed[0x2000];
! 132: u8 tsbuf[188];
! 133: int tsbufp;
! 134:
! 135: int (*start_feed)(dvb_demux_feed_t *);
! 136: int (*stop_feed)(dvb_demux_feed_t *);
! 137: int (*write_to_decoder)(dvb_demux_feed_t *, u8 *, size_t);
! 138: } dvb_demux_t;
! 139:
! 140:
! 141: int DvbDmxInit(dvb_demux_t *dvbdemux, char *id, char *vendor, char *model);
! 142: int DvbDmxRelease(dvb_demux_t *dvbdemux);
! 143:
! 144: void DvbDmxSWFilterPackets(dvb_demux_t *dvbdmx, const u8 *buf, int count);
! 145: #endif /* _DVB_DEMUX_H_ */
LinuxTV legacy CVS <linuxtv.org/cvs>