Annotation of margi2/dvb_demux.h, revision 1.3

1.1       mocm        1: /* 
                      2:  * dvb_demux.h - DVB kernel demux API
                      3:  *
1.3     ! mocm        4:  * Copyright (C) 2000-2001 Marcus Metzler <marcus@convergence.de>
        !             5:  *                       & Ralph  Metzler <ralph@convergence.de>
        !             6:  *                         for convergence integrated media GmbH
1.1       mocm        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: #ifdef __DVB_PACK__
                     38: #include <ost/demux.h>
                     39: #else
                     40: #include <linux/ost/demux.h>
                     41: #endif
                     42: 
                     43: #define DMX_TYPE_TS  0
                     44: #define DMX_TYPE_SEC 1
                     45: #define DMX_TYPE_PES 2
                     46: 
                     47: #define DMX_STATE_FREE      0
                     48: #define DMX_STATE_ALLOCATED 1
                     49: #define DMX_STATE_SET       2
                     50: #define DMX_STATE_READY     3
                     51: #define DMX_STATE_GO        4
                     52: 
                     53: #define DVB_DEMUX_MASK_MAX 18
                     54: #define DVB_DEMUX_FILTER_MAX 32
                     55: #define DVB_DEMUX_FEED_MAX 32
                     56: 
                     57: typedef struct dvb_demux_filter_s {
                     58:         dmx_section_filter_t filter;
                     59:         struct dvb_demux_filter_s *next;
                     60:         struct dvb_demux_feed_s *feed;
                     61:         int index;
                     62:         int state;
                     63:         int type;
                     64:        int pesto;
                     65: 
                     66:         u32 flags;
                     67:         u16 handle;
                     68:         u16 hw_handle;
                     69:         struct timer_list timer;
                     70:        int ts_state;
                     71: 
                     72:         u16 pid;  //to be removed
                     73: } dvb_demux_filter_t;
                     74: 
                     75: typedef struct dvb_demux_feed_s {
                     76:         union {
                     77:                dmx_ts_feed_t ts;
                     78:                dmx_section_feed_t sec;
                     79:                dmx_pes_feed_t pes;
                     80:        } feed;
                     81: 
                     82:         union {
                     83:                dmx_ts_cb ts;
                     84:                dmx_section_cb sec;
                     85:                dmx_pes_cb pes;
                     86:        } cb;
                     87: 
                     88:         struct dvb_demux_s *demux;
                     89:         int type;
                     90:         int state;
                     91:         u16 pid;
                     92:         u8 *buffer;
                     93:         int buffer_size;
                     94:         int descramble;
                     95:         int check_crc;
                     96: 
                     97:         struct timespec timeout; 
                     98:         dvb_demux_filter_t *filter;
                     99:         int cb_length;
                    100:   
                    101:         int ts_type;
                    102:         dmx_ts_pes_t pes_type;
                    103: 
                    104:         u8 secbuf[4096];
                    105:         int secbufp;
                    106:         int seclen;
                    107:         int cc;
                    108: 
                    109:         u16 peslen;
                    110: } dvb_demux_feed_t;
                    111: 
                    112: typedef struct dvb_demux_s {
                    113:         dmx_demux_t dmx;
1.3     ! mocm      114:         void *priv;
        !           115:         int filternum;
        !           116:         int (*start_feed)(dvb_demux_feed_t *);
        !           117:         int (*stop_feed)(dvb_demux_feed_t *);
        !           118:         int (*write_to_decoder)(dvb_demux_feed_t *, u8 *, size_t);
1.1       mocm      119: 
1.3     ! mocm      120:   
1.1       mocm      121:         int users;
                    122: #define MAX_DVB_DEMUX_USERS 10
                    123:         dvb_demux_filter_t *filter;
                    124:         dvb_demux_feed_t feed[DVB_DEMUX_FEED_MAX];
                    125: 
                    126:         struct list_head frontend_list;
                    127: 
                    128:         dvb_demux_feed_t *pesfilter[DMX_TS_PES_OTHER]; //special PES filters
1.3     ! mocm      129:         u16 pids[DMX_TS_PES_OTHER-1];
1.1       mocm      130:         int playing; 
                    131:         int recording; 
                    132: 
                    133:         dvb_demux_feed_t *pid2feed[0x2000];
                    134:         u8 tsbuf[188];
                    135:         int tsbufp;
                    136: 
                    137: } dvb_demux_t;
                    138: 
                    139: 
1.3     ! mocm      140: int DvbDmxInit(dvb_demux_t *dvbdemux);
1.1       mocm      141: int DvbDmxRelease(dvb_demux_t *dvbdemux);
1.3     ! mocm      142: void DvbDmxSWFilterPackets(dvb_demux_t *dvbdmx, const u8 *buf, int count);
1.1       mocm      143: 
                    144: #endif /* _DVB_DEMUX_H_ */

LinuxTV legacy CVS <linuxtv.org/cvs>