1 /*****************************************************************************
3 *****************************************************************************/
4 #define TS_PACKET_SIZE 188 /* Size of a TS packet */
5 #define PSI_SECTION_SIZE 4096 /* Maximum size of a PSI section */
6 #define PADDING_PACKET_SIZE 100 /* Size of the NULL packet inserted in case
7 * of data loss (this should be < 188). */
10 /*****************************************************************************
12 *****************************************************************************
13 * Describes a PSI section. Beware, it doesn't contain pointers to the TS
14 * packets that contain it as for a PES, but the data themselves
15 *****************************************************************************/
16 typedef struct psi_section_s
18 byte_t buffer[PSI_SECTION_SIZE];
20 /* Is there a section being decoded ? */
21 boolean_t b_running_section;
24 u16 i_current_position;
27 /*****************************************************************************
28 * es_ts_data_t: extension of es_descriptor_t
29 *****************************************************************************/
30 typedef struct es_ts_data_s
32 boolean_t b_psi; /* Does the stream have to be handled by
33 * the PSI decoder ? */
34 psi_section_t * p_psi_section; /* PSI packets */
37 int i_continuity_counter;
40 /*****************************************************************************
41 * pgrm_ts_data_t: extension of pgrm_descriptor_t
42 *****************************************************************************/
43 typedef struct pgrm_ts_data_s
45 u16 i_pcr_pid; /* PCR ES, for TS streams */
48 /*****************************************************************************
49 * stream_ts_data_t: extension of stream_descriptor_t
50 *****************************************************************************/
51 typedef struct stream_ts_data_s
53 /* Program Association Table status */
54 u8 i_PAT_version; /* version number */
55 boolean_t b_is_PAT_complete; /* Is the PAT complete ? */
56 u8 i_known_PAT_sections;
57 /* Number of section we received so far */
58 byte_t a_known_PAT_sections[32];
59 /* Already received sections */
61 /* Program Map Table status */
62 boolean_t b_is_PMT_complete; /* Is the PMT complete ? */
63 u8 i_known_PMT_sections;
64 /* Number of section we received so far */
65 byte_t a_known_PMT_sections[32];
66 /* Already received sections */
68 /* Service Description Table status */
69 u8 i_SDT_version; /* version number */
70 boolean_t b_is_SDT_complete; /* Is the SDT complete ? */
71 u8 i_known_SDT_sections;
72 /* Number of section we received so far */
73 byte_t a_known_SDT_sections[32];
74 /* Already received sections */
77 /*****************************************************************************
78 * stream_ps_data_t: extension of stream_descriptor_t
79 *****************************************************************************/
80 typedef struct stream_ps_data_s
83 boolean_t b_is_PSM_complete;
87 /*****************************************************************************
89 *****************************************************************************/
90 void input_DecodePES( struct input_thread_s *, struct es_descriptor_s * );
91 void input_ParsePES( struct input_thread_s *, struct es_descriptor_s * );
92 void input_GatherPES( struct input_thread_s *, struct data_packet_s *,
93 struct es_descriptor_s *, boolean_t, boolean_t );
94 void input_DemuxPS( struct input_thread_s *, struct data_packet_s * );
95 void input_DemuxTS( struct input_thread_s *, struct data_packet_s * );