Mercurial > pt1.oyama
comparison recpt1/tssplitter_lite.h @ 96:52f8e081763d
add an option to specify the necessary service IDs.
patch by Naoya OYAMA <naoya.oyama@gmail.com>, based on the code of tssplitter_lite by querulous.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 10 Feb 2010 14:33:32 +0900 |
parents | |
children | 3fd15032fd3a |
comparison
equal
deleted
inserted
replaced
95:a201531113ca | 96:52f8e081763d |
---|---|
1 /* tssplitter_lite.h -- split TS stream program's header. | |
2 | |
3 Copyright 2009 querulous | |
4 Copyright 2010 Naoya OYAMA <naoya.oyama@gmail.com> | |
5 | |
6 This program is free software: you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation, either version 3 of the License, or | |
9 (at your option) any later version. | |
10 | |
11 This program is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
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/>. */ | |
18 #ifndef _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 | |
25 #pragma warning(disable: 4996) | |
26 #else | |
27 #define __STDC_FORMAT_MACROS | |
28 #include <inttypes.h> | |
29 #include <unistd.h> | |
30 // #include "portable.h" | |
31 #endif | |
32 | |
33 #define LENGTH_PACKET (188) | |
34 #define MAX_PID (8192) | |
35 #define LENGTH_CRC_DATA (176) | |
36 #define false (0) | |
37 #define true (1) | |
38 | |
39 #define TSS_SUCCESS (0) | |
40 #define TSS_ERROR (-1) | |
41 #define TSS_NULL (-2) | |
42 #define LENGTH_PAT_HEADER (12) | |
43 #define C_CHAR_COMMA ',' | |
44 | |
45 /** | |
46 * splitter¹½Â¤ÂÎ | |
47 */ | |
48 typedef struct splitter { | |
49 unsigned char pids[MAX_PID]; | |
50 unsigned char pmt_pids[MAX_PID]; | |
51 unsigned char* pat; | |
52 char** sid_list; | |
53 unsigned char pat_count; | |
54 int pmt_drop; | |
55 int pmt_counter; | |
56 } splitter; | |
57 | |
58 char** AnalyzeSid(char* sid); | |
59 splitter* split_startup(char *sid); | |
60 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf); | |
61 void split_shutdown( splitter* sp); | |
62 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); | |
63 //int split_ts( unsigned char** pat, unsigned char* pids, ARIB_STD_B25_BUFFER *sbuf, BUFSZ *dbuf); | |
64 int split_ts( splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, BUFSZ *dbuf); | |
65 int AnalyzePat(unsigned char* buf, unsigned char** pat, unsigned char* pids, char** sid_list, unsigned char* pmt_pids, int* pmt_drop); | |
66 int RecreatePat(unsigned char* buf, unsigned char** pat, unsigned char* pids, int *pos); | |
67 int AnalyzePmt(unsigned char* buf, unsigned char* pids); | |
68 | |
69 int GetCrc32(unsigned char* data, int len); | |
70 int GetPid(unsigned char* data); | |
71 #endif |