libdvbpsi  1.3.0
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  *          Jean-Paul Saman <jpsaman@videolan.org>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2.1 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00024  *
00025  *****************************************************************************/
00026 
00036 #ifndef _DVBPSI_NIT_H_
00037 #define _DVBPSI_NIT_H_
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
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  * dvbpsi_nit_t
00071  *****************************************************************************/
00083 typedef struct dvbpsi_nit_s
00084 {
00085     uint8_t              i_table_id;        
00086     uint16_t             i_extension;       
00088     uint16_t             i_network_id;       
00089     uint8_t              i_version;          
00090     bool                 b_current_next;     
00092     dvbpsi_descriptor_t *p_first_descriptor; 
00094     dvbpsi_nit_ts_t *    p_first_ts;         
00096 } dvbpsi_nit_t;
00097 
00098 /*****************************************************************************
00099  * dvbpsi_nit_callback
00100  *****************************************************************************/
00106 typedef void (* dvbpsi_nit_callback)(void* p_cb_data, dvbpsi_nit_t* p_new_nit);
00107 
00108 /*****************************************************************************
00109  * dvbpsi_nit_attach
00110  *****************************************************************************/
00122 bool dvbpsi_nit_attach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
00123                        dvbpsi_nit_callback pf_callback, void* p_cb_data);
00124 
00125 /*****************************************************************************
00126  * dvbpsi_nit_detach
00127  *****************************************************************************/
00137 void dvbpsi_nit_detach(dvbpsi_t* p_dvbpsi, uint8_t i_table_id,
00138                       uint16_t i_extension);
00139 
00140 /*****************************************************************************
00141  * dvbpsi_nit_init/dvbpsi_nit_new
00142  *****************************************************************************/
00155 void dvbpsi_nit_init(dvbpsi_nit_t* p_nit, uint8_t i_table_id, uint16_t i_extension,
00156                      uint16_t i_network_id, uint8_t i_version, bool b_current_next);
00157 
00170 dvbpsi_nit_t *dvbpsi_nit_new(uint8_t i_table_id, uint16_t i_extension,
00171                              uint16_t i_network_id, uint8_t i_version,
00172                              bool b_current_next);
00173 
00174 /*****************************************************************************
00175  * dvbpsi_nit_empty/dvbpsi_nit_delete
00176  *****************************************************************************/
00183 void dvbpsi_nit_empty(dvbpsi_nit_t* p_nit);
00184 
00191 void dvbpsi_nit_delete(dvbpsi_nit_t *p_nit);
00192 
00193 /*****************************************************************************
00194  * dvbpsi_nit_descriptor_add
00195  *****************************************************************************/
00208 dvbpsi_descriptor_t* dvbpsi_nit_descriptor_add(dvbpsi_nit_t *p_nit,
00209                                                uint8_t i_tag, uint8_t i_length,
00210                                                uint8_t *p_data);
00211 
00212 /*****************************************************************************
00213  * dvbpsi_nit_ts_add
00214  *****************************************************************************/
00224 dvbpsi_nit_ts_t* dvbpsi_nit_ts_add(dvbpsi_nit_t* p_nit,
00225                                  uint16_t i_ts_id, uint16_t i_orig_network_id);
00226 
00227 /*****************************************************************************
00228  * dvbpsi_nit_ts_descriptor_add
00229  *****************************************************************************/
00242 dvbpsi_descriptor_t* dvbpsi_nit_ts_descriptor_add(dvbpsi_nit_ts_t* p_ts,
00243                                                   uint8_t i_tag, uint8_t i_length,
00244                                                   uint8_t* p_data);
00245 
00246 /*****************************************************************************
00247  * dvbpsi_nit_sections_generate
00248  *****************************************************************************/
00260 dvbpsi_psi_section_t* dvbpsi_nit_sections_generate(dvbpsi_t* p_dvbpsi, dvbpsi_nit_t* p_nit,
00261                                             uint8_t i_table_id);
00262 
00263 #ifdef __cplusplus
00264 };
00265 #endif
00266 
00267 #else
00268 #error "Multiple inclusions of nit.h"
00269 #endif
00270