diff --git a/src/input/mpegts.h b/src/input/mpegts.h index 32694fa..0f6b319 100644 --- a/src/input/mpegts.h +++ b/src/input/mpegts.h @@ -536,6 +536,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 c796a47..4ca6626 100644 --- a/src/input/mpegts/iptv/iptv_mux.c +++ b/src/input/mpegts/iptv/iptv_mux.c @@ -245,26 +245,23 @@ 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 + .name = N_("DEPRECATED"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbt_freq), + .opts = PO_HIDDEN | PO_NOUI }, { .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 + .name = N_("DEPRECATED"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbc_freq), + .opts = PO_HIDDEN | PO_NOUI }, { .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 + .name = N_("DEPRECATED"), + .off = offsetof(mpegts_mux_t, mm_remap_satip_dvbs_freq), + .opts = PO_HIDDEN | PO_NOUI }, { .type = PT_U32, diff --git a/src/input/mpegts/iptv/iptv_private.h b/src/input/mpegts/iptv/iptv_private.h index 6a18933..1e21eb1 100644 --- a/src/input/mpegts/iptv/iptv_private.h +++ b/src/input/mpegts/iptv/iptv_private.h @@ -135,9 +135,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 ab7fe94..668cfe1 100644 --- a/src/input/mpegts/mpegts_mux.c +++ b/src/input/mpegts/mpegts_mux.c @@ -624,6 +624,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 7641b85..a9af764 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -619,27 +619,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 d1b0c1f..cfc1c68 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;