libdvbpsi  0.2.2
nit.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * nit.h
00003  * Copyright (C) 2001-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Johann Hanne
00007  *          heavily based on pmt.c which was written by
00008  *          Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  *****************************************************************************/
00025 
00035 #ifndef _DVBPSI_NIT_H_
00036 #define _DVBPSI_NIT_H_
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 
00043 /*****************************************************************************
00044  * dvbpsi_nit_ts_t
00045  *****************************************************************************/
00057 typedef struct dvbpsi_nit_ts_s
00058 {
00059   uint16_t                      i_ts_id;                
00060   uint16_t                      i_orig_network_id;      
00062   dvbpsi_descriptor_t *         p_first_descriptor;     
00064   struct dvbpsi_nit_ts_s *      p_next;                 
00067 } dvbpsi_nit_ts_t;
00068 
00069 
00070 /*****************************************************************************
00071  * dvbpsi_nit_t
00072  *****************************************************************************/
00084 typedef struct dvbpsi_nit_s
00085 {
00086   uint16_t                  i_network_id;       
00087   uint8_t                   i_version;          
00088   int                       b_current_next;     
00090   dvbpsi_descriptor_t *     p_first_descriptor; 
00092   dvbpsi_nit_ts_t *         p_first_ts;         
00094 } dvbpsi_nit_t;
00095 
00096 
00097 /*****************************************************************************
00098  * dvbpsi_nit_callback
00099  *****************************************************************************/
00105 typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
00106 
00107 
00108 /*****************************************************************************
00109  * dvbpsi_AttachNIT
00110  *****************************************************************************/
00123 __attribute__((deprecated))
00124 int dvbpsi_AttachNIT(dvbpsi_decoder_t * p_psi_decoder, uint8_t i_table_id,
00125                      uint16_t i_extension, dvbpsi_nit_callback pf_callback,
00126                      void* p_cb_data);
00127 
00128 
00129 /*****************************************************************************
00130  * dvbpsi_DetachNIT
00131  *****************************************************************************/
00141 __attribute__((deprecated))
00142 void dvbpsi_DetachNIT(dvbpsi_demux_t * p_demux, uint8_t i_table_id,
00143                       uint16_t i_extension);
00144 
00145 
00146 /*****************************************************************************
00147  * dvbpsi_InitNIT/dvbpsi_NewNIT
00148  *****************************************************************************/
00159 __attribute__((deprecated))
00160 void dvbpsi_InitNIT(dvbpsi_nit_t* p_nit, uint16_t i_network_id,
00161                     uint8_t i_version, int b_current_next);
00162 
00174 #define dvbpsi_NewNIT(p_nit, i_network_id,                              \
00175                       i_version, b_current_next)                        \
00176 do {                                                                    \
00177   p_nit = (dvbpsi_nit_t*)malloc(sizeof(dvbpsi_nit_t));                  \
00178   if(p_nit != NULL)                                                     \
00179     dvbpsi_InitNIT(p_nit, i_network_id, i_version, b_current_next);     \
00180 } while(0);
00181 
00182 
00183 /*****************************************************************************
00184  * dvbpsi_EmptyNIT/dvbpsi_DeleteNIT
00185  *****************************************************************************/
00192 __attribute__((deprecated))
00193 void dvbpsi_EmptyNIT(dvbpsi_nit_t* p_nit);
00194 
00201 #define dvbpsi_DeleteNIT(p_nit)                                         \
00202 do {                                                                    \
00203   dvbpsi_EmptyNIT(p_nit);                                               \
00204   free(p_nit);                                                          \
00205 } while(0);
00206 
00207 
00208 /*****************************************************************************
00209  * dvbpsi_NITAddDescriptor
00210  *****************************************************************************/
00223 __attribute__((deprecated))
00224 dvbpsi_descriptor_t* dvbpsi_NITAddDescriptor(dvbpsi_nit_t* p_nit,
00225                                              uint8_t i_tag, uint8_t i_length,
00226                                              uint8_t* p_data);
00227 
00228 
00229 /*****************************************************************************
00230  * dvbpsi_NITAddTS
00231  *****************************************************************************/
00241 __attribute__((deprecated))
00242 dvbpsi_nit_ts_t* dvbpsi_NITAddTS(dvbpsi_nit_t* p_nit,
00243                                  uint16_t i_ts_id, uint16_t i_orig_network_id);
00244 
00245 
00246 /*****************************************************************************
00247  * dvbpsi_NITTSAddDescriptor
00248  *****************************************************************************/
00261 __attribute__((deprecated))
00262 dvbpsi_descriptor_t* dvbpsi_NITTSAddDescriptor(dvbpsi_nit_ts_t* p_ts,
00263                                                uint8_t i_tag, uint8_t i_length,
00264                                                uint8_t* p_data);
00265 
00266 
00267 /*****************************************************************************
00268  * dvbpsi_GenNITSections
00269  *****************************************************************************/
00280 __attribute__((deprecated))
00281 dvbpsi_psi_section_t* dvbpsi_GenNITSections(dvbpsi_nit_t* p_nit,
00282                                             uint8_t i_table_id);
00283 
00284 
00285 #ifdef __cplusplus
00286 };
00287 #endif
00288 
00289 #else
00290 #error "Multiple inclusions of nit.h"
00291 #endif
00292