• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

dvbpsi.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * dvbpsi.h
00003  * Copyright (C) 2001-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
00007  *          Jean-Paul Saman <jpsaman@videolan.org>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  *****************************************************************************/
00024 
00034 #ifndef _DVBPSI_DVBPSI_H_
00035 #define _DVBPSI_DVBPSI_H_
00036 
00037 #define DVBPSI_VERSION      1.0.0              
00038 #define DVBPSI_VERSION_INT  ((1<<16)+(0<<8)+0) 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 /*****************************************************************************
00045  * dvbpsi_t
00046  *****************************************************************************/
00051 typedef struct dvbpsi_s dvbpsi_t;
00052 
00057 typedef enum dvbpsi_msg_level
00058 {
00059     DVBPSI_MSG_NONE  = -1, 
00060     DVBPSI_MSG_ERROR =  0, 
00061     DVBPSI_MSG_WARN  =  1, 
00062     DVBPSI_MSG_DEBUG =  2, 
00063 } dvbpsi_msg_level_t;
00064 
00065 /*****************************************************************************
00066  * dvbpsi_message_cb
00067  *****************************************************************************/
00074 typedef void (* dvbpsi_message_cb)(dvbpsi_t *handle,
00075                                    const dvbpsi_msg_level_t level,
00076                                    const char* msg);
00077 
00078 /*****************************************************************************
00079  * dvbpsi_t
00080  *****************************************************************************/
00092 struct dvbpsi_s
00093 {
00094     void                         *p_private;            
00097     /* Messages callback */
00098     dvbpsi_message_cb             pf_message;           
00099     enum dvbpsi_msg_level         i_msg_level;          
00100 };
00101 
00102 /*****************************************************************************
00103  * dvbpsi_NewHandle
00104  *****************************************************************************/
00116 dvbpsi_t *dvbpsi_NewHandle(dvbpsi_message_cb callback, enum dvbpsi_msg_level level);
00117 
00118 /*****************************************************************************
00119  * dvbpsi_DeleteHandle
00120  *****************************************************************************/
00130 void dvbpsi_DeleteHandle(dvbpsi_t *handle);
00131 
00132 /*****************************************************************************
00133  * dvbpsi_PushPacket
00134  *****************************************************************************/
00144 bool dvbpsi_PushPacket(dvbpsi_t *p_dvbpsi, uint8_t* p_data);
00145 
00146 /*****************************************************************************
00147  * The following definitions are just here to allow external decoders but
00148  * shouldn't be used for any other purpose.
00149  *****************************************************************************/
00150 
00155 typedef struct dvbpsi_psi_section_s dvbpsi_psi_section_t;
00156 
00161 typedef struct dvbpsi_decoder_s dvbpsi_decoder_t;
00162 
00163 /*****************************************************************************
00164  * dvbpsi_callback
00165  *****************************************************************************/
00171 typedef void (* dvbpsi_callback)(dvbpsi_t *p_dvbpsi,
00172                                  dvbpsi_psi_section_t* p_section);
00173 
00174 /*****************************************************************************
00175  * dvbpsi_decoder_t
00176  *****************************************************************************/
00184 #define DVBPSI_DECODER_COMMON                                                     \
00185     dvbpsi_callback  pf_callback;                   \
00186     int      i_section_max_size;    \
00187     uint8_t  i_continuity_counter;                      \
00188     bool     b_discontinuity;                           \
00189     dvbpsi_psi_section_t *p_current_section;               \
00190     int      i_need;                                          \
00191     bool     b_complete_header;    
00193 struct dvbpsi_decoder_s
00194 {
00195     DVBPSI_DECODER_COMMON
00196 };
00197 
00198 /*****************************************************************************
00199  * dvbpsi_NewDecoder
00200  *****************************************************************************/
00214 dvbpsi_decoder_t *dvbpsi_NewDecoder(dvbpsi_callback callback,
00215     const int i_section_max_size, const bool b_discontinuity, const size_t psi_size);
00216 
00217 /*****************************************************************************
00218  * dvbpsi_DeleteDecoder
00219  *****************************************************************************/
00229 void dvbpsi_DeleteDecoder(dvbpsi_decoder_t *p_decoder);
00230 
00231 /*****************************************************************************
00232  * dvbpsi_HasDecoder
00233  *****************************************************************************/
00243 bool dvbpsi_HasDecoder(dvbpsi_t *p_dvbpsi);
00244 
00245 
00246 #ifdef __cplusplus
00247 };
00248 #endif
00249 
00250 #else
00251 #error "Multiple inclusions of dvbpsi.h"
00252 #endif

Generated on Sat May 19 2012 07:56:18 for libdvbpsi by  doxygen 1.7.1