Example #1
0
File: parse.cpp Project: gk1/teev
bool parse::take_pat(dvbpsi_pat_t* p_pat, bool decoded)
{
	dprintf("(%s): v%d, ts_id: %d",
		(decoded) ? "post" : "pre",
		p_pat->i_version, p_pat->i_ts_id);

	if (!decoded) {
		set_ts_id(p_pat->i_ts_id);
#if USING_DVBPSI_VERSION_0
		h_demux[PID_ATSC] = dvbpsi_AttachDemux(attach_table, this);
#else
		if (h_demux.count(PID_ATSC)) {
			h_demux[PID_ATSC].detach_demux();
			h_demux.erase(PID_ATSC);
		}

		if (!dvbpsi_decoder_present(h_demux[PID_ATSC].get_handle()))
			dvbpsi_AttachDemux(h_demux[PID_ATSC].get_handle(), attach_table, this);
#endif
		return true;
	}

	process_pat(decoders[p_pat->i_ts_id].get_decoded_pat());

	rewrite_pat();

	has_pat = true;

	return true;
}
Example #2
0
void ts_psi_Del( demux_t *p_demux, ts_psi_t *psi )
{
    VLC_UNUSED(p_demux);
    if( dvbpsi_decoder_present( psi->handle ) )
        dvbpsi_DetachDemux( psi->handle );
    dvbpsi_delete( psi->handle );
    free( psi );
}
Example #3
0
void ts_pat_Del( demux_t *p_demux, ts_pat_t *pat )
{
    if( dvbpsi_decoder_present( pat->handle ) )
        dvbpsi_pat_detach( pat->handle );
    dvbpsi_delete( pat->handle );
    for( int i=0; i<pat->programs.i_size; i++ )
        PIDRelease( p_demux, pat->programs.p_elems[i] );
    ARRAY_RESET( pat->programs );
    free( pat );
}
Example #4
0
void ts_si_Del( demux_t *p_demux, ts_si_t *si )
{
    if( dvbpsi_decoder_present( si->handle ) )
        dvbpsi_DetachDemux( si->handle );
    dvbpsi_delete( si->handle );
    if( si->eitpid )
        PIDRelease( p_demux, si->eitpid );
    if( si->tdtpid )
        PIDRelease( p_demux, si->tdtpid );
    free( si );
}
Example #5
0
File: parse.cpp Project: gk1/teev
void parse::process_pat(const decoded_pat_t *decoded_pat)
{
	dprintf("()");
	for (map_decoded_pat_programs::const_iterator iter = decoded_pat->programs.begin();
	     iter != decoded_pat->programs.end(); ++iter)
		if (iter->first > 0) {// FIXME: > 0 ???
			if ((!service_ids.size()) || (service_ids.count(iter->first)))  {
#if USING_DVBPSI_VERSION_0
				h_pmt[iter->second] = dvbpsi_AttachPMT(iter->first, take_pmt, this);
#else
				if (h_pmt.count(iter->second)) {
					if (dvbpsi_decoder_present(h_pmt[iter->second].get_handle()))
						dvbpsi_pmt_detach(h_pmt[iter->second].get_handle());
					h_pmt.erase(iter->second);
				}

				if (!dvbpsi_decoder_present(h_pmt[iter->second].get_handle()))
					dvbpsi_pmt_attach(h_pmt[iter->second].get_handle(), iter->first, take_pmt, this);
#endif
				add_filter(iter->second);
				rcvd_pmt[iter->first] = false;
			}
		}
}
Example #6
0
void ts_pmt_Del( demux_t *p_demux, ts_pmt_t *pmt )
{
    if( dvbpsi_decoder_present( pmt->handle ) )
        dvbpsi_pmt_detach( pmt->handle );
    dvbpsi_delete( pmt->handle );
    for( int i=0; i<pmt->e_streams.i_size; i++ )
        PIDRelease( p_demux, pmt->e_streams.p_elems[i] );
    ARRAY_RESET( pmt->e_streams );
    if( pmt->p_mgt )
        PIDRelease( p_demux, pmt->p_mgt );
    if( pmt->iod )
        ODFree( pmt->iod );
    for( int i=0; i<pmt->od.objects.i_size; i++ )
        ODFree( pmt->od.objects.p_elems[i] );
    ARRAY_RESET( pmt->od.objects );
    if( pmt->i_number > -1 )
        es_out_Control( p_demux->out, ES_OUT_DEL_GROUP, pmt->i_number );
    free( pmt );
}
Example #7
0
File: parse.cpp Project: gk1/teev
void parse::process_mgt(bool attach)
{
	const decoded_mgt_t* decoded_mgt = decoders[ts_id].get_decoded_mgt();

	bool b_expecting_vct = false;

	eit_pids.clear();
	if (!decoded_mgt)
		fprintf(stderr, "%s: decoded_mgt is NULL!!!\n", __func__);
	else for (map_decoded_mgt_tables::const_iterator iter =
	       decoded_mgt->tables.begin();
	     iter != decoded_mgt->tables.end(); ++iter) {

		bool b_attach_demux = false;

		switch (iter->first) {
		case 0x0000 ... 0x0003: /* TVCT / CVCT */
			b_expecting_vct = true;
			b_attach_demux  = true;
			break;
		case 0x0100 ... 0x017f:	/* EIT-0 to EIT-127 */
			if ((scan_mode) && (!epg_mode))
				break;
			if ((eit_collection_limit == -1) || (eit_collection_limit >= iter->first - 0x0100)) {
				eit_pids[iter->second.pid] = iter->first - 0x0100;
				b_attach_demux  = true;
			}
			break;
		case 0x0200 ... 0x027f: /* ETT-0 to ETT-127 */
			if (dont_collect_ett)
				break;

			if (scan_mode)
				break;
			/* FALL THRU */
		case 0x0004:            /* Channel ETT */
			b_attach_demux  = true;
			break;
		case 0x0301 ... 0x03ff: /* RRT w/ rating region 1-255 */
#if RRT
			b_attach_demux  = true;
#endif
			break;
		case 0x0005:            /* DCCSCT */
		case 0x0006 ... 0x00ff: /* Reserved for future ATSC use */
		case 0x0180 ... 0x01ff: /* Reserved for future ATSC use */
		case 0x0280 ... 0x0300: /* Reserved for future ATSC use */
		case 0x0400 ... 0x0fff: /* private */
		case 0x1000 ... 0x13ff: /* Reserved for future ATSC use */
		case 0x1400 ... 0x14ff: /* DCCT dcc id 0x00 - 0xff */
		case 0x1500 ... 0xffff: /* Reserved for future ATSC use */
			break;
		default:
			if (scan_mode)
				break;
			b_attach_demux  = true;
			break;
		}
		if ((b_attach_demux) && (iter->second.pid != PID_ATSC)) {

#if USING_DVBPSI_VERSION_0
			if (h_demux.count(iter->second.pid))
#if 0
				dvbpsi_DetachDemux(h_demux[iter->second.pid]);
#else
			{} else
#endif
#else
			if (h_demux.count(iter->second.pid)) {
				h_demux[iter->second.pid].detach_demux();
				h_demux.erase(iter->second.pid);
			}

			if ((attach) && (!dvbpsi_decoder_present(h_demux[iter->second.pid].get_handle())))
				dvbpsi_AttachDemux(h_demux[iter->second.pid].get_handle(), attach_table, this);
#endif
			add_filter(iter->second.pid);
#if USING_DVBPSI_VERSION_0
			h_demux[iter->second.pid] = dvbpsi_AttachDemux(attach_table, this);
#endif
		}
	}