libdvbpsi  0.2.2
tot.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * tot.h
3  * Copyright (C) 2001-2011 VideoLAN
4  * $Id$
5  *
6  * Authors: Johann Hanne
7  * heavily based on pmt.c which was written by
8  * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  *****************************************************************************/
25 
35 #ifndef _DVBPSI_TOT_H_
36 #define _DVBPSI_TOT_H_
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /*****************************************************************************
44  * dvbpsi_tot_t
45  *****************************************************************************/
57 typedef struct dvbpsi_tot_s
58 {
59  uint64_t i_utc_time;
63  uint32_t i_crc;
65 } dvbpsi_tot_t;
66 
67 
68 /*****************************************************************************
69  * dvbpsi_tot_callback
70  *****************************************************************************/
76 typedef void (* dvbpsi_tot_callback)(void* p_cb_data, dvbpsi_tot_t* p_new_tot);
77 
78 
79 /*****************************************************************************
80  * dvbpsi_AttachTOT
81  *****************************************************************************/
93 __attribute__((deprecated))
94 int dvbpsi_AttachTOT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
95  uint16_t i_extension,
96  dvbpsi_tot_callback pf_callback, void* p_cb_data);
97 
98 
99 /*****************************************************************************
100  * dvbpsi_DetachTOT
101  *****************************************************************************/
110 __attribute__((deprecated))
111 void dvbpsi_DetachTOT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
112  uint16_t i_extension);
113 
114 
115 /*****************************************************************************
116  * dvbpsi_InitTOT/dvbpsi_NewTOT
117  *****************************************************************************/
125 __attribute__((deprecated))
126 void dvbpsi_InitTOT(dvbpsi_tot_t* p_tot, uint64_t i_utc_time);
127 
135 #define dvbpsi_NewTOT(p_tot, i_utc_time) \
136 do { \
137  p_tot = (dvbpsi_tot_t*)malloc(sizeof(dvbpsi_tot_t)); \
138  if(p_tot != NULL) \
139  dvbpsi_InitTOT(p_tot, i_utc_time); \
140 } while(0);
141 
142 
143 /*****************************************************************************
144  * dvbpsi_EmptyTOT/dvbpsi_DeleteTOT
145  *****************************************************************************/
152 __attribute__((deprecated))
153 void dvbpsi_EmptyTOT(dvbpsi_tot_t* p_tot);
154 
161 #define dvbpsi_DeleteTOT(p_tot) \
162 do { \
163  dvbpsi_EmptyTOT(p_tot); \
164  free(p_tot); \
165 } while(0);
166 
167 
168 /*****************************************************************************
169  * dvbpsi_TOTAddDescriptor
170  *****************************************************************************/
183 __attribute__((deprecated))
184 dvbpsi_descriptor_t* dvbpsi_TOTAddDescriptor(dvbpsi_tot_t* p_tot,
185  uint8_t i_tag, uint8_t i_length,
186  uint8_t* p_data);
187 
188 
189 /*****************************************************************************
190  * dvbpsi_GenTOTSections
191  *****************************************************************************/
200 __attribute__((deprecated))
201 dvbpsi_psi_section_t* dvbpsi_GenTOTSections(dvbpsi_tot_t* p_tot);
202 
203 
204 #ifdef __cplusplus
205 };
206 #endif
207 
208 #else
209 #error "Multiple inclusions of tot.h"
210 #endif
211