1 /*****************************************************************************
2 * ts.h: Transport Stream input module for VLC.
3 *****************************************************************************
4 * Copyright (C) 2004-2016 VLC authors and VideoLAN
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
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 Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
24 typedef struct arib_instance_t arib_instance_t
;
26 typedef struct csa_t csa_t
;
28 #define TS_USER_PMT_NUMBER (0)
30 #define TS_PSI_PAT_PID 0x00
32 typedef enum ts_standards_e
53 int current_seekpoint
;
57 /* TS packet size (188, 192, 204) */
58 unsigned i_packet_size
;
60 /* Additional TS packet header size (BluRay TS packets have 4-byte header before sync byte) */
61 unsigned i_packet_header_size
;
63 /* how many TS packet we read at once */
67 bool b_ignore_time_for_positions
;
69 ts_standards_e standard
;
74 arib_instance_t
*p_instance
;
87 NO_ES
, /* for preparse */
91 #define PREPARSING p_sys->es_creation == NO_ES
95 uint16_t i_next_extraid
;
100 bool b_valid_scrambling
;
105 bool b_access_control
;
109 time_t i_network_time
;
110 time_t i_network_time_update
; /* for network time interpolation */
111 bool b_broken_charset
; /* True if broken encoding is used in EPG/SDT */
113 /* Selected programs */
116 PROGRAM_AUTO_DEFAULT
, /* Always select first program sending data */
117 PROGRAM_LIST
, /* explicit list of programs, see list below */
118 PROGRAM_ALL
, /* everything */
119 } seltype
; /* reflects the DEMUX_SET_GROUP */
120 DECL_ARRAY( int ) programs
; /* List of selected/access-filtered programs */
121 bool b_default_selection
; /* True if set by default to first pmt seen (to get data from filtered access) */
125 mtime_t i_first_dts
; /* first dts encountered for the stream */
126 int i_timesourcepid
; /* which pid we saved the dts from */
127 enum { PAT_WAITING
= 0, PAT_MISSING
, PAT_FIXTRIED
} status
; /* set if we haven't seen PAT within MIN_PAT_INTERVAL */
132 /* downloadable content */
133 vlc_dictionary_t attachments
;
139 void TsChangeStandard( demux_sys_t
*, ts_standards_e
);
141 bool ProgramIsSelected( demux_sys_t
*, uint16_t i_pgrm
);
143 void UpdatePESFilters( demux_t
*p_demux
, bool b_all
);
145 int ProbeStart( demux_t
*p_demux
, int i_program
);
146 int ProbeEnd( demux_t
*p_demux
, int i_program
);
148 void AddAndCreateES( demux_t
*p_demux
, ts_pid_t
*pid
, bool b_create_delayed
);
149 int FindPCRCandidate( ts_pmt_t
*p_pmt
);