dnl libdvbpsi check for ts mux/demux
dnl
have_dvbpsi="no"
-PKG_WITH_MODULES([DVBPSI], [libdvbpsi], [have_dvbpsi="yes"])
+PKG_WITH_MODULES([DVBPSI], [libdvbpsi >= 1.0.0], [have_dvbpsi="yes"])
AM_CONDITIONAL(HAVE_DVBPSI, [test "${have_dvbpsi}" = "yes"])
if ( !b_needs_descrambling )
{
- dvbpsi_DeletePMT( p_pmt );
+ dvbpsi_pmt_delete( p_pmt );
p_pmt = p_cam->pp_selected_programs[i];
p_cam->pp_selected_programs[i] = NULL;
}
else if( p_pmt != p_cam->pp_selected_programs[i] )
{
- dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
+ dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
p_cam->pp_selected_programs[i] = p_pmt;
}
if ( !b_needs_descrambling )
{
- dvbpsi_DeletePMT( p_pmt );
+ dvbpsi_pmt_delete( p_pmt );
}
return VLC_SUCCESS;
{
if( p_cam->pp_selected_programs[i] != NULL )
{
- dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
+ dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
}
}
scan_configuration_t cfg;
int i_snr;
- dvbpsi_handle pat;
+ dvbpsi_t *pat;
dvbpsi_pat_t *p_pat;
int i_nit_pid;
- dvbpsi_handle sdt;
+ dvbpsi_t *sdt;
dvbpsi_sdt_t *p_sdt;
#ifdef DVBPSI_USE_NIT
- dvbpsi_handle nit;
+ dvbpsi_t *nit;
dvbpsi_nit_t *p_nit;
#else
# warning NIT is not supported by your libdvbpsi version
/* */
if( p_session->p_pat && p_session->p_pat->b_current_next )
{
- dvbpsi_DeletePAT( p_session->p_pat );
+ dvbpsi_pat_delete( p_session->p_pat );
p_session->p_pat = NULL;
}
if( p_session->p_pat )
{
- dvbpsi_DeletePAT( p_pat );
+ dvbpsi_pat_delete( p_pat );
return;
}
if( p_session->p_sdt && p_session->p_sdt->b_current_next )
{
- dvbpsi_DeleteSDT( p_session->p_sdt );
+ dvbpsi_sdt_delete( p_session->p_sdt );
p_session->p_sdt = NULL;
}
if( p_session->p_sdt )
{
- dvbpsi_DeleteSDT( p_sdt );
+ dvbpsi_sdt_delete( p_sdt );
return;
}
/* */
msg_Dbg( p_obj, "new SDT ts_id=%d version=%d current_next=%d network_id=%d",
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_sdt->i_extension,
-#else
- p_sdt->i_ts_id,
-#endif
p_sdt->i_version, p_sdt->b_current_next,
p_sdt->i_network_id );
/* */
if( p_session->p_nit && p_session->p_nit->b_current_next )
{
- dvbpsi_DeleteNIT( p_session->p_nit );
+ dvbpsi_nit_delete( p_session->p_nit );
p_session->p_nit = NULL;
}
if( p_session->p_nit )
{
- dvbpsi_DeleteNIT( p_nit );
+ dvbpsi_nit_delete( p_nit );
return;
}
}
#endif
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id, uint16_t i_extension, void *p_data )
{
scan_session_t *p_session = (scan_session_t *)p_data;
msg_Err( p_session->p_obj, "PSINewTableCallback: failed attaching NITCallback" );
}
}
-#else
-static void PSINewTableCallBack( scan_session_t *p_session, dvbpsi_handle h, uint8_t i_table_id, uint16_t i_extension )
-{
- if( i_table_id == 0x42 )
- dvbpsi_AttachSDT( h, i_table_id, i_extension, (dvbpsi_sdt_callback)SDTCallBack, p_session );
-# ifdef DVBPSI_USE_NIT
- else if( i_table_id == 0x40 || i_table_id == 0x41 )
- dvbpsi_AttachNIT( h, i_table_id, i_extension, (dvbpsi_nit_callback)NITCallBack, p_session );
-# endif
-}
-#endif
scan_session_t *scan_session_New( vlc_object_t *p_obj,
const scan_configuration_t *p_cfg )
/* */
if( p_session->pat )
- dvbpsi_DetachPAT( p_session->pat );
+ dvbpsi_pat_detach( p_session->pat );
if( p_session->p_pat )
- dvbpsi_DeletePAT( p_session->p_pat );
+ dvbpsi_pat_delete( p_session->p_pat );
if( p_session->sdt )
dvbpsi_DetachDemux( p_session->sdt );
if( p_session->p_sdt )
- dvbpsi_DeleteSDT( p_session->p_sdt );
+ dvbpsi_sdt_delete( p_session->p_sdt );
#ifdef DVBPSI_USE_NIT
if( p_session->nit )
dvbpsi_DetachDemux( p_session->nit );
if( p_session->p_nit )
- dvbpsi_DeleteNIT( p_session->p_nit );
+ dvbpsi_nit_delete( p_session->p_nit );
#endif
free( p_session );
}
if( i_pid == 0x00 )
{
if( !p_scan->pat )
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
{
p_scan->pat = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !p_scan->pat )
return false;
}
}
-#else
- p_scan->pat = dvbpsi_AttachPAT( (dvbpsi_pat_callback)PATCallBack, p_scan );
-#endif
if( p_scan->pat )
- dvbpsi_PushPacket( p_scan->pat, p_block->p_buffer );
+ dvbpsi_packet_push( p_scan->pat, p_block->p_buffer );
}
else if( i_pid == 0x11 )
{
if( !p_scan->sdt )
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
{
p_scan->sdt = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !p_scan->sdt )
return false;
}
}
-#else
- p_scan->sdt = dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack, p_scan );
-#endif
if( p_scan->sdt )
- dvbpsi_PushPacket( p_scan->sdt, p_block->p_buffer );
+ dvbpsi_packet_push( p_scan->sdt, p_block->p_buffer );
}
else /*if( i_pid == p_scan->i_nit_pid )*/
{
#ifdef DVBPSI_USE_NIT
if( !p_scan->nit )
-# if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
{
p_scan->nit = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !p_scan->nit )
return false;
}
}
-# else
- p_scan->nit = dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack, p_scan );
-# endif
if( p_scan->nit )
- dvbpsi_PushPacket( p_scan->nit, p_block->p_buffer );
+ dvbpsi_packet_push( p_scan->nit, p_block->p_buffer );
#endif
}
typedef struct
{
- dvbpsi_handle handle;
+ dvbpsi_t *handle;
int i_version;
int i_number;
int i_pid_pcr;
typedef struct
{
/* for special PAT/SDT case */
- dvbpsi_handle handle; /* PAT/SDT/EIT */
+ dvbpsi_t *handle; /* PAT/SDT/EIT */
int i_pat_version;
int i_sdt_version;
int i_ts_id;
static void PATCallBack( void*, dvbpsi_pat_t * );
static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
static void PSINewTableCallBack( dvbpsi_t *handle, uint8_t i_table_id,
uint16_t i_extension, demux_t * );
-#else
-static void PSINewTableCallBack( demux_t *, dvbpsi_handle,
- uint8_t i_table_id, uint16_t i_extension );
-#endif
static int ChangeKeyCallback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * );
return DetectPacketSize( p_demux, pi_header_size, 0 );
}
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
static void vlc_dvbpsi_reset( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
tdt->psi->handle = NULL;
}
}
-#endif
static inline mtime_t ExtractPESTimestamp( const uint8_t *p_data )
{
static void BuildPATCallback( void *p_opaque, block_t *p_block )
{
ts_pid_t *pat_pid = (ts_pid_t *) p_opaque;
- dvbpsi_PushPacket( pat_pid->psi->handle, p_block->p_buffer );
+ dvbpsi_packet_push( pat_pid->psi->handle, p_block->p_buffer );
}
static void BuildPMTCallback( void *p_opaque, block_t *p_block )
{
for( int i_prg = 0; i_prg < program_pid->psi->i_prg; i_prg++ )
{
- dvbpsi_PushPacket( program_pid->psi->prg[i_prg]->handle,
+ dvbpsi_packet_push( program_pid->psi->prg[i_prg]->handle,
p_block->p_buffer );
}
p_block = p_block->p_next;
.b_discontinuity = false
};
- BuildPAT( DVBPSI_HANDLE_PARAM(p_sys->pid[0].psi->handle)
+ BuildPAT( p_sys->pid[0].psi->handle,
&p_sys->pid[0], BuildPATCallback,
0, 1,
&patstream,
j++;
}
- BuildPMT( DVBPSI_HANDLE_PARAM(p_sys->pid[0].psi->handle) VLC_OBJECT(p_demux),
+ BuildPMT( p_sys->pid[0].psi->handle, VLC_OBJECT(p_demux),
&p_sys->pid[i_program_pid], BuildPMTCallback,
0, 1,
i_pcr_pid,
p_sys->csa = NULL;
p_sys->b_start_record = false;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
# define VLC_DVBPSI_DEMUX_TABLE_INIT(table,obj) \
do { \
(table)->psi->handle = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG ); \
return VLC_EGENERIC; \
} \
} while (0);
-#endif
/* Init PAT handler */
pat = &p_sys->pid[0];
PIDInit( pat, true, NULL );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
pat->psi->handle = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !pat->psi->handle )
{
free( p_sys );
return VLC_EGENERIC;
}
-#else
- pat->psi->handle = dvbpsi_AttachPAT( PATCallBack, p_demux );
-#endif
+
if( p_sys->b_dvb_meta )
{
ts_pid_t *sdt = &p_sys->pid[0x11];
ts_pid_t *eit = &p_sys->pid[0x12];
PIDInit( sdt, true, NULL );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
VLC_DVBPSI_DEMUX_TABLE_INIT( sdt, p_demux )
-#else
- sdt->psi->handle =
- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
-#endif
+
PIDInit( eit, true, NULL );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
VLC_DVBPSI_DEMUX_TABLE_INIT( eit, p_demux )
-#else
- eit->psi->handle =
- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
-#endif
+
ts_pid_t *tdt = &p_sys->pid[0x14];
PIDInit( tdt, true, NULL );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
VLC_DVBPSI_DEMUX_TABLE_INIT( tdt, p_demux )
-#else
- tdt->psi->handle =
- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
-#endif
if( p_sys->b_access_control )
{
}
}
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
# undef VLC_DVBPSI_DEMUX_TABLE_INIT
-#endif
/* Init PMT array */
TAB_INIT( p_sys->i_pmt, p_sys->pmt );
switch( pid->i_pid )
{
case 0: /* PAT */
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
if( dvbpsi_decoder_present( pid->psi->handle ) )
dvbpsi_pat_detach( pid->psi->handle );
dvbpsi_delete( pid->psi->handle );
pid->psi->handle = NULL;
-#else
- dvbpsi_DetachPAT( pid->psi->handle );
-#endif
free( pid->psi );
break;
case 1: /* CAT */
{
/* SDT or EIT or TDT */
dvbpsi_DetachDemux( pid->psi->handle );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
dvbpsi_delete( pid->psi->handle );
pid->psi->handle = NULL;
-#endif
free( pid->psi );
}
else
{
if( p_pid->i_pid == 0 || ( p_sys->b_dvb_meta && ( p_pid->i_pid == 0x11 || p_pid->i_pid == 0x12 || p_pid->i_pid == 0x14 ) ) )
{
- dvbpsi_PushPacket( p_pid->psi->handle, p_pkt->p_buffer );
+ dvbpsi_packet_push( p_pid->psi->handle, p_pkt->p_buffer );
}
else
{
for( int i_prg = 0; i_prg < p_pid->psi->i_prg; i_prg++ )
{
- dvbpsi_PushPacket( p_pid->psi->prg[i_prg]->handle,
+ dvbpsi_packet_push( p_pid->psi->prg[i_prg]->handle,
p_pkt->p_buffer );
}
}
prg->i_pid_pmt = -1;
prg->i_version = -1;
prg->i_number = i_number != 0 ? i_number : TS_USER_PMT_NUMBER;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
prg->handle = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !prg->handle )
goto error;
prg->handle = NULL;
goto error;
}
-#else
- prg->handle = dvbpsi_AttachPMT(
- ((i_number != TS_USER_PMT_NUMBER) ? i_number : 1),
- PMTCallBack, p_demux );
-#endif
TAB_APPEND( pmt->psi->i_prg, pmt->psi->prg, prg );
psz = strchr( psz, '=' );
{
if( pid->psi->handle )
{
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
if( dvbpsi_decoder_present( pid->psi->handle ) )
dvbpsi_pmt_detach( pid->psi->handle );
dvbpsi_delete( pid->psi->handle );
pid->psi->handle = NULL;
-#else
- dvbpsi_DetachPMT( pid->psi->handle );
-#endif
}
for( int i = 0; i < pid->psi->i_prg; i++ )
{
IODFree( pid->psi->prg[i]->iod );
if( pid->psi->prg[i]->handle )
{
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
if( dvbpsi_decoder_present( pid->psi->prg[i]->handle ) )
dvbpsi_pmt_detach( pid->psi->prg[i]->handle );
dvbpsi_delete( pid->psi->prg[i]->handle );
-#else
- dvbpsi_DetachPMT( pid->psi->prg[i]->handle );
-#endif
}
free( pid->psi->prg[i] );
}
ts_pid_t *p_pid = &p_sys->pid[i];
if( p_pid->psi )
{
-
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
if( dvbpsi_decoder_present( p_pid->psi->handle ))
dvbpsi_DetachDemux( p_pid->psi->handle );
dvbpsi_delete( p_pid->psi->handle );
-#else
- dvbpsi_DetachDemux( p_pid->psi->handle );
-#endif
free( p_pid->psi );
p_pid->psi = NULL;
p_pid->b_valid = false;
!p_sdt->b_current_next ||
p_sdt->i_version == sdt->psi->i_sdt_version )
{
- dvbpsi_DeleteSDT( p_sdt );
+ dvbpsi_sdt_delete( p_sdt );
return;
}
msg_Dbg( p_demux, "new SDT ts_id=%d version=%d current_next=%d "
"network_id=%d",
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_sdt->i_extension,
-#else
- p_sdt->i_ts_id,
-#endif
p_sdt->i_version, p_sdt->b_current_next,
p_sdt->i_network_id );
}
sdt->psi->i_sdt_version = p_sdt->i_version;
- dvbpsi_DeleteSDT( p_sdt );
+ dvbpsi_sdt_delete( p_sdt );
}
/* i_year: year - 1900 i_month: 0-11 i_mday: 1-31 i_hour: 0-23 i_minute: 0-59 i_second: 0-59 */
p_sys->i_tdt_delta = CLOCK_FREQ * EITConvertStartTime( p_tdt->i_utc_time )
- mdate();
- dvbpsi_DeleteTOT(p_tdt);
+ dvbpsi_tot_delete(p_tdt);
}
msg_Dbg( p_demux, "EITCallBack called" );
if( !p_eit->b_current_next )
{
- dvbpsi_DeleteEIT( p_eit );
+ dvbpsi_eit_delete( p_eit );
return;
}
msg_Dbg( p_demux, "new EIT service_id=%d version=%d current_next=%d "
"ts_id=%d network_id=%d segment_last_section_number=%d "
"last_table_id=%d",
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_eit->i_extension,
-#else
- p_eit->i_service_id,
-#endif
p_eit->i_version, p_eit->b_current_next,
p_eit->i_ts_id, p_eit->i_network_id,
p_eit->i_segment_last_section_number, p_eit->i_last_table_id );
if( b_current_following &&
( p_sys->programs.i_size == 0 ||
p_sys->programs.p_elems[0] ==
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_eit->i_extension
-#else
- p_eit->i_service_id
-#endif
) )
{
p_sys->i_dvb_length = 0;
}
}
es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG,
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_eit->i_extension,
-#else
- p_eit->i_service_id,
-#endif
p_epg );
}
vlc_epg_Delete( p_epg );
- dvbpsi_DeleteEIT( p_eit );
+ dvbpsi_eit_delete( p_eit );
}
static void EITCallBackCurrentFollowing( demux_t *p_demux, dvbpsi_eit_t *p_eit )
{
EITCallBack( p_demux, p_eit, false );
}
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id,
uint16_t i_extension, demux_t *p_demux )
-#else
-static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
- uint8_t i_table_id, uint16_t i_extension )
-#endif
{
assert( h );
#if 0
{
msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
i_table_id, i_table_id, i_extension, i_extension );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
+
if( !dvbpsi_sdt_attach( h, i_table_id, i_extension, (dvbpsi_sdt_callback)SDTCallBack, p_demux ) )
msg_Err( p_demux, "PSINewTableCallback: failed attaching SDTCallback" );
-#else
- dvbpsi_AttachSDT( h, i_table_id, i_extension,
- (dvbpsi_sdt_callback)SDTCallBack, p_demux );
-#endif
}
else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
( i_table_id == 0x4e || /* Current/Following */
dvbpsi_eit_callback cb = i_table_id == 0x4e ?
(dvbpsi_eit_callback)EITCallBackCurrentFollowing :
(dvbpsi_eit_callback)EITCallBackSchedule;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
+
if( !dvbpsi_eit_attach( h, i_table_id, i_extension, cb, p_demux ) )
msg_Err( p_demux, "PSINewTableCallback: failed attaching EITCallback" );
-#else
- dvbpsi_AttachEIT( h, i_table_id, i_extension, cb, p_demux );
-#endif
}
else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
(i_table_id == 0x70 /* TDT */ || i_table_id == 0x73 /* TOT */) )
{
msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
i_table_id, i_table_id, i_extension, i_extension );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
+
if( !dvbpsi_tot_attach( h, i_table_id, i_extension, (dvbpsi_tot_callback)TDTCallBack, p_demux ) )
msg_Err( p_demux, "PSINewTableCallback: failed attaching TDTCallback" );
-#else
- dvbpsi_AttachTOT( h, i_table_id, i_extension,
- (dvbpsi_tot_callback)TDTCallBack, p_demux);
-#endif
}
}
unsigned i_page = 0;
/* Gather pages information */
-#if defined _DVBPSI_DR_56_H_ && \
- defined DVBPSI_VERSION && DVBPSI_VERSION_INT > DVBPSI_VERSION_WANTED(0,1,5)
for( unsigned i_tag_idx = 0; i_tag_idx < 2; i_tag_idx++ )
{
dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_es, i_tag_idx == 0 ? 0x46 : 0x56 );
memcpy( p_dst->p_iso639, p_src->i_iso6392_language_code, 3 );
}
}
-#endif
dvbpsi_descriptor_t *p_dr = PMTEsFindDescriptor( p_es, 0x59 );
if( p_dr )
if( pmt == NULL )
{
msg_Warn( p_demux, "unreferenced program (broken stream)" );
- dvbpsi_DeletePMT(p_pmt);
+ dvbpsi_pmt_delete(p_pmt);
return;
}
if( prg->i_version != -1 &&
( !p_pmt->b_current_next || prg->i_version == p_pmt->i_version ) )
{
- dvbpsi_DeletePMT( p_pmt );
+ dvbpsi_pmt_delete( p_pmt );
return;
}
/* Set CAM descrambling */
if( !ProgramIsSelected( p_demux, prg->i_number ) )
{
- dvbpsi_DeletePMT( p_pmt );
+ dvbpsi_pmt_delete( p_pmt );
}
else if( stream_Control( p_sys->stream, STREAM_SET_PRIVATE_ID_CA,
p_pmt ) != VLC_SUCCESS )
p_sys->arib.b25stream = stream_FilterNew( p_demux->s, "aribcam" );
p_sys->stream = ( p_sys->arib.b25stream ) ? p_sys->arib.b25stream : p_demux->s;
if (!p_sys->arib.b25stream)
- dvbpsi_DeletePMT( p_pmt );
- } else dvbpsi_DeletePMT( p_pmt );
+ dvbpsi_pmt_delete( p_pmt );
+ } else dvbpsi_pmt_delete( p_pmt );
}
for( int i = 0; i < i_clean; i++ )
( pat->psi->i_ts_id != -1 && p_pat->i_ts_id != pat->psi->i_ts_id ) ||
p_sys->b_user_pmt || PATCheck( p_demux, p_pat ) )
{
- dvbpsi_DeletePAT( p_pat );
+ dvbpsi_pat_delete( p_pat );
return;
}
PIDInit( pmt, true, pat->psi );
ts_prg_psi_t *prg = pmt->psi->prg[pmt->psi->i_prg-1];
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
prg->handle = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !prg->handle )
{
- dvbpsi_DeletePAT( p_pat );
+ dvbpsi_pat_delete( p_pat );
return;
}
prg->handle->p_sys = (void *) VLC_OBJECT(p_demux);
if( !dvbpsi_pmt_attach( prg->handle, p_program->i_number, PMTCallBack, p_demux ) )
msg_Err( p_demux, "PATCallback failed attaching PMTCallback to program %d",
p_program->i_number );
-#else
- prg->handle = dvbpsi_AttachPMT( p_program->i_number, PMTCallBack, p_demux );
-#endif
+
prg->i_number = p_program->i_number;
prg->i_pid_pmt = p_program->i_pid;
pat->psi->i_pat_version = p_pat->i_version;
pat->psi->i_ts_id = p_pat->i_ts_id;
- dvbpsi_DeletePAT( p_pat );
+ dvbpsi_pat_delete( p_pat );
}
#ifndef DVBPSI_COMPAT_H
#define DVBPSI_COMPAT_H
-/*
- * dvbpsi compatibility macros:
- * dvbpsi version 1.0.0 and above returns a struct 'dvbpsi_t' as handle
- */
-#define DVBPSI_VERSION_WANTED(major,minor,bugfix) (((major)<<16)+((minor)<<8)+(bugfix))
-
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
-# define dvbpsi_handle dvbpsi_t*
-# define dvbpsi_PushPacket(handle,data) dvbpsi_packet_push((handle),(data))
-/* PAT */
-# define dvbpsi_InitPAT(pat,id,version,next) dvbpsi_pat_init((pat),(id),(version),(bool)(next))
-# define dvbpsi_PATAddProgram(pat,nr,pid) dvbpsi_pat_program_add((pat),(nr),(pid))
-# define dvbpsi_EmptyPAT(pat) dvbpsi_pat_empty((pat))
-# define dvbpsi_DeletePAT(table) dvbpsi_pat_delete((table))
-# define dvbpsi_DetachPAT(pat) dvbpsi_pat_detach((pat))
-/* PMT */
-# define dvbpsi_InitPMT(pmt,program,version,next,pcr) \
- dvbpsi_pmt_init((pmt),(program),(version),(bool)(next),(pcr))
-# define dvbpsi_PMTAddDescriptor(pmt,tag,length,data) \
- dvbpsi_pmt_descriptor_add((pmt),(tag),(length),(data))
-# define dvbpsi_PMTAddES(pmt,type,pid) \
- dvbpsi_pmt_es_add((pmt),(type),(pid))
-# define dvbpsi_PMTESAddDescriptor(es,tag,length,data) \
- dvbpsi_pmt_es_descriptor_add((es),(tag),(length),(data))
-# define dvbpsi_EmptyPMT(pmt) dvbpsi_pmt_empty((pmt))
-# define dvbpsi_DeletePMT(table) dvbpsi_pmt_delete((table))
-# define dvbpsi_DetachPMT(pmt) dvbpsi_pmt_detach((pmt))
-/* SDT */
-# define dvbpsi_InitSDT(sdt,id,version,curnext,netid) \
- dvbpsi_sdt_init((sdt),(id),(0),(version),(bool)(curnext),(netid))
-# define dvbpsi_SDTAddService(sdt,id,schedule,present,status,ca) \
- dvbpsi_sdt_service_add((sdt),(id),(bool)(schedule),(bool)(present),(status),(bool)(ca))
-# define dvbpsi_EmptySDT(sdt) dvbpsi_sdt_empty((sdt))
-# define dvbpsi_DeleteSDT(table) dvbpsi_sdt_delete((table))
-/* TOT */
-# define dvbpsi_DeleteTOT(table) dvbpsi_tot_delete((table))
-/* EIT */
-# define dvbpsi_DeleteEIT(table) dvbpsi_eit_delete((table))
-/* NIT */
-# define dvbpsi_DeleteNIT(table) dvbpsi_nit_delete((table))
-
static inline void dvbpsi_messages(dvbpsi_t *p_dvbpsi, const dvbpsi_msg_level_t level, const char* msg)
{
vlc_object_t *obj = (vlc_object_t *)p_dvbpsi->p_sys;
break;
}
}
-#endif
#endif
return NULL;
}
-void BuildPAT( DVBPSI_HANDLE_PARAM(dvbpsi_t *p_dvbpsi)
+void BuildPAT( dvbpsi_t *p_dvbpsi,
void *p_opaque, PEStoTSCallback pf_callback,
int i_tsid, int i_pat_version_number,
ts_stream_t *p_pat,
dvbpsi_pat_t patpsi;
dvbpsi_psi_section_t *p_section;
- dvbpsi_InitPAT( &patpsi, i_tsid, i_pat_version_number, 1 /* b_current_next */ );
+ dvbpsi_pat_init( &patpsi, i_tsid, i_pat_version_number, true /* b_current_next */ );
/* add all programs */
for (unsigned i = 0; i < i_programs; i++ )
- dvbpsi_PATAddProgram( &patpsi, pi_programs_number[i], p_pmt[i].i_pid );
+ dvbpsi_pat_program_add( &patpsi, pi_programs_number[i], p_pmt[i].i_pid );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_section = dvbpsi_pat_sections_generate( p_dvbpsi, &patpsi, 0 );
-#else
- p_section = dvbpsi_GenPATSections( &patpsi, 0 /* max program per section */ );
-#endif
block_t *p_block = WritePSISection( p_section );
PEStoTS( p_opaque, pf_callback, p_block, p_pat->i_pid,
&p_pat->b_discontinuity, &p_pat->i_continuity_counter );
dvbpsi_DeletePSISections( p_section );
- dvbpsi_EmptyPAT( &patpsi );
+ dvbpsi_pat_empty( &patpsi );
}
#if 1
bits_write( &bits_fix_IOD, 24,
GetDescriptorLength24b(bits.i_data - bits_fix_IOD.i_data - 3 ));
- dvbpsi_PMTAddDescriptor(&p_dvbpmt[0], 0x1d, bits.i_data, bits.p_data);
+ dvbpsi_pmt_descriptor_add(&p_dvbpmt[0], 0x1d, bits.i_data, bits.p_data);
}
-void BuildPMT( DVBPSI_HANDLE_PARAM(dvbpsi_t *p_dvbpsi) vlc_object_t *p_object,
+void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
void *p_opaque, PEStoTSCallback pf_callback,
int i_tsid, int i_pmt_version_number,
int i_pcr_pid,
dvbpsi_sdt_t sdtpsi;
if( p_sdt )
- dvbpsi_InitSDT( &sdtpsi, i_tsid, 1, 1, p_sdt->i_netid );
+ dvbpsi_sdt_init( &sdtpsi, i_tsid, 0, 1, true, p_sdt->i_netid );
for (unsigned i = 0; i < i_programs; i++ )
{
- dvbpsi_InitPMT( &dvbpmt[i],
+ dvbpsi_pmt_init( &dvbpmt[i],
pi_programs_number[i], /* program number */
i_pmt_version_number,
- 1, /* b_current_next */
+ true, /* b_current_next */
i_pcr_pid );
if( !p_sdt )
continue;
- dvbpsi_sdt_service_t *p_service = dvbpsi_SDTAddService( &sdtpsi,
+ dvbpsi_sdt_service_t *p_service = dvbpsi_sdt_service_add( &sdtpsi,
pi_programs_number[i], /* service id */
- 0, /* eit schedule */
- 0, /* eit present */
+ false, /* eit schedule */
+ false, /* eit present */
4, /* running status ("4=RUNNING") */
- 0 ); /* free ca */
+ false ); /* free ca */
const char *psz_sdtprov = p_sdt->desc[i].psz_provider;
const char *psz_sdtserv = p_sdt->desc[i].psz_service_name;
psz_sdt_desc[ 2 + provlen ] = (char)servlen;
memcpy( &psz_sdt_desc[3+provlen], psz_sdtserv, servlen );
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
dvbpsi_sdt_service_descriptor_add( p_service, 0x48,
(3 + provlen + servlen),
psz_sdt_desc );
-#else
- dvbpsi_SDTServiceAddDescriptor( p_service, 0x48,
- 3 + provlen + servlen, psz_sdt_desc );
-#endif
}
for (unsigned i = 0; i < i_mapped_streams; i++ )
{
const pes_mapped_stream_t *p_stream = &p_mapped_streams[i];
- dvbpsi_pmt_es_t *p_es = dvbpsi_PMTAddES( &dvbpmt[p_stream->i_mapped_prog],
+ dvbpsi_pmt_es_t *p_es = dvbpsi_pmt_es_add( &dvbpmt[p_stream->i_mapped_prog],
p_stream->pes->i_stream_type, p_stream->ts->i_pid );
if( p_stream->pes->i_stream_id == 0xfa || p_stream->pes->i_stream_id == 0xfb )
/* SL descriptor */
es_id[0] = (p_stream->pes->i_es_id >> 8)&0xff;
es_id[1] = (p_stream->pes->i_es_id)&0xff;
- dvbpsi_PMTESAddDescriptor( p_es, 0x1f, 2, es_id );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x1f, 2, es_id );
}
else if( p_stream->pes->i_stream_type == 0xa0 )
{
}
/* 0xa0 is private */
- dvbpsi_PMTESAddDescriptor( p_es, 0xa0, i_extra + 10, data );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0xa0, i_extra + 10, data );
}
else if( p_stream->pes->i_stream_type == 0x81 )
{
uint8_t format[4] = { 'A', 'C', '-', '3'};
/* "registration" descriptor : "AC-3" */
- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, format );
}
else if( p_stream->pes->i_codec == VLC_CODEC_DIRAC )
{
/* Dirac registration descriptor */
uint8_t data[4] = { 'd', 'r', 'a', 'c' };
- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
}
else if( p_stream->pes->i_codec == VLC_CODEC_DTS )
{
/* DTS format identifier, frame size 1024 - FIXME */
uint8_t data[4] = { 'D', 'T', 'S', '2' };
- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
}
else if( p_stream->pes->i_codec == VLC_CODEC_EAC3 )
{
uint8_t data[1] = { 0x00 };
- dvbpsi_PMTESAddDescriptor( p_es, 0x7a, 1, data );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x7a, 1, data );
}
else if( p_stream->pes->i_codec == VLC_CODEC_OPUS )
{
0x80, /* tag extension */
p_stream->fmt->audio.i_channels
};
- dvbpsi_PMTESAddDescriptor( p_es, 0x7f, 2, data );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x7f, 2, data );
uint8_t format[4] = { 'O', 'p', 'u', 's'};
/* "registration" descriptor : "Opus" */
- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, format );
}
else if( p_stream->pes->i_codec == VLC_CODEC_TELETEXT )
{
if( p_stream->pes->i_extra )
{
- dvbpsi_PMTESAddDescriptor( p_es, 0x56,
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x56,
p_stream->pes->i_extra,
p_stream->pes->p_extra );
}
if( p_stream->pes->i_extra )
{
/* pass-through from the TS demux */
- dvbpsi_PMTESAddDescriptor( p_es, 0x59,
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x59,
p_stream->pes->i_extra,
p_stream->pes->p_extra );
}
p_descr = dvbpsi_GenSubtitlingDr( &descr, 0 );
/* Work around bug in old libdvbpsi */ p_descr->i_length = 8;
- dvbpsi_PMTESAddDescriptor( p_es, p_descr->i_tag,
+ dvbpsi_pmt_es_descriptor_add( p_es, p_descr->i_tag,
p_descr->i_length, p_descr->p_data );
}
continue;
if( p_stream->pes->i_langs )
{
- dvbpsi_PMTESAddDescriptor( p_es, 0x0a, 4*p_stream->pes->i_langs,
+ dvbpsi_pmt_es_descriptor_add( p_es, 0x0a, 4*p_stream->pes->i_langs,
p_stream->pes->lang);
}
}
for (unsigned i = 0; i < i_programs; i++ )
{
- dvbpsi_psi_section_t *sect;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
- sect = dvbpsi_pmt_sections_generate( p_dvbpsi, &dvbpmt[i] );
-#else
- sect = dvbpsi_GenPMTSections( &dvbpmt[i] );
-#endif
+ dvbpsi_psi_section_t *sect = dvbpsi_pmt_sections_generate( p_dvbpsi, &dvbpmt[i] );
block_t *pmt = WritePSISection( sect );
PEStoTS( p_opaque, pf_callback, pmt, p_pmt[i].i_pid,
&p_pmt[i].b_discontinuity, &p_pmt[i].i_continuity_counter );
dvbpsi_DeletePSISections(sect);
- dvbpsi_EmptyPMT( &dvbpmt[i] );
+ dvbpsi_pmt_empty( &dvbpmt[i] );
}
if( p_sdt )
{
- dvbpsi_psi_section_t *sect;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
- sect = dvbpsi_sdt_sections_generate( p_dvbpsi, &sdtpsi );
-#else
- sect = dvbpsi_GenSDTSections( &sdtpsi );
-#endif
+ dvbpsi_psi_section_t *sect = dvbpsi_sdt_sections_generate( p_dvbpsi, &sdtpsi );
block_t *p_sdtblock = WritePSISection( sect );
PEStoTS( p_opaque, pf_callback, p_sdtblock, p_sdt->ts.i_pid,
&p_sdt->ts.b_discontinuity, &p_sdt->ts.i_continuity_counter );
dvbpsi_DeletePSISections( sect );
- dvbpsi_EmptySDT( &sdtpsi );
+ dvbpsi_sdt_empty( &sdtpsi );
}
free( dvbpmt );
#ifndef _TABLES_H
#define _TABLES_H 1
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
- #define DVBPSI_HANDLE_PARAM(a) a,
-#else
- #define DVBPSI_HANDLE_PARAM(a)
-#endif
-
#define MAX_SDT_DESC 64
typedef struct
block_t * WritePSISection( dvbpsi_psi_section_t* p_section );
-void BuildPAT( DVBPSI_HANDLE_PARAM(dvbpsi_t *p_dvbpsi)
+void BuildPAT( dvbpsi_t *p_dvbpsi,
void *p_opaque, PEStoTSCallback pf_callback,
int i_tsid, int i_pat_version_number,
ts_stream_t *p_pat,
int i_mapped_prog;
} pes_mapped_stream_t;
-void BuildPMT( DVBPSI_HANDLE_PARAM(dvbpsi_t *p_dvbpsi) vlc_object_t *p_object,
+void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
void *p_opaque, PEStoTSCallback pf_callback,
int i_tsid, int i_pmt_version_number,
int i_pcr_pid,
vlc_mutex_t csa_lock;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
dvbpsi_t *p_dvbpsi;
-#endif
bool b_es_id_pid;
bool b_sdt;
int i_pid_video;
return VLC_ENOMEM;
p_sys->i_num_pmt = 1;
-
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
p_sys->p_dvbpsi = dvbpsi_new( &dvbpsi_messages, DVBPSI_MSG_DEBUG );
if( !p_sys->p_dvbpsi )
{
return VLC_ENOMEM;
}
p_sys->p_dvbpsi->p_sys = (void *) p_mux;
-#endif
p_sys->b_es_id_pid = var_GetBool( p_mux, SOUT_CFG_PREFIX "es-id-pid" );
sout_mux_t *p_mux = (sout_mux_t*)p_this;
sout_mux_sys_t *p_sys = p_mux->p_sys;
-#if (DVBPSI_VERSION_INT >= DVBPSI_VERSION_WANTED(1,0,0))
if( p_sys->p_dvbpsi )
dvbpsi_delete( p_sys->p_dvbpsi );
-#endif
if( p_sys->csa )
{
{
sout_mux_sys_t *p_sys = p_mux->p_sys;
- BuildPAT( DVBPSI_HANDLE_PARAM(p_sys->p_dvbpsi)
+ BuildPAT( p_sys->p_dvbpsi,
c, (PEStoTSCallback)BufferChainAppend,
p_sys->i_tsid, p_sys->i_pat_version_number,
&p_sys->pat,
mappeds[i_stream].ts = &p_stream->ts;
}
- BuildPMT( DVBPSI_HANDLE_PARAM(p_sys->p_dvbpsi) VLC_OBJECT(p_mux),
+ BuildPMT( p_sys->p_dvbpsi, VLC_OBJECT(p_mux),
c, (PEStoTSCallback)BufferChainAppend,
p_sys->i_tsid, p_sys->i_pmt_version_number,
p_sys->i_pcr_pid,