annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
1 /* 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
2
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 Copyright 2009 querulous
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4 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
5
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 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
7 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
8 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
9 (at your option) any later version.
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
11 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
12 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
13 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
14 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
15
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16 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
17 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
18 #ifndef _TS_SPLITTER_LITE_H_
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
19 #define _TS_SPLITTER_LITE_H_
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
20
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
21 #define __STDC_FORMAT_MACROS
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
22 #include <inttypes.h>
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
23 #include <unistd.h>
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
25 #define LENGTH_PACKET (188)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
26 #define MAX_PID (8192)
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
27 #define MAX_SERVICES (50)
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 #define LENGTH_CRC_DATA (176)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
29 #define false (0)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 #define true (1)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 #define TSS_SUCCESS (0)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33 #define TSS_ERROR (-1)
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 #define TSS_NULL (-2)
98
3fd15032fd3a tweak user interface for sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
35 #define LENGTH_PAT_HEADER (12)
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
36 #define C_CHAR_COMMA ','
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
37
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
38 /**
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
39 * splitter¹½Â¤ÂÎ
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 typedef struct splitter {
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
42 unsigned char pids[MAX_PID];
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
43 unsigned char pmt_pids[MAX_PID];
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
44 unsigned char* pat;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
45 char** sid_list;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
46 unsigned char pat_count;
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
47 int pmt_remain;
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
48 int pmt_counter;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
49 } splitter;
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
50
99
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
51 /* 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
52 typedef struct _splitbuf_t
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
53 {
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
54 int size;
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
55 u_char buffer[1024*1024];
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
56 } splitbuf_t;
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
57
96
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
58 splitter* split_startup(char *sid);
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
59 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
60 void split_shutdown(splitter *sp);
3a3f15b063e1 now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
61 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
62
52f8e081763d add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
63 #endif