static bool dvbpsi_AddSectionCAT(dvbpsi_t *p_dvbpsi, dvbpsi_cat_decoder_t *p_decoder, dvbpsi_psi_section_t* p_section) { assert(p_dvbpsi); assert(p_decoder); assert(p_section); /* Initialize the structures if it's the first section received */ if (p_decoder->p_building_cat == NULL) { p_decoder->p_building_cat = dvbpsi_cat_new(p_section->i_version, p_section->b_current_next); if (p_decoder->p_building_cat == NULL) return false; p_decoder->i_last_section_number = p_section->i_last_number; } /* Add to linked list of sections */ if (dvbpsi_decoder_psi_section_add(DVBPSI_DECODER(p_decoder), p_section)) dvbpsi_debug(p_dvbpsi, "CAT decoder", "overwrite section number %d", p_section->i_number); return true; }
static bool dvbpsi_AddSectionTOT(dvbpsi_t *p_dvbpsi, dvbpsi_tot_decoder_t *p_tot_decoder, dvbpsi_psi_section_t* p_section) { assert(p_dvbpsi); assert(p_tot_decoder); assert(p_section); /* Initialize the structures if it's the first section received */ if (!p_tot_decoder->p_building_tot) { p_tot_decoder->p_building_tot = dvbpsi_tot_new( p_section->i_table_id, p_section->i_extension, p_section->i_version, p_section->b_current_next, ((uint64_t)p_section->p_payload_start[0] << 32) | ((uint64_t)p_section->p_payload_start[1] << 24) | ((uint64_t)p_section->p_payload_start[2] << 16) | ((uint64_t)p_section->p_payload_start[3] << 8) | (uint64_t)p_section->p_payload_start[4]); if (p_tot_decoder->p_building_tot == NULL) return false; p_tot_decoder->i_last_section_number = p_section->i_last_number; } /* Add to linked list of sections */ if (dvbpsi_decoder_psi_section_add(DVBPSI_DECODER(p_tot_decoder), p_section)) dvbpsi_debug(p_dvbpsi, "TOT decoder", "overwrite section number %d", p_section->i_number); return true; }
static bool dvbpsi_AddSectionPMT( dvbpsi_t *p_dvbpsi, dvbpsi_pmt_decoder_t *p_pmt_decoder, dvbpsi_psi_section_t* p_section ) { assert( p_dvbpsi ); assert( p_pmt_decoder ); assert( p_section ); /* Initialize the structures if it's the first section received */ if ( p_pmt_decoder->p_building_pmt == NULL ) { p_pmt_decoder->p_building_pmt = dvbpsi_pmt_new( p_pmt_decoder->i_program_number, p_section->i_version, p_section->b_current_next, ( (uint16_t) (p_section->p_payload_start[0] & 0x1f) << 8)//0x02 | p_section->p_payload_start[1] );// 0xb0 if ( p_pmt_decoder->p_building_pmt == NULL ) return(false); p_pmt_decoder->i_last_section_number = p_section->i_last_number; } /* Add to linked list of sections */ if ( dvbpsi_decoder_psi_section_add( DVBPSI_DECODER( p_pmt_decoder ), p_section ) ) dvbpsi_debug( p_dvbpsi, "PMT decoder", "overwrite section number %d", p_section->i_number ); return(true); }
static bool dvbpsi_AddSectionETT(dvbpsi_t *p_dvbpsi, dvbpsi_atsc_ett_decoder_t *p_decoder, dvbpsi_psi_section_t* p_section) { assert(p_dvbpsi); assert(p_decoder); assert(p_section); /* Initialize the structures if it's the first section received */ if (!p_decoder->p_building_ett) { uint32_t i_etm_id = ((uint32_t)p_section->p_payload_start[1] << 24) | ((uint32_t)p_section->p_payload_start[2] << 16) | ((uint32_t)p_section->p_payload_start[3] << 8) | ((uint32_t)p_section->p_payload_start[4] << 0); p_decoder->p_building_ett = dvbpsi_atsc_NewETT(p_section->i_table_id, p_section->i_extension, p_section->i_version, p_section->p_payload_start[0], i_etm_id, p_section->b_current_next); if (!p_decoder->p_building_ett) return false; p_decoder->i_last_section_number = p_section->i_last_number; } /* Add to linked list of sections */ if (dvbpsi_decoder_psi_section_add(DVBPSI_DECODER(p_decoder), p_section)) dvbpsi_debug(p_dvbpsi, "ATSC ETT decoder", "overwrite section number %d", p_section->i_number); return true; }