libdvbpsi  1.3.0
pat.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * pat.h
00003  * Copyright (C) 2001-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  *
00022  *****************************************************************************/
00023 
00033 #ifndef _DVBPSI_PAT_H_
00034 #define _DVBPSI_PAT_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 /*****************************************************************************
00041  * dvbpsi_pat_program_t
00042  *****************************************************************************/
00054 typedef struct dvbpsi_pat_program_s
00055 {
00056   uint16_t                      i_number;               
00057   uint16_t                      i_pid;                  
00059   struct dvbpsi_pat_program_s * p_next;                 
00062 } dvbpsi_pat_program_t;
00063 
00064 
00065 /*****************************************************************************
00066  * dvbpsi_pat_t
00067  *****************************************************************************/
00079 typedef struct dvbpsi_pat_s
00080 {
00081   uint16_t                  i_ts_id;            
00082   uint8_t                   i_version;          
00083   bool                      b_current_next;     
00085   dvbpsi_pat_program_t *    p_first_program;    
00087 } dvbpsi_pat_t;
00088 
00089 
00090 /*****************************************************************************
00091  * dvbpsi_pat_callback
00092  *****************************************************************************/
00098 typedef void (* dvbpsi_pat_callback)(void* p_cb_data, dvbpsi_pat_t* p_new_pat);
00099 
00100 /*****************************************************************************
00101  * dvbpsi_pat_attach
00102  *****************************************************************************/
00111 bool dvbpsi_pat_attach(dvbpsi_t *p_dvbpsi, dvbpsi_pat_callback pf_callback,
00112                        void* p_cb_data);
00113 
00114 /*****************************************************************************
00115  * dvbpsi_pat_detach
00116  *****************************************************************************/
00125 void dvbpsi_pat_detach(dvbpsi_t *p_dvbpsi);
00126 
00127 /*****************************************************************************
00128  * dvbpsi_pat_init/dvbpsi_pat_new
00129  *****************************************************************************/
00140 void dvbpsi_pat_init(dvbpsi_pat_t* p_pat, uint16_t i_ts_id, uint8_t i_version,
00141                      bool b_current_next);
00142 
00152 dvbpsi_pat_t *dvbpsi_pat_new(uint16_t i_ts_id, uint8_t i_version, bool b_current_next);
00153 
00154 /*****************************************************************************
00155  * dvbpsi_pat_empty/dvbpsi_pat_delete
00156  *****************************************************************************/
00163 void dvbpsi_pat_empty(dvbpsi_pat_t* p_pat);
00164 
00171 void dvbpsi_pat_delete(dvbpsi_pat_t *p_pat);
00172 
00173 /*****************************************************************************
00174  * dvbpsi_pat_program_add
00175  *****************************************************************************/
00186 dvbpsi_pat_program_t* dvbpsi_pat_program_add(dvbpsi_pat_t* p_pat,
00187                                              uint16_t i_number, uint16_t i_pid);
00188 
00189 /*****************************************************************************
00190  * dvbpsi_pat_sections_generate
00191  *****************************************************************************/
00204 dvbpsi_psi_section_t* dvbpsi_pat_sections_generate(dvbpsi_t *p_dvbpsi,
00205                                             dvbpsi_pat_t* p_pat, int i_max_pps);
00206 
00207 #ifdef __cplusplus
00208 };
00209 #endif
00210 
00211 #else
00212 #error "Multiple inclusions of pat.h"
00213 #endif