Project

General

Profile

Feature #4784 » SAT-IP-Server-remap-for-all-MPEGTS-inputs-v4.diff

Mono Polimorph, 2018-02-01 12:43

View differences:

src/input/mpegts.h
538 538
  uint16_t mm_sid_filter;
539 539

  
540 540
  /*
541
   * SAT>IP Remap
542
   */
543
  uint32_t        mm_remap_satip_dvbt_freq;
544
  uint32_t        mm_remap_satip_dvbc_freq;
545
  uint32_t        mm_remap_satip_dvbs_freq;
546

  
547
  /*
541 548
   * TSDEBUG
542 549
   */
543 550
#if ENABLE_TSDEBUG
src/input/mpegts/iptv/iptv_mux.c
244 244
    },
245 245
    {
246 246
      .type     = PT_U32,
247
      .id       = "iptv_satip_dvbt_freq",
248
      .name     = N_("SAT>IP DVB-T frequency (Hz)"),
249
      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbt_freq),
250
      .desc     = N_("For example: 658000000. This frequency is 658Mhz."),
251
      .opts     = PO_ADVANCED
252
    },
253
    {
254
      .type     = PT_U32,
255
      .id       = "iptv_satip_dvbc_freq",
256
      .name     = N_("SAT>IP DVB-C frequency (Hz)"),
257
      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbc_freq),
258
      .desc     = N_("For example: 312000000. This frequency is 312Mhz."),
259
      .opts     = PO_ADVANCED
260
    },
261
    {
262
      .type     = PT_U32,
263
      .id       = "iptv_satip_dvbs_freq",
264
      .name     = N_("SAT>IP DVB-S frequency (kHz)"),
265
      .off      = offsetof(iptv_mux_t, mm_iptv_satip_dvbs_freq),
266
      .desc     = N_("For example: 12610500. This frequency is 12610.5Mhz or 12.6105Ghz."),
267
      .opts     = PO_ADVANCED
268
    },
269
    {
270
      .type     = PT_U32,
271 247
      .id       = "iptv_buffer_limit",
272 248
      .name     = N_("Buffering limit (ms)"),
273 249
      .desc     = N_("Specifies the incoming buffering limit in "
src/input/mpegts/iptv/iptv_private.h
134 134
  char                 *mm_iptv_env;
135 135
  char                 *mm_iptv_hdr;
136 136
  char                 *mm_iptv_tags;
137
  uint32_t              mm_iptv_satip_dvbt_freq;
138
  uint32_t              mm_iptv_satip_dvbc_freq;
139
  uint32_t              mm_iptv_satip_dvbs_freq;
140 137

  
141 138
  uint32_t              mm_iptv_rtp_seq;
142 139

  
src/input/mpegts/mpegts_mux.c
624 624
      .list     = mpegts_mux_class_scan_result_enum,
625 625
    },
626 626
    {
627
      .type     = PT_U32,
628
      .id       = "iptv_satip_dvbt_freq",
629
      .name     = N_("SAT>IP DVB-T frequency (Hz)"),
630
      .off      = offsetof(mpegts_mux_t, mm_remap_satip_dvbt_freq),
631
      .desc     = N_("For example: 658000000. This frequency is 658Mhz."),
632
      .opts     = PO_ADVANCED
633
    },
634
    {
635
      .type     = PT_U32,
636
      .id       = "iptv_satip_dvbc_freq",
637
      .name     = N_("SAT>IP DVB-C frequency (Hz)"),
638
      .off      = offsetof(mpegts_mux_t, mm_remap_satip_dvbc_freq),
639
      .desc     = N_("For example: 312000000. This frequency is 312Mhz."),
640
      .opts     = PO_ADVANCED
641
    },
642
    {
643
      .type     = PT_U32,
644
      .id       = "iptv_satip_dvbs_freq",
645
      .name     = N_("SAT>IP DVB-S frequency (kHz)"),
646
      .off      = offsetof(mpegts_mux_t, mm_remap_satip_dvbs_freq),
647
      .desc     = N_("For example: 12610500. This frequency is 12610.5Mhz or 12.6105Ghz."),
648
      .opts     = PO_ADVANCED
649
    },
650
    {
627 651
      .type     = PT_STR,
628 652
      .id       = "charset",
629 653
      .name     = N_("Character set"),
src/satip/rtsp.c
619 619
          }
620 620
        }
621 621
      }
622
#if ENABLE_IPTV
623
      if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
624
        LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) {
625
          if (rs->dmc.dmc_fe_type == DVB_TYPE_T &&
626
              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbt_freq) < 2000)
627
            break;
628
          if (rs->dmc.dmc_fe_type == DVB_TYPE_C &&
629
              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbc_freq) < 2000)
630
            break;
631
          if (rs->dmc.dmc_fe_type == DVB_TYPE_S &&
632
              deltaU32(rs->dmc.dmc_fe_freq, ((iptv_mux_t *)mux)->mm_iptv_satip_dvbs_freq) < 2000)
633
            break;
634
          }
635
        if (mux) {
622
    }
623
    // MUX not found, search for a SAT>IP frequency remap
624
    LIST_FOREACH(mn, &mpegts_network_all, mn_global_link) {
625
      LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) {
626
        if (rs->dmc.dmc_fe_type == DVB_TYPE_T &&
627
            deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbt_freq) < 2000)
628
          break;
629
        if (rs->dmc.dmc_fe_type == DVB_TYPE_C &&
630
            deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbc_freq) < 2000)
631
          break;
632
        if (rs->dmc.dmc_fe_type == DVB_TYPE_S &&
633
            deltaU32(rs->dmc.dmc_fe_freq, mux->mm_remap_satip_dvbs_freq) < 2000)
634
          break;
635
      }
636
      if (mux) {
637
        if (idnode_is_instance(&mn->mn_id, &dvb_network_class)) {
638
          dmc = ((dvb_mux_t *)mux)->lm_tuning;
639
          rs->perm_lock = 0;
640
        } else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
636 641
          dmc = rs->dmc;
637 642
          rs->perm_lock = 1;
638
          break;
643
        } else if (idnode_is_instance(&mn->mn_id, &mpegts_network_class)) {
644
          dmc = rs->dmc;
645
          rs->perm_lock = 1;
646
        } else {
647
          // TODO: Unkown Network Type to Remap
648
          tvhwarn(LS_SATIPS, "Error! Found a REMAP for a MUX type (%s) not implemented.", mn->mn_id.in_class->ic_class);
649
          mux = NULL;
650
          buf[0]='\0';
639 651
        }
652
        //  dvb_mux_conf_str(&dmc, buf, sizeof(buf));
653
        mpegts_mux_nice_name(mux, buf, sizeof(buf));
654
        tvhdebug(LS_SATIPS, "MUX remapping -> FREQ: %i to MUX: %s", rs->dmc.dmc_fe_freq, buf);
655
        break;
640 656
      }
641
#endif
642 657
    }
658

  
643 659
    if (mux == NULL && mn2 &&
644 660
        (rtsp_muxcnf == MUXCNF_AUTO || rtsp_muxcnf == MUXCNF_KEEP)) {
645 661
      dvb_mux_conf_str(&rs->dmc, buf, sizeof(buf));
src/satip/server.c
150 150
      dvbc++;
151 151
    else if (idnode_is_instance(&mn->mn_id, &dvb_network_atsc_t_class))
152 152
      atsc++;
153
#if ENABLE_IPTV
154
    else if (idnode_is_instance(&mn->mn_id, &iptv_network_class)) {
155
      mpegts_mux_t *mm;
156
      LIST_FOREACH(mm, &mn->mn_muxes, mm_network_link) {
157
        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbt_freq) {
158
          dvbt++;
159
        }
160
        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbc_freq) {
161
          dvbc++;
162
        }
163
        if (((iptv_mux_t *)mm)->mm_iptv_satip_dvbs_freq) {
164
          dvbs++;
165
        }
153
  }
154
  LIST_FOREACH(mn, &mpegts_network_all, mn_global_link) {
155
    mpegts_mux_t *mux;
156
    LIST_FOREACH(mux, &mn->mn_muxes, mm_network_link) {
157
      if (mux->mm_remap_satip_dvbt_freq) {
158
        dvbt++;
159
      }
160
      if (mux->mm_remap_satip_dvbc_freq) {
161
        dvbc++;
162
      }
163
      if (mux->mm_remap_satip_dvbs_freq) {
164
        dvbs++;
166 165
      }
167 166
    }
168
#endif
169 167
  }
170 168
  // The SAT>IP specification only supports 1-9 tuners (1 digit)!
171 169
  if (dvbt > 9) dvbt = 9;
(4-4/4)