diff --git a/src/input/mpegts.h b/src/input/mpegts.h index a4ea64c..d47ec87 100644 --- a/src/input/mpegts.h +++ b/src/input/mpegts.h @@ -534,6 +534,13 @@ struct mpegts_mux uint16_t mm_sid_filter; /* + * SAT>IP Remap + */ + uint32_t mm_remap_satip_dvbt_freq; + uint32_t mm_remap_satip_dvbc_freq; + uint32_t mm_remap_satip_dvbs_freq; + + /* * TSDEBUG */ #if ENABLE_TSDEBUG diff --git a/src/input/mpegts/iptv/iptv_mux.c b/src/input/mpegts/iptv/iptv_mux.c index 3129549..c92954f 100644 --- a/src/input/mpegts/iptv/iptv_mux.c +++ b/src/input/mpegts/iptv/iptv_mux.c @@ -244,30 +244,6 @@ const idclass_t iptv_mux_class = }, { .type = PT_U32, - .id = "iptv_satip_dvbt_freq", - .name = N_("SAT>IP DVB-T frequency (Hz)"), - .off = offsetof(iptv_mux_t, mm_iptv_satip_dvbt_freq), - .desc = N_("For example: 658000000. This frequency is 658Mhz."), - .opts = PO_ADVANCED - }, - { - .type = PT_U32, - .id = "iptv_satip_dvbc_freq", - .name = N_("SAT>IP DVB-C frequency (Hz)"), - .off = offsetof(iptv_mux_t, mm_iptv_satip_dvbc_freq), - .desc = N_("For example: 312000000. This frequency is 312Mhz."), - .opts = PO_ADVANCED - }, - { - .type = PT_U32, - .id = "iptv_satip_dvbs_freq", - .name = N_("SAT>IP DVB-S frequency (kHz)"), - .off = offsetof(iptv_mux_t, mm_iptv_satip_dvbs_freq), - .desc = N_("For example: 12610500. This frequency is 12610.5Mhz or 12.6105Ghz."), - .opts = PO_ADVANCED - }, - { - .type = PT_U32, .id = "iptv_buffer_limit", .name = N_("Buffering limit (ms)"), .desc = N_("Specifies the incoming buffering limit in " diff --git a/src/input/mpegts/iptv/iptv_private.h b/src/input/mpegts/iptv/iptv_private.h index 2d18765..3fa3476 100644 --- a/src/input/mpegts/iptv/iptv_private.h +++ b/src/input/mpegts/iptv/iptv_private.h @@ -134,9 +134,6 @@ struct iptv_mux char *mm_iptv_env; char *mm_iptv_hdr; char *mm_iptv_tags; - uint32_t mm_iptv_satip_dvbt_freq; - uint32_t mm_iptv_satip_dvbc_freq; - uint32_t mm_iptv_satip_dvbs_freq; uint32_t mm_iptv_rtp_seq; diff --git a/src/input/mpegts/mpegts_mux.c b/src/input/mpegts/mpegts_mux.c index 3421f49..57a8094 100644 --- a/src/input/mpegts/mpegts_mux.c +++ b/src/input/mpegts/mpegts_mux.c @@ -621,6 +621,30 @@ const idclass_t mpegts_mux_class = .list = mpegts_mux_class_scan_result_enum, }, { + .type = PT_U32, + .id = "remap_satip_dvbt_freq", + .name = N_("SAT>IP DVB-T frequency (Hz)"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbt_freq), + .desc = N_("For example: 658000000. This frequency is 658Mhz."), + .opts = PO_ADVANCED + }, + { + .type = PT_U32, + .id = "remap_satip_dvbc_freq", + .name = N_("SAT>IP DVB-C frequency (Hz)"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbc_freq), + .desc = N_("For example: 312000000. This frequency is 312Mhz."), + .opts = PO_ADVANCED + }, + { + .type = PT_U32, + .id = "remap_satip_dvbs_freq", + .name = N_("SAT>IP DVB-S frequency (kHz)"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbs_freq), + .desc = N_("For example: 12610500. This frequency is 12610.5Mhz or 12.6105Ghz."), + .opts = PO_ADVANCED + }, + { .type = PT_STR, .id = "charset", .name = N_("Character set"), diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 06fbe87..88a8fe2 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -617,27 +617,43 @@ rtsp_start } } } -#if ENABLE_IPTV - if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) { - LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) { - if (rs->dmc.dmc_fe_type == DVB_TYPE_T && - deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbt_freq) < 2000) - break; - if (rs->dmc.dmc_fe_type == DVB_TYPE_C && - deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbc_freq) < 2000) - break; - if (rs->dmc.dmc_fe_type == DVB_TYPE_S && - deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbs_freq) < 2000) - break; - } - if (mux) { + } + // MUX not found, search for a SAT>IP frequency remap + LIST_FOREACH(mn, &mpegts_network_all, mn_global_link) { + LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) { + if (rs->dmc.dmc_fe_type == DVB_TYPE_T && + deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbt_freq) < 2000) + break; + if (rs->dmc.dmc_fe_type == DVB_TYPE_C && + deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbc_freq) < 2000) + break; + if (rs->dmc.dmc_fe_type == DVB_TYPE_S && + deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbs_freq) < 2000) + break; + } + if (mux) { + if (idnode_is_instance(&mn->mn_id, &dvb_network_class)) { + dmc = ((dvb_mux_t *)mux)->lm_tuning; + rs->perm_lock = 0; + } else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) { dmc = rs->dmc; rs->perm_lock = 1; - break; + } else if (idnode_is_instance(&mn->mn_id, &mpegts_network_class)) { + dmc = rs->dmc; + rs->perm_lock = 1; + } else { + // TODO: Unkown Network Type to Remap + tvhwarn(LS_SATIPS, "Error! Found a REMAP for a MUX type (%s) not implemented.", mn->mn_id.in_class->ic_class); + mux = NULL; + buf[0]='\0'; } + // dvb_mux_conf_str(&dmc, buf, sizeof(buf)); + mpegts_mux_nice_name(mux, buf, sizeof(buf)); + tvhdebug(LS_SATIPS, "MUX remapping -> FREQ: %i to MUX: %s", rs->dmc.dmc_fe_freq, buf); + break; } -#endif } + if (mux == NULL && mn2 && (rtsp_muxcnf == MUXCNF_AUTO || rtsp_muxcnf == MUXCNF_KEEP)) { dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf)); diff --git a/src/satip/server.c b/src/satip/server.c index 7c9c242..5b81ced 100644 --- a/src/satip/server.c +++ b/src/satip/server.c @@ -150,22 +150,20 @@ satip_server_http_xml(http_connection_t *hc) dvbc++; else if (idnode_is_instance(&mn->mn_id, &dvb_network_atsc_t_class)) atsc++; -#if ENABLE_IPTV - else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) { - mpegts_mux_t *mm; - LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link) { - if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbt_freq) { - dvbt++; - } - if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbc_freq) { - dvbc++; - } - if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbs_freq) { - dvbs++; - } + } + LIST_FOREACH(mn, &mpegts_network_all, mn_global_link) { + mpegts_mux_t *mux; + LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) { + if (mux->mm_remap_satip_dvbt_freq) { + dvbt++; + } + if (mux->mm_remap_satip_dvbc_freq) { + dvbc++; + } + if (mux->mm_remap_satip_dvbs_freq) { + dvbs++; } } -#endif } // The SAT>IP specification only supports 1-9 tuners (1 digit)! if (dvbt > 9) dvbt = 9;