-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtssplitter_lite.h
76 lines (64 loc) · 2.08 KB
/
tssplitter_lite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* -*- tab-width: 4; indent-tabs-mode: t -*- */
/* tssplitter_lite.h -- split TS stream program's header.
Copyright 2009 querulous
Copyright 2010 Naoya OYAMA <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _TS_SPLITTER_LITE_H_
#define _TS_SPLITTER_LITE_H_
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <unistd.h>
#define LENGTH_PACKET (188)
#define MAX_PID (8192)
#define MAX_SERVICES (50)
#define LENGTH_CRC_DATA (176)
#define false (0)
#define true (1)
#define TSS_SUCCESS (0)
#define TSS_ERROR (-1)
#define TSS_NULL (-2)
#define LENGTH_PAT_HEADER (12)
#define C_CHAR_COMMA ','
#define SECTION_CONTINUE (1)
typedef struct _pmt_version {
int pid;
int version;
int packet;
} PMT_version;
/**
* splitter構造体
*/
typedef struct _splitter {
unsigned char pids[MAX_PID];
unsigned char pmt_pids[MAX_PID];
unsigned char* pat;
char** sid_list;
unsigned char pat_count;
int pmt_retain;
int pmt_counter;
int avail_pmts[MAX_SERVICES];
PMT_version pmt_version[MAX_SERVICES];
int num_pmts;
uint16_t section_remain[MAX_PID]; // セクション残りバイト数
uint8_t packet_seq[MAX_PID]; // 巡回カウンタ
} Splitter;
typedef struct _splitbuf_t
{
u_char* buffer;
int buffer_size;
int buffer_filled;
} splitbuf_t;
Splitter* split_startup(char *sid);
int split_select(Splitter *sp, ARIB_STD_B25_BUFFER *sbuf);
void split_shutdown(Splitter *sp);
int split_ts(Splitter *splitter, ARIB_STD_B25_BUFFER *sbuf, splitbuf_t *dbuf);
#endif