comparison recpt1/tssplitter_lite.h @ 121:e915d31c5bd9

add --es option
author Naoya OYAMA <naoya.oyama@gmail.com>
date Thu, 29 Apr 2010 02:02:42 +0900
parents 8e438d2a1529
children 4009737ea899
comparison
equal deleted inserted replaced
120:8e438d2a1529 121:e915d31c5bd9
21 #define _TS_SPLITTER_LITE_H_ 21 #define _TS_SPLITTER_LITE_H_
22 22
23 #define __STDC_FORMAT_MACROS 23 #define __STDC_FORMAT_MACROS
24 #include <inttypes.h> 24 #include <inttypes.h>
25 #include <unistd.h> 25 #include <unistd.h>
26 #include <limits.h>
26 27
27 #define LENGTH_PACKET (188) 28 #define LENGTH_PACKET (188)
28 #define MAX_PID (8192) 29 #define MAX_PID (8192)
29 #define MAX_SERVICES (50) 30 #define MAX_SERVICES (50)
30 #define LENGTH_CRC_DATA (176) 31 #define LENGTH_CRC_DATA (176)
34 #define TSS_SUCCESS (0) 35 #define TSS_SUCCESS (0)
35 #define TSS_ERROR (-1) 36 #define TSS_ERROR (-1)
36 #define TSS_NULL (-2) 37 #define TSS_NULL (-2)
37 #define LENGTH_PAT_HEADER (12) 38 #define LENGTH_PAT_HEADER (12)
38 #define C_CHAR_COMMA ',' 39 #define C_CHAR_COMMA ','
40 #define C_CHAR_DOT '.'
39 #define LENGTH_TS_HEADER (4) 41 #define LENGTH_TS_HEADER (4)
40 #define LENGTH_PES_HEADER (9) 42 #define LENGTH_PES_HEADER (9)
41 #define LENGTH_PTS (5) 43 #define LENGTH_PTS (5)
42 44
43 /* 改訂版デジタル放送教科書(上) P101 表1 ARIBでのPSI/SIの種類より参照 */ 45 /* 改訂版デジタル放送教科書(上) P101 表1 ARIBでのPSI/SIの種類より参照 */
156 program_t *Program; 158 program_t *Program;
157 int64_t pts; 159 int64_t pts;
158 int64_t dts; 160 int64_t dts;
159 int started; /* 該当ESが蓄積開始しているか */ 161 int started; /* 該当ESが蓄積開始しているか */
160 int random_access_indicator; /* TS の random_access_indicator */ 162 int random_access_indicator; /* TS の random_access_indicator */
163 int fd; /* 該当ESのfd */
161 int size; 164 int size;
162 u_char buffer[3*1024*1024]; 165 u_char buffer[3*1024*1024];
163 } splitesbuf_t; 166 } splitesbuf_t;
164 167
165 /** 168 /**
182 int status; 185 int status;
183 splitpesbuf_t *pesbuf[MAX_PID]; 186 splitpesbuf_t *pesbuf[MAX_PID];
184 splitesbuf_t *esbuf[MAX_PID]; 187 splitesbuf_t *esbuf[MAX_PID];
185 program_t *program; 188 program_t *program;
186 int pid_sid_table[MAX_PID]; /* pid to sid の変換を行うためのテーブル */ 189 int pid_sid_table[MAX_PID]; /* pid to sid の変換を行うためのテーブル */
190 char *filename; /* ファイル名を上位からもらってくるためのポインタ */
191 int esout; /* ES出力する? */
187 } splitter; 192 } splitter;
188 193
189 /* b25 decoder would hoard up large chank */ 194 /* b25 decoder would hoard up large chank */
190 typedef struct _splitbuf_t 195 typedef struct _splitbuf_t
191 { 196 {
192 int size; 197 int size;
193 u_char buffer[1024*1024]; 198 u_char buffer[1024*1024];
194 } splitbuf_t; 199 } splitbuf_t;
195 200
196 splitter* split_startup(char *sid); 201 splitter* split_startup(char *sid, char *filename);
197 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf); 202 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf);
198 void split_shutdown(splitter *sp); 203 void split_shutdown(splitter *sp);
199 int split_ts(splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, splitbuf_t *dbuf); 204 int split_ts(splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, splitbuf_t *dbuf);
200 205
201 #endif 206 #endif