annotate recpt1/tssplitter_lite.h @ 118:caecbba2a76f

commit test2.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 19 Apr 2010 00:17:57 +0900
parents aeba1988234f
children 4e7aaa72e158
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
100
aeba1988234f support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 99
diff changeset
1 /* -*- tab-width: 4; indent-tabs-mode: t -*- */
118
caecbba2a76f commit test2.
Naoya OYAMA <naoya.oyama@gmail.com>
parents: 100
diff changeset
2 /* vim: set ts=4 sts=4 sw=4 noexpandtab number : */
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 /* tssplitter_lite.h -- split TS stream program's header.
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
5 Copyright 2009 querulous
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 Copyright 2010 Naoya OYAMA <naoya.oyama@gmail.com>
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
7
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
8 This program is free software: you can redistribute it and/or modify
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
11 (at your option) any later version.
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
12
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16 GNU General Public License for more details.
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
20 #ifndef _TS_SPLITTER_LITE_H_
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21 #define _TS_SPLITTER_LITE_H_
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
22
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
23 #define __STDC_FORMAT_MACROS
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
24 #include <inttypes.h>
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
25 #include <unistd.h>
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
26
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
27 #define LENGTH_PACKET (188)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 #define MAX_PID (8192)
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
29 #define MAX_SERVICES (50)
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 #define LENGTH_CRC_DATA (176)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31 #define false (0)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 #define true (1)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 #define TSS_SUCCESS (0)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
35 #define TSS_ERROR (-1)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
36 #define TSS_NULL (-2)
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
37 #define LENGTH_PAT_HEADER (12)
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
38 #define C_CHAR_COMMA ','
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
39
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
40 /**
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
41 * splitter¹½Â¤ÂÎ
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
42 */
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
43 typedef struct splitter {
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
44 unsigned char pids[MAX_PID];
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
45 unsigned char pmt_pids[MAX_PID];
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
46 unsigned char* pat;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
47 char** sid_list;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
48 unsigned char pat_count;
100
aeba1988234f support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 99
diff changeset
49 int pmt_retain;
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
50 int pmt_counter;
100
aeba1988234f support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 99
diff changeset
51 int avail_pmts[MAX_SERVICES];
aeba1988234f support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 99
diff changeset
52 int num_pmts;
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
53 } splitter;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
54
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
55 /* b25 decoder would hoard up large chank */
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
56 typedef struct _splitbuf_t
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
57 {
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
58 int size;
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
59 u_char buffer[1024*1024];
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
60 } splitbuf_t;
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
61
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
62 splitter* split_startup(char *sid);
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
63 int split_select(splitter *sp, ARIB_STD_B25_BUFFER *sbuf);
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
64 void split_shutdown(splitter *sp);
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
65 int split_ts(splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, splitbuf_t *dbuf);
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
66
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
67 #endif