libdvbpsi  1.3.0
cat.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * cat.h
00003  * Copyright (C) 2001-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Johann Hanne
00007  *          heavily based on pmt.h 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_CAT_H_
00037 #define _DVBPSI_CAT_H_
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 /*****************************************************************************
00044  * dvbpsi_cat_t
00045  *****************************************************************************/
00057 typedef struct dvbpsi_cat_s
00058 {
00059   uint8_t                   i_version;          
00060   bool                      b_current_next;     
00062   dvbpsi_descriptor_t *     p_first_descriptor; 
00064 } dvbpsi_cat_t;
00065 
00066 /*****************************************************************************
00067  * dvbpsi_cat_callback
00068  *****************************************************************************/
00074 typedef void (* dvbpsi_cat_callback)(void* p_cb_data, dvbpsi_cat_t* p_new_cat);
00075 
00076 /*****************************************************************************
00077  * dvbpsi_cat_attach
00078  *****************************************************************************/
00088 bool dvbpsi_cat_attach(dvbpsi_t *p_dvbpsi, dvbpsi_cat_callback pf_callback,
00089                       void* p_cb_data);
00090 
00091 /*****************************************************************************
00092  * dvbpsi_cat_detach
00093  *****************************************************************************/
00103 void dvbpsi_cat_detach(dvbpsi_t *p_dvbpsi);
00104 
00105 /*****************************************************************************
00106  * dvbpsi_cat_init/dvbpsi_cat_new
00107  *****************************************************************************/
00117 void dvbpsi_cat_init(dvbpsi_cat_t* p_cat,
00118                     uint8_t i_version, bool b_current_next);
00119 
00128 dvbpsi_cat_t *dvbpsi_cat_new(uint8_t i_version, bool b_current_next);
00129 
00130 /*****************************************************************************
00131  * dvbpsi_cat_empty/dvbpsi_cat_delete
00132  *****************************************************************************/
00139 void dvbpsi_cat_empty(dvbpsi_cat_t* p_cat);
00140 
00147 void dvbpsi_cat_delete(dvbpsi_cat_t *p_cat);
00148 
00149 /*****************************************************************************
00150  * dvbpsi_cat_descriptor_add
00151  *****************************************************************************/
00164 dvbpsi_descriptor_t* dvbpsi_cat_descriptor_add(dvbpsi_cat_t* p_cat,
00165                                                uint8_t i_tag, uint8_t i_length,
00166                                                uint8_t* p_data);
00167 
00168 /*****************************************************************************
00169  * dvbpsi_cat_sections_generate
00170  *****************************************************************************/
00180 dvbpsi_psi_section_t* dvbpsi_cat_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_cat_t* p_cat);
00181 
00182 #ifdef __cplusplus
00183 };
00184 #endif
00185 
00186 #else
00187 #error "Multiple inclusions of cat.h"
00188 #endif
00189