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

sis.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * sis.h
00003  * Copyright (c) 2010-2011 VideoLAN
00004  * $Id$
00005  *
00006  * Authors: Jean-Paul Saman <jpsaman@videolan.org>
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_SIS_H_
00034 #define _DVBPSI_SIS_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 /*****************************************************************************
00041  * dvbpsi_sis_t
00042  *****************************************************************************/
00054 typedef struct dvbpsi_sis_s
00055 {
00056   /* section */
00057   uint8_t                   i_protocol_version;     
00060   /* encryption */
00061   bool                      b_encrypted_packet;     
00063   uint8_t                   i_encryption_algorithm; 
00066   uint64_t                  i_pts_adjustment;       
00067   uint8_t                   cw_index;               
00069   /* splice command */
00070   uint16_t                  i_splice_command_length;
00071   uint8_t                   i_splice_command_type;  
00073   /* Splice Command:
00074    * splice_command_type     splice_info_section
00075    *    0x00                    splice_null()
00076    *    0x01                    reserved
00077    *    0x02                    reserved
00078    *    0x03                    reserved
00079    *    0x04                    splice_schedule()
00080    *    0x05                    splice_insert()
00081    *    0x06                    time_signal()
00082    *    0x07                    bandwidth_reservation()
00083    *    0x08 - 0xff             reserved
00084    */
00085   void                      *p_splice_command;      
00088   /* descriptors */
00089   uint16_t                  i_descriptors_length;   
00091   dvbpsi_descriptor_t       *p_first_descriptor;     
00094   /* FIXME: alignment stuffing */
00095   uint32_t i_ecrc; 
00097 } dvbpsi_sis_t;
00098 
00099 /*****************************************************************************
00100  * Splice Commands
00101  *****************************************************************************/
00110 typedef struct dvbpsi_sis_cmd_splice_null_s
00111 {
00112     /* nothing */
00113 } dvbpsi_sis_cmd_splice_null_t;
00114 
00119 typedef struct dvbpsi_sis_break_duration_s
00120 {
00121     bool        b_auto_return;  
00125     uint64_t    i_duration;     
00129 } dvbpsi_sis_break_duration_t;
00130 
00135 typedef struct dvbpsi_sis_component_utc_splice_time_s dvbpsi_sis_component_utc_splice_time_s;
00136 struct dvbpsi_sis_component_utc_splice_time_s
00137 {
00138     uint8_t     component_tag;      
00141     uint32_t    i_utc_splice_time;  
00147     dvbpsi_sis_component_utc_splice_time_s *p_next; 
00148 };
00149 
00154 typedef struct dvbpsi_sis_splice_event_s dvbpsi_sis_splice_event_t;
00155 struct dvbpsi_sis_splice_event_s
00156 {
00157     uint32_t        i_splice_event_id;               
00158     bool            b_splice_event_cancel_indicator; 
00160     /* if (!b_splice_event_cancel_indicator) */
00161     bool            b_out_of_network_indicator; 
00162     bool            b_program_splice_flag;      
00163     bool            b_duration_flag;            
00164     /*      if (b_program_splice_flag) */
00165     uint32_t        i_utc_splice_time;          
00170     /*      if (!b_program_splice_flag) */
00171     uint8_t         i_component_count;          
00174     dvbpsi_sis_component_utc_splice_time_s  *p_data;
00178     /*      if (b_duration_flag) */
00179     dvbpsi_sis_break_duration_t *p_break_duration;     
00181     /* */
00182 
00183     uint16_t        i_unique_program_id; 
00185     uint8_t         i_avail_num;         
00187     uint8_t         i_avails_expected;   
00189     /* end */
00190 
00191     dvbpsi_sis_splice_event_t *p_next;   
00192 };
00193 
00198 typedef struct dvbpsi_sis_cmd_splice_schedule_s
00199 {
00200     uint8_t                     i_splice_count; 
00201     dvbpsi_sis_splice_event_t  *p_splice_event; 
00202 } dvbpsi_sis_cmd_splice_schedule_t;
00203 
00208 typedef struct dvbpsi_sis_splice_time_s dvbpsi_sis_splice_time_t;
00209 struct dvbpsi_sis_splice_time_s
00210 {
00211     bool        b_time_specified_flag; 
00212     /* if (b_time_specified_flag) */
00213     uint64_t    i_pts_time;        
00216     /* else reserved */
00217     /* end */
00218 
00219     dvbpsi_sis_splice_time_t *p_next; 
00220 };
00221 
00226 typedef struct dvbpsi_sis_component_splice_time_s dvbpsi_sis_component_splice_time_t;
00227 struct dvbpsi_sis_component_splice_time_s
00228 {
00229     uint8_t     i_component_tag;    
00232     /* if (splice_immediate_flag) */
00233     dvbpsi_sis_splice_time_t *p_splice_time; 
00234     /* */
00235 
00236     dvbpsi_sis_component_splice_time_t *p_next; 
00237 };
00238 
00243 typedef struct dvbpsi_sis_cmd_splice_insert_s
00244 {
00245     uint32_t        i_splice_event_id;               
00246     bool            b_splice_event_cancel_indicator; 
00248     /* if (!b_splice_event_cancel_indicator) */
00249     bool            b_out_of_network_indicator; 
00250     bool            b_program_splice_flag;      
00251     bool            b_duration_flag;            
00252     bool            b_splice_immediate_flag;    
00254     /*      if (b_program_splice_flag) && (!b_splice_immediate_flag) */
00255     dvbpsi_sis_splice_time_t *p_splice_time;           
00257     /*      if (!b_program_splice_flag) */
00258     uint8_t         i_component_count;           
00260     dvbpsi_sis_component_splice_time_t  *p_data; 
00263     /*      if (b_duration_flag) */
00264     dvbpsi_sis_break_duration_t *p_break_duration; 
00266     /* */
00267     uint16_t        i_unique_program_id;      
00268     uint8_t         i_avail_num;              
00270     uint8_t         i_avails_expected;        
00272     /* end */
00273 } dvbpsi_sis_cmd_splice_insert_t;
00274 
00279 typedef struct dvbpsi_sis_cmd_time_signal_s
00280 {
00281     dvbpsi_sis_splice_time_t *p_splice_time;       
00282 } dvbpsi_sis_cmd_time_signal_t;
00283 
00288 typedef struct dvbpsi_sis_cmd_bandwidth_reservation_s
00289 {
00290     /* nothing */
00291 } dvbpsi_sis_cmd_bandwidth_reservation_t;
00292 
00293 /*****************************************************************************
00294  * dvbpsi_sis_callback
00295  *****************************************************************************/
00301 typedef void (* dvbpsi_sis_callback)(void* p_cb_data, dvbpsi_sis_t* p_new_sis);
00302 
00303 /*****************************************************************************
00304  * dvbpsi_AttachSIS
00305  *****************************************************************************/
00318 bool dvbpsi_AttachSIS(dvbpsi_t* p_dvbpsi, uint8_t i_table_id, uint16_t i_extension,
00319                       dvbpsi_sis_callback pf_callback, void* p_cb_data);
00320 
00321 /*****************************************************************************
00322  * dvbpsi_DetachSIS
00323  *****************************************************************************/
00333 void dvbpsi_DetachSIS(dvbpsi_t *p_dvbpsi, uint8_t i_table_id, uint16_t i_extension);
00334 
00335 /*****************************************************************************
00336  * dvbpsi_InitSIS/dvbpsi_NewSIS
00337  *****************************************************************************/
00345 void dvbpsi_InitSIS(dvbpsi_sis_t *p_sis, uint8_t i_protocol_version);
00346 
00353 dvbpsi_sis_t* dvbpsi_NewSIS(uint8_t i_protocol_version);
00354 
00355 /*****************************************************************************
00356  * dvbpsi_EmptySIS/dvbpsi_DeleteSIS
00357  *****************************************************************************/
00364 void dvbpsi_EmptySIS(dvbpsi_sis_t *p_sis);
00365 
00372 void dvbpsi_DeleteSIS(dvbpsi_sis_t *p_sis);
00373 
00374 /*****************************************************************************
00375  * dvbpsi_SISAddDescriptor
00376  *****************************************************************************/
00388 dvbpsi_descriptor_t *dvbpsi_SISAddDescriptor(dvbpsi_sis_t *p_sis,
00389                                              uint8_t i_tag, uint8_t i_length,
00390                                              uint8_t *p_data);
00391 
00392 /*****************************************************************************
00393  * dvbpsi_GenSISSections
00394  *****************************************************************************
00395  * Generate SIS sections based on the dvbpsi_sis_t structure.
00396  *****************************************************************************/
00406 dvbpsi_psi_section_t *dvbpsi_GenSISSections(dvbpsi_t *p_dvbpsi, dvbpsi_sis_t * p_sis);
00407 
00408 #ifdef __cplusplus
00409 };
00410 #endif
00411 
00412 #else
00413 #error "Multiple inclusions of sis.h"
00414 #endif
00415 

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