tsfile: cmdline flag to specify ATSC input
Previously all standard DVB and ATSC tables were installed, this would cause the initscan to time out. We try and be more clever with determining the type, but this will do for now. The code allows the option to be per mux (file), but the cmdline is currently limited to a global setting, which is likely to be more than enough.
This commit is contained in:
parent
ea751dada6
commit
9fc6e36114
6 changed files with 23 additions and 19 deletions
|
@ -29,7 +29,7 @@ struct mpegts_network;
|
|||
void tsfile_init ( int tuners );
|
||||
|
||||
/* Add a new file (multiplex) */
|
||||
void tsfile_add_file ( const char *path );
|
||||
void tsfile_add_file ( const char *path, int atsc );
|
||||
|
||||
#endif /* __TVH_TSFILE_H__ */
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ void tsfile_init ( int tuners )
|
|||
/*
|
||||
* Add multiplex
|
||||
*/
|
||||
void tsfile_add_file ( const char *path )
|
||||
void tsfile_add_file ( const char *path, int atsc )
|
||||
{
|
||||
mpegts_input_t *mi;
|
||||
mpegts_mux_t *mm;
|
||||
|
@ -94,7 +94,7 @@ void tsfile_add_file ( const char *path )
|
|||
|
||||
/* Create physical instance (for each tuner) */
|
||||
LIST_FOREACH(mi, &tsfile_inputs, mi_global_link)
|
||||
tsfile_mux_instance_create(path, mi, mm);
|
||||
tsfile_mux_instance_create(path, mi, mm, atsc);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -216,18 +216,19 @@ tsfile_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *t )
|
|||
/* Install table handlers */
|
||||
mpegts_table_add(mm, DVB_PAT_BASE, DVB_PAT_MASK, dvb_pat_callback,
|
||||
NULL, "pat", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_PAT_PID);
|
||||
mpegts_table_add(mm, DVB_SDT_BASE, DVB_SDT_MASK, dvb_sdt_callback,
|
||||
NULL, "sdt", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_SDT_PID);
|
||||
mpegts_table_add(mm, DVB_BAT_BASE, DVB_BAT_MASK, dvb_bat_callback,
|
||||
NULL, "bat", MT_CRC, DVB_BAT_PID);
|
||||
mpegts_table_add(mm, DVB_VCT_T_BASE, DVB_VCT_MASK, atsc_vct_callback,
|
||||
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_VCT_PID);
|
||||
mpegts_table_add(mm, DVB_VCT_C_BASE, DVB_VCT_MASK, atsc_vct_callback,
|
||||
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_VCT_PID);
|
||||
#if 0
|
||||
if (!mmi->mmi_tsfile_atsc) {
|
||||
mpegts_table_add(mm, DVB_SDT_BASE, DVB_SDT_MASK, dvb_sdt_callback,
|
||||
NULL, "sdt", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_SDT_PID);
|
||||
mpegts_table_add(mm, DVB_BAT_BASE, DVB_BAT_MASK, dvb_bat_callback,
|
||||
NULL, "bat", MT_CRC, DVB_BAT_PID);
|
||||
} else {
|
||||
mpegts_table_add(mm, DVB_VCT_T_BASE, DVB_VCT_MASK, atsc_vct_callback,
|
||||
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_VCT_PID);
|
||||
mpegts_table_add(mm, DVB_VCT_C_BASE, DVB_VCT_MASK, atsc_vct_callback,
|
||||
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD, DVB_VCT_PID);
|
||||
}
|
||||
mpegts_table_add(mm, 0x1, 0xff, dvb_cat_callback, NULL, "cat",
|
||||
MT_CRC, 1);
|
||||
#endif
|
||||
MT_CRC, DVB_CAT_PID);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ extern const idclass_t mpegts_mux_instance_class;
|
|||
|
||||
tsfile_mux_instance_t *
|
||||
tsfile_mux_instance_create
|
||||
( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm )
|
||||
( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm, int atsc )
|
||||
{
|
||||
#define tsfile_mux_instance_class mpegts_mux_instance_class
|
||||
tsfile_mux_instance_t *mmi =
|
||||
|
@ -32,6 +32,7 @@ tsfile_mux_instance_create
|
|||
#undef tsfile_mux_instance_class
|
||||
mmi->mmi_tsfile_path = strdup(path);
|
||||
mmi->mmi_tsfile_pcr_pid = 0;
|
||||
mmi->mmi_tsfile_atsc = atsc;
|
||||
tvhtrace("tsfile", "mmi created %p path %s", mmi, mmi->mmi_tsfile_path);
|
||||
return mmi;
|
||||
}
|
||||
|
|
|
@ -50,10 +50,10 @@ struct tsfile_mux_instance
|
|||
* File input
|
||||
*/
|
||||
|
||||
int mmi_tsfile_atsc; ///< ATSC input
|
||||
char *mmi_tsfile_path; ///< Source file path
|
||||
th_pipe_t mmi_tsfile_pipe; ///< Thread control pipe
|
||||
uint16_t mmi_tsfile_pcr_pid; ///< Timing control
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -62,7 +62,7 @@ struct tsfile_mux_instance
|
|||
mpegts_input_t *tsfile_input_create ( int idx );
|
||||
|
||||
tsfile_mux_instance_t *tsfile_mux_instance_create
|
||||
( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm );
|
||||
( const char *path, mpegts_input_t *mi, mpegts_mux_t *mm, int atsc );
|
||||
|
||||
mpegts_mux_t *
|
||||
tsfile_mux_create ( mpegts_network_t *mn );
|
||||
|
|
|
@ -424,7 +424,8 @@ main(int argc, char **argv)
|
|||
opt_fileline = 0,
|
||||
opt_threadid = 0,
|
||||
opt_ipv6 = 0,
|
||||
opt_tsfile_tuner = 0;
|
||||
opt_tsfile_tuner = 0,
|
||||
opt_tsfile_atsc = 0;
|
||||
const char *opt_config = NULL,
|
||||
*opt_user = NULL,
|
||||
*opt_group = NULL,
|
||||
|
@ -492,6 +493,7 @@ main(int argc, char **argv)
|
|||
{ 0, NULL, "TODO: testing", OPT_BOOL, NULL },
|
||||
{ 0, "tsfile_tuners", "Number of tsfile tuners", OPT_INT, &opt_tsfile_tuner },
|
||||
{ 0, "tsfile", "tsfile input (mux file)", OPT_STR_LIST, &opt_tsfile },
|
||||
{ 0, "tsfile_atsc", "tsfile input is ATSC", OPT_INT, &opt_tsfile_atsc }
|
||||
|
||||
};
|
||||
|
||||
|
@ -713,7 +715,7 @@ main(int argc, char **argv)
|
|||
if(opt_tsfile.num) {
|
||||
tsfile_init(opt_tsfile_tuner ?: opt_tsfile.num);
|
||||
for (i = 0; i < opt_tsfile.num; i++)
|
||||
tsfile_add_file(opt_tsfile.str[i]);
|
||||
tsfile_add_file(opt_tsfile.str[i], opt_tsfile_atsc);
|
||||
}
|
||||
#endif
|
||||
#if ENABLE_IPTV
|
||||
|
|
Loading…
Add table
Reference in a new issue