libdvbpsi  1.2.0
psi.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * psi.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id: psi.h,v 1.6 2002/04/02 17:55:30 bozo Exp $
5  *
6  * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  *****************************************************************************/
23 
32 #ifndef _DVBPSI_PSI_H_
33 #define _DVBPSI_PSI_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*****************************************************************************
40  * dvbpsi_psi_section_t
41  *****************************************************************************/
69 {
70  /* non-specific section data */
71  uint8_t i_table_id;
74  uint16_t i_length;
76  /* used if b_syntax_indicator is true */
77  uint16_t i_extension;
80  uint8_t i_version;
82  uint8_t i_number;
83  uint8_t i_last_number;
85  /* non-specific section data */
86  /* the content is table-specific */
87  uint8_t * p_data;
88  uint8_t * p_payload_start;
89  uint8_t * p_payload_end;
91  /* used if b_syntax_indicator is true */
92  uint32_t i_crc;
94  /* list handling */
97 };
98 
99 /*****************************************************************************
100  * dvbpsi_NewPSISection
101  *****************************************************************************/
109 
110 /*****************************************************************************
111  * dvbpsi_DeletePSISections
112  *****************************************************************************/
120 
121 /*****************************************************************************
122  * dvbpsi_CheckPSISection
123  *****************************************************************************/
135 bool dvbpsi_CheckPSISection(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t *p_section,
136  const uint8_t table_id, const char *psz_table_name);
137 
138 /*****************************************************************************
139  * dvbpsi_ValidPSISection
140  *****************************************************************************/
151 
152 /*****************************************************************************
153  * dvbpsi_BuildPSISection
154  *****************************************************************************/
162 void dvbpsi_BuildPSISection(dvbpsi_t *p_dvbpsi, dvbpsi_psi_section_t* p_section);
163 
164 /*****************************************************************************
165  * dvbpsi_CalculateCRC32
166  *****************************************************************************/
176 
177 /*****************************************************************************
178  * dvbpsi_has_CRC32
179  *****************************************************************************/
188 static inline bool dvbpsi_has_CRC32(dvbpsi_psi_section_t *p_section)
189 {
190  if ((p_section->i_table_id == (uint8_t) 0x70) /* TDT (has no CRC 32) */ ||
191  (p_section->i_table_id == (uint8_t) 0x71) /* RST (has no CRC 32) */ ||
192  (p_section->i_table_id == (uint8_t) 0x72) /* ST (has no CRC 32) */ ||
193  (p_section->i_table_id == (uint8_t) 0x7E))/* DIT (has no CRC 32) */
194  return false;
195 
196  return (p_section->b_syntax_indicator || (p_section->i_table_id == 0x73));
197 }
198 
199 #ifdef __cplusplus
200 };
201 #endif
202 
203 #else
204 #error "Multiple inclusions of psi.h"
205 #endif
206