Mercurial > pt1.oyama
annotate recpt1/tssplitter_lite.h @ 119:4e7aaa72e158
ES out early release version.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Mon, 19 Apr 2010 00:30:09 +0900 |
parents | caecbba2a76f |
children | 8e438d2a1529 |
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 | 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 ',' |
119
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
39 #define LENGTH_TS_HEADER (4) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
40 #define LENGTH_PES_HEADER (9) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
41 #define LENGTH_PTS (5) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
42 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
43 /* ²þÄûÈǥǥ¸¥¿¥ëÊüÁ÷¶µ²Ê½ñ(¾å) P101 ɽ1 ARIB¤Ç¤ÎPSI/SI¤Î¼ïÎà¤è¤ê»²¾È */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
44 #define PAT (0x0000) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
45 //#define PMT /* PAT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
46 #define CAT (0x0001) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
47 #define NIT (0x0010) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
48 #define SDT (0x0011) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
49 #define BAT (0x0011) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
50 #define EIT (0x0012) /* 0x0026, 0x0027 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
51 #define RST (0x0013) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
52 #define TDT (0x0014) /* Ãϥǥ¸¤Ç¤Ï»ÈÍѤµ¤ì¤Ê¤¤ */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
53 #define TOT (0x0014) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
54 #define LIT (0x0020) /* ¤Þ¤¿¤ÏPMT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
55 #define ERT (0x0021) /* ¤Þ¤¿¤ÏPMT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
56 //#define ITT /* PMT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
57 #define PCAT (0x0022) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
58 #define BIT (0x0024) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
59 #define NBIT (0x0025) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
60 //#define ECM /* PMT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
61 //#define EMM /* CAT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
62 #define LDT (0x0025) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
63 #define DCT (0x0017) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
64 //#define DTL /* DCT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
65 #define DIT (0x001e) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
66 #define SIT (0x001f) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
67 #define SDTT (0x0023) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
68 #define CDT (0x0029) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
69 //#define DSM-CC_Section /* PMT¤Ë¤è¤ë´ÖÀÜ»ØÄê */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
70 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
71 /* ¥»¥¯¥·¥ç¥ó¥Ø¥Ã¥ÀĹ */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
72 /* TS ¥Ñ¥±¥Ã¥È¤Ë³Æ¥»¥¯¥·¥ç¥ó¤òÀßÃÖ¤¹¤ëºÝ¡¢³ºÅöTS¥Ñ¥±¥Ã¥È¤Î»Ä¥µ¥¤¥º¤¬ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
73 * ¤¤¤¯¤Ä°Ê¾å¤¢¤ì¤Ð½ñ¤¹þ¤á¤ë¤«¤ÎȽÄê¤Ë»ÈÍѤ¹¤ë¡£ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
74 * ¥Ç¥³¡¼¥É¤Ë¤Ï¤¢¤Þ¤ê½ÅÍפǤÏ̵¤¤¤«¤â |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
75 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
76 #define SECTION_LENGTH_PAT (8) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
77 #define SECTION_LENGTH_PMT (8) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
78 #define SECTION_LENGTH_CAT (8) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
79 #define SECTION_LENGTH_NIT (8) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
80 #define SECTION_LENGTH_BIT (8) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
81 #define SECTION_LENGTH_SDT (11) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
82 #define SECTION_LENGTH_EIT (14) /* H-EIT, M-EIT, L-EIT ¤ò¼¨¤¹ */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
83 #define SECTION_LENGTH_SDTT (15) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
84 #define SECTION_LENGTH_CDT (13) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
85 #define SECTION_LENGTH_TOT (10) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
86 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
87 enum { |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
88 PTS_FLAG = 0x80, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
89 DTS_FLAG = 0x40, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
90 ESCR_FLAG = 0x20, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
91 ES_RATE_FLAG = 0x10, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
92 DSM_TRICK_MODE_FLAG = 0x08, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
93 COPY_INFO_FLAG = 0x04, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
94 CRC_FLAG = 0x02, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
95 EXTENSION_FLAG = 0x01 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
96 }; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
97 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
98 enum { |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
99 PES_PRIVATE_DATA_FLAG = 0x80, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
100 PACK_HEADER_FIELD_FLAG = 0x40, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
101 PROGRAM_PACKET_SEQUENCE_COUNTER = 0x20, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
102 PSTD_BUFFER_FLAG = 0x10, |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
103 PES_EXTENSION_FLAG2 = 0x01 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
104 }; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
105 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
106 /* |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
107 * PCR¤«¤éSTC¤òÀ¸À®¤¹¤ë½èÍýÊý¼°(°Æ) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
108 * 1. PCR¤òÆó¤Ä¼èÆÀ¤¹¤ë¤Þ¤Ç¥ë¡¼¥×(1.¢²4.¤Þ¤Ç¤Ï½é´ü½èÍý¤Ç¼Â»Ü¤¹¤ë¤³¤È) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
109 * 2. ¥ë¡¼¥×³«»Ï»þ¹ï(PCR)¤È¡¢¥ë¡¼¥×È´¤±¤¿»þ¹ï(PCR)¤Îº¹Ê¬¤ò¼è¤ë |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
110 * 3. ¥ë¡¼¥×³«»Ï¡Á½ªÎ»¤Î´Ö¤Ë½èÍý¤·¤¿¥Ñ¥±¥Ã¥È¿ô¤ò¿ô¤¨¤ë |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
111 * 4. (2.¤ÎPCR¤Î¿Ê¤ó¤À»þ´Ö/3.¤Î¥Ñ¥±¥Ã¥È¿ô)¡¡¤Î·×»»¤Ë¤è¤Ã¤Æ¡¢1¥Ñ¥±¥Ã¥È¤Ë¤è¤Ã¤Æ¿Ê¤àPCR¤òÁÛÄꤹ¤ë |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
112 * 5. TS¼õ¿®»þ¤Ë¡¢1¤Ä¤Î¥Ñ¥±¥Ã¥È¤ò½èÍý¤¹¤ëÅÙ¤Ë4.¤ÎÁÛÄꤹ¤ë·Ð²á»þ¹ï¤òPCR¤Ë¤·¹þ¤ó¤ÇSTC¤È¤¹¤ë |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
113 * 6. PCR¤ò¿·µ¬¤Ë¼èÆÀ¤·¤¿¤é¡¢STC¤òÊäÀµ(¤½¤Î¤Þ¤ÞÂåÆþ)¤¹¤ë |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
114 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
115 #define MAX_VIDEO (16) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
116 #define MAX_AUDIO (32) |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
117 typedef struct _program_t |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
118 { |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
119 int64_t stc; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
120 int64_t cue_time; /* Ï¿²è³«»Ï»þ¹ï */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
121 int pmt_packet_id; /* ³ºÅöProgram(Service ID)¤ËÂбþ¤¹¤ëPMT */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
122 int pmt_version; /* ³ºÅöProgram(Service ID)¤ËÂбþ¤¹¤ëPMT¤ÎVersion */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
123 int pcr_packet_id; /* ³ºÅöProgram(Service ID)¤ÎPCR¤òÊÝ»ý¤¹¤ëPID */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
124 int64_t pcr1; /* PCR1 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
125 int64_t pcr2; /* PCR2 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
126 int packet_nb; /* PCR·×»»ÍÑ¥«¥¦¥ó¥¿ */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
127 int64_t pcr_incr; /* ³ºÅöProgram(Service ID)¤Ë±÷¤¤¤Æ¡¢1¤Ä¤ÎTS¥Ñ¥±¥Ã¥È¤ò½èÍý¤·¤¿»þ¤Ë·Ð²á¤¹¤ë(¤ÈÁÛÄꤹ¤ë»þ´Ö) */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
128 int video_start; /* VODEO0¤òÃßÀѳ«»Ï¤·¤Æ¤¤¤ë¡© */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
129 int video_pts; /* ºÇ¸å¤Ë½èÍý¤·¤¿VODEO0¤ÎES¤ÎPTS */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
130 int video_nb; /* PMT ¤Ë¸ºß¤¹¤ë¥Ó¥Ç¥ª¥¹¥È¥ê¡¼¥à¤Î¿ô */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
131 int audio_nb; /* PMT ¤Ë¸ºß¤¹¤ë²»À¼¥¹¥È¥ê¡¼¥à¤Î¿ô */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
132 int video[MAX_VIDEO]; /* PS½ÐÎϤ¹¤ë¾ì¹ç¤Ë»È¤¦¤«¤â */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
133 int audio[MAX_AUDIO]; /* PS½ÐÎϤ¹¤ë¾ì¹ç¤Ë»È¤¦¤«¤â */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
134 //splitpesbuf_t *pesbuf; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
135 //splitesbuf_t *esbuf; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
136 } program_t; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
137 /* |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
138 * program_t ¤ò¥µ¡¼¥Ó¥¹IDʬ½àÈ÷¤·¤Æ¡¢»ÈÍѤ¹¤ë¥¤¥á¡¼¥¸¤Ç¤¤¤¿¤±¤É¡¢ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
139 * ¥µ¡¼¥Ó¥¹ID¤ÎºÇÂçÃͤÏ0xFFFF¤Ç¤¢¤ë¤Î¤Ç¡¢ÀÅŪ¤Ë³ÎÊݤ¹¤ë¤È stack ¤¬´Êñ¤Ë°î¤ë¤Î¤Ç¡¢ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
140 * ¼Â¹Ô»þ¤Ë malloc ¤È¤¹¤ë¤«¤Ê¤¡ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
141 * ËÜÅö¤ÏɬÍפʤÀ¤±alloc¤¹¤ë¤Î¤¬¹¥¤Þ¤·¤¤¤Î¤À¤±¤É¡Ä |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
142 */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
143 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
144 typedef struct _splitpesbuf_t |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
145 { |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
146 program_t *Program; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
147 int random_access_indicator; /* TS ¤Î random_access_indicator */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
148 int size; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
149 u_char buffer[3*1024*1024]; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
150 } splitpesbuf_t; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
151 |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
152 typedef struct _splitesbuf_t |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
153 { |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
154 program_t *Program; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
155 int64_t pts; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
156 int64_t dts; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
157 int started; /* ³ºÅöES¤¬ÃßÀѳ«»Ï¤·¤Æ¤¤¤ë¤« */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
158 int random_access_indicator; /* TS ¤Î random_access_indicator */ |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
159 int size; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
160 u_char buffer[3*1024*1024]; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
161 } splitesbuf_t; |
96
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
162 |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
163 /** |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
164 * splitter¹½Â¤ÂÎ |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
165 */ |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
166 typedef struct splitter { |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
167 unsigned char pids[MAX_PID]; |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
168 unsigned char pmt_pids[MAX_PID]; |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
169 unsigned char* pat; |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
170 char** sid_list; |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
171 unsigned char pat_count; |
100
aeba1988234f
support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
99
diff
changeset
|
172 int pmt_retain; |
96
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
173 int pmt_counter; |
100
aeba1988234f
support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
99
diff
changeset
|
174 int avail_pmts[MAX_SERVICES]; |
aeba1988234f
support macros to specify sid:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
99
diff
changeset
|
175 int num_pmts; |
119
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
176 // struct timespec tot_offset; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
177 // struct timespec STC_timespec; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
178 int64_t stc; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
179 int64_t cue_time; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
180 int status; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
181 splitpesbuf_t *pesbuf[MAX_PID]; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
182 splitesbuf_t *esbuf[MAX_PID]; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
183 program_t *program; |
4e7aaa72e158
ES out early release version.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
118
diff
changeset
|
184 int pid_sid_table[MAX_PID]; /* pid to sid ¤ÎÊÑ´¹¤ò¹Ô¤¦¤¿¤á¤Î¥Æ¡¼¥Ö¥ë */ |
96
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
185 } splitter; |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
186 |
99
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
187 /* 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
|
188 typedef struct _splitbuf_t |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
189 { |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
190 int size; |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
191 u_char buffer[1024*1024]; |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
192 } splitbuf_t; |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
193 |
96
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
194 splitter* split_startup(char *sid); |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
195 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
|
196 void split_shutdown(splitter *sp); |
3a3f15b063e1
now recpt1 accepts single sid for terrestrial channels.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
197 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
|
198 |
52f8e081763d
add an option to specify the necessary service IDs.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff
changeset
|
199 #endif |