comparison recpt1/tssplitter_lite.h @ 99:3a3f15b063e1

now recpt1 accepts single sid for terrestrial channels. technical summary: - mark pid to record instead of pid to drop - split after decoding for now
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 12 Feb 2010 21:40:21 +0900
parents 3fd15032fd3a
children aeba1988234f
comparison
equal deleted inserted replaced
98:3fd15032fd3a 99:3a3f15b063e1
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef _TS_SPLITTER_LITE_H_ 18 #ifndef _TS_SPLITTER_LITE_H_
19 #define _TS_SPLITTER_LITE_H_ 19 #define _TS_SPLITTER_LITE_H_
20 #if defined(WIN32)
21 #include <io.h>
22 #include <windows.h>
23 #include <crtdbg.h>
24 20
25 #pragma warning(disable: 4996) 21 #define __STDC_FORMAT_MACROS
26 #else 22 #include <inttypes.h>
27 #define __STDC_FORMAT_MACROS 23 #include <unistd.h>
28 #include <inttypes.h>
29 #include <unistd.h>
30 // #include "portable.h"
31 #endif
32 24
33 #define LENGTH_PACKET (188) 25 #define LENGTH_PACKET (188)
34 #define MAX_PID (8192) 26 #define MAX_PID (8192)
35 #define MAX_SERVICES (50) 27 #define MAX_SERVICES (50)
36 #define LENGTH_CRC_DATA (176) 28 #define LENGTH_CRC_DATA (176)
50 unsigned char pids[MAX_PID]; 42 unsigned char pids[MAX_PID];
51 unsigned char pmt_pids[MAX_PID]; 43 unsigned char pmt_pids[MAX_PID];
52 unsigned char* pat; 44 unsigned char* pat;
53 char** sid_list; 45 char** sid_list;
54 unsigned char pat_count; 46 unsigned char pat_count;
55 int pmt_drop; 47 int pmt_remain;
56 int pmt_counter; 48 int pmt_counter;
57 } splitter; 49 } splitter;
58 50
59 char** AnalyzeSid(char* sid); 51 /* b25 decoder would hoard up large chank */
52 typedef struct _splitbuf_t
53 {
54 int size;
55 u_char buffer[1024*1024];
56 } splitbuf_t;
57
60 splitter* split_startup(char *sid); 58 splitter* split_startup(char *sid);
61 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf); 59 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf);
62 void split_shutdown( splitter* sp); 60 void split_shutdown(splitter *sp);
63 int ReadTs( unsigned char** pat, unsigned char* pids, char** sid_list, unsigned char* pmt_pids, ARIB_STD_B25_BUFFER *sbuf, int* pmt_drop, int* pmt_counter); 61 int split_ts(splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, splitbuf_t *dbuf);
64 //int split_ts( unsigned char** pat, unsigned char* pids, ARIB_STD_B25_BUFFER *sbuf, BUFSZ *dbuf);
65 int split_ts( splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, BUFSZ *dbuf);
66 int AnalyzePat(unsigned char* buf, unsigned char** pat, unsigned char* pids, char** sid_list, unsigned char* pmt_pids, int* pmt_drop);
67 int RecreatePat(unsigned char* buf, unsigned char** pat, unsigned char* pids, int *pos);
68 int AnalyzePmt(unsigned char* buf, unsigned char* pids);
69 62
70 int GetCrc32(unsigned char* data, int len);
71 int GetPid(unsigned char* data);
72 #endif 63 #endif