Annotation of margi2/dvb_filter.h, revision 1.1
1.1 ! mocm 1: #ifndef _DVB_FILTER_H_
! 2: #define _DVB_FILTER_H_
! 3:
! 4: #include <linux/slab.h>
! 5: #include <linux/vmalloc.h>
! 6:
! 7: #ifdef __DVB_PACK__
! 8: #include <ost/demux.h>
! 9: #else
! 10: #include <linux/ost/demux.h>
! 11: #endif
! 12:
! 13: typedef int (pes2ts_cb_t) (void *, unsigned char *);
! 14:
! 15: typedef struct pes2ts_s {
! 16: unsigned char buf[188];
! 17: unsigned char cc;
! 18: pes2ts_cb_t *cb;
! 19: void *priv;
! 20: } pes2ts_t;
! 21:
! 22: void pes2ts_init(pes2ts_t *p2ts, unsigned short pid,
! 23: pes2ts_cb_t *cb, void *priv);
! 24: int pes2ts(pes2ts_t *p2ts, unsigned char *pes, int len);
! 25:
! 26:
! 27: #define PROG_STREAM_MAP 0xBC
! 28: #define PRIVATE_STREAM1 0xBD
! 29: #define PADDING_STREAM 0xBE
! 30: #define PRIVATE_STREAM2 0xBF
! 31: #define AUDIO_STREAM_S 0xC0
! 32: #define AUDIO_STREAM_E 0xDF
! 33: #define VIDEO_STREAM_S 0xE0
! 34: #define VIDEO_STREAM_E 0xEF
! 35: #define ECM_STREAM 0xF0
! 36: #define EMM_STREAM 0xF1
! 37: #define DSM_CC_STREAM 0xF2
! 38: #define ISO13522_STREAM 0xF3
! 39: #define PROG_STREAM_DIR 0xFF
! 40:
! 41: //flags2
! 42: #define PTS_DTS_FLAGS 0xC0
! 43: #define ESCR_FLAG 0x20
! 44: #define ES_RATE_FLAG 0x10
! 45: #define DSM_TRICK_FLAG 0x08
! 46: #define ADD_CPY_FLAG 0x04
! 47: #define PES_CRC_FLAG 0x02
! 48: #define PES_EXT_FLAG 0x01
! 49:
! 50: //pts_dts flags
! 51: #define PTS_ONLY 0x80
! 52: #define PTS_DTS 0xC0
! 53:
! 54: #define TS_SIZE 188
! 55: #define TRANS_ERROR 0x80
! 56: #define PAY_START 0x40
! 57: #define TRANS_PRIO 0x20
! 58: #define PID_MASK_HI 0x1F
! 59: //flags
! 60: #define TRANS_SCRMBL1 0x80
! 61: #define TRANS_SCRMBL2 0x40
! 62: #define ADAPT_FIELD 0x20
! 63: #define PAYLOAD 0x10
! 64: #define COUNT_MASK 0x0F
! 65:
! 66: // adaptation flags
! 67: #define DISCON_IND 0x80
! 68: #define RAND_ACC_IND 0x40
! 69: #define ES_PRI_IND 0x20
! 70: #define PCR_FLAG 0x10
! 71: #define OPCR_FLAG 0x08
! 72: #define SPLICE_FLAG 0x04
! 73: #define TRANS_PRIV 0x02
! 74: #define ADAP_EXT_FLAG 0x01
! 75:
! 76: // adaptation extension flags
! 77: #define LTW_FLAG 0x80
! 78: #define PIECE_RATE 0x40
! 79: #define SEAM_SPLICE 0x20
! 80:
! 81:
! 82: #define MAX_PLENGTH 0xFFFF
! 83: #define MMAX_PLENGTH (256*MAX_PLENGTH)
! 84:
! 85: #ifndef IPACKS
! 86: #define IPACKS 2048
! 87: #endif
! 88:
! 89: typedef struct ipack_s {
! 90: int size;
! 91: int found;
! 92: u8 *buf;
! 93: u8 cid;
! 94: uint32_t plength;
! 95: u8 plen[2];
! 96: u8 flag1;
! 97: u8 flag2;
! 98: u8 hlength;
! 99: u8 pts[5];
! 100: u16 *pid;
! 101: int mpeg;
! 102: u8 check;
! 103: int which;
! 104: int done;
! 105: void *data;
! 106: void (*func)(u8 *buf, int size, void *priv);
! 107: int count;
! 108: int repack_subids;
! 109: } ipack;
! 110:
! 111: typedef struct video_i{
! 112: u32 horizontal_size;
! 113: u32 vertical_size ;
! 114: u32 aspect_ratio ;
! 115: double framerate ;
! 116: u32 video_format;
! 117: u32 bit_rate ;
! 118: u32 comp_bit_rate ;
! 119: u32 vbv_buffer_size;
! 120: u32 CSPF ;
! 121: u32 off;
! 122: } VideoInfo;
! 123:
! 124: typedef struct audio_i{
! 125: int layer ;
! 126: u32 bit_rate ;
! 127: u32 frequency ;
! 128: u32 mode ;
! 129: u32 mode_extension ;
! 130: u32 emphasis ;
! 131: u32 framesize;
! 132: u32 off;
! 133: } AudioInfo;
! 134:
! 135: void reset_ipack(ipack *p);
! 136: int instant_repack(u8 *buf, int count, ipack *p);
! 137: void init_ipack(ipack *p, int size,
! 138: void (*func)(u8 *buf, int size, void *priv));
! 139: void free_ipack(ipack * p);
! 140: void setup_ts2pes(ipack *pa, ipack *pv, u16 *pida, u16 *pidv,
! 141: void (*pes_write)(u8 *buf, int count, void *data),
! 142: void *priv);
! 143: void ts_to_pes(ipack *p, u8 *buf);
! 144: void send_ipack(ipack *p);
! 145: void send_ipack_rest(ipack *p);
! 146: int get_ainfo(uint8_t *mbuf, int count, AudioInfo *ai, int pr);
! 147: int get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr);
! 148: int get_vinfo(uint8_t *mbuf, int count, VideoInfo *vi, int pr);
! 149: uint8_t *skip_pes_header(uint8_t **bufp);
! 150: #endif
LinuxTV legacy CVS <linuxtv.org/cvs>