00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _TS_H_
00028 #define _TS_H_
00029
00030 #include "ringbuffer.h"
00031 #include "mpg_common.h"
00032
00033 #define TS_SIZE 188
00034 #define TRANS_ERROR 0x80
00035 #define PAY_START 0x40
00036 #define TRANS_PRIO 0x20
00037 #define PID_MASK_HI 0x1F
00038
00039
00040 #define TRANS_SCRMBL1 0x80
00041 #define TRANS_SCRMBL2 0x40
00042 #define ADAPT_FIELD 0x20
00043 #define PAYLOAD 0x10
00044 #define COUNT_MASK 0x0F
00045
00046
00047 #define DISCON_IND 0x80
00048 #define RAND_ACC_IND 0x40
00049 #define ES_PRI_IND 0x20
00050 #define PCR_FLAG 0x10
00051 #define OPCR_FLAG 0x08
00052 #define SPLICE_FLAG 0x04
00053 #define TRANS_PRIV 0x02
00054 #define ADAP_EXT_FLAG 0x01
00055
00056
00057 #define LTW_FLAG 0x80
00058 #define PIECE_RATE 0x40
00059 #define SEAM_SPLICE 0x20
00060
00061 #define TS_VIDPID 4101
00062 #define TS_MP2PID 4201
00063 #define TS_AC3PID 4301
00064 uint16_t get_pid(uint8_t *pid);
00065 int find_pids(uint16_t *vpid, uint16_t *apid, uint16_t *ac3pid,uint8_t *buf, int len);
00066 int find_pids_pos(uint16_t *vpid, uint16_t *apid, uint16_t *ac3pid,uint8_t *buf, int len, int *vpos, int *apos, int *ac3pos);
00067
00068 int write_video_ts(uint64_t vpts, uint64_t vdts, uint64_t SCR,
00069 uint8_t *buf, int *vlength, uint8_t ptsdts, ringbuffer *vrbuffer);
00070 int write_audio_ts(int n, uint64_t pts,
00071 uint8_t *buf, int *alength, uint8_t ptsdts, ringbuffer *arbuffer);
00072 int write_ac3_ts(int n, uint64_t pts, uint8_t *buf, int *alength,
00073 uint8_t ptsdts, int nframes, ringbuffer *ac3rbuffer);
00074 void write_ts_patpmt(extdata_t *ext, int extcnt, uint8_t prog_num,
00075 uint8_t *buf);
00076 #endif