Ticket #11487: 0002-extend-IPTV-recorder-to-handle-MTPS-input.patch

File 0002-extend-IPTV-recorder-to-handle-MTPS-input.patch, 4.8 KB (added by Karl Egly, 12 years ago)

bring the MPTS service selection forward to master / 0.27 - draft

  • mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp

    From 241621e6798320489109473d9fdfafc72487c82c Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@mythtv.org>
    Date: Thu, 9 Jan 2014 20:45:02 +0100
    Subject: [PATCH 2/2] extend IPTV recorder to handle MTPS input
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    By parsing VLC style program_number from the playlist the recorder
    can select a specific program from the stream. The program_number
    is also known as the service_id in DVB vocabulary.
    
    Example playlist:
    
        #EXTM3U
        #EXTINF:0,1 - name of the program
        #EXTVLCOPT:program=61200
        http://192.168.1.100:8001/1:0:19:EF10:421:1:C00000:0:0:0:
    
    Original patch by Torbjörn Jansson
    Refs #11487
    ---
     .../libmythtv/channelscan/iptvchannelfetcher.cpp   |   13 ++++++++++---
     .../libmythtv/channelscan/iptvchannelfetcher.h     |    6 ++++--
     2 files changed, 14 insertions(+), 5 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.cpp
    index d09a713..5f32f6c 100644
    a b void IPTVChannelFetcher::run(void) 
    140140        QString channum = it.key();
    141141        QString name    = (*it).m_name;
    142142        QString xmltvid = (*it).m_xmltvid.isEmpty() ? "" : (*it).m_xmltvid;
     143        uint programnumber = (*it).m_programnumber;
    143144        //: %1 is the channel number, %2 is the channel name
    144145        QString msg = tr("Channel #%1 : %2").arg(channum).arg(name);
    145146
    void IPTVChannelFetcher::run(void) 
    157158            chanid = ChannelUtil::CreateChanID(_sourceid, channum);
    158159            ChannelUtil::CreateChannel(
    159160                0, _sourceid, chanid, name, name, channum,
    160                 0, 0, 0, false, false, false, QString::null,
     161                programnumber, 0, 0, false, false, false, QString::null,
    161162                QString::null, "Default", xmltvid);
    162163            ChannelUtil::CreateIPTVTuningData(chanid, (*it).m_tuning);
    163164        }
    void IPTVChannelFetcher::run(void) 
    170171            }
    171172            ChannelUtil::UpdateChannel(
    172173                0, _sourceid, chanid, name, name, channum,
    173                 0, 0, 0, false, false, false, QString::null,
     174                programnumber, 0, 0, false, false, false, QString::null,
    174175                QString::null, "Default", xmltvid);
    175176            ChannelUtil::UpdateIPTVTuningData(chanid, (*it).m_tuning);
    176177        }
    static bool parse_chan_info(const QString &rawdata, 
    350351    // #EXTMYTHTV:fecurl1=URL                <-- optional line (myth specific)
    351352    // #EXTMYTHTV:fecbitrate0=BITRATE        <-- optional line (myth specific)
    352353    // #EXTMYTHTV:fecbitrate1=BITRATE        <-- optional line (myth specific)
     354    // #EXTVLCOPT:program=program_number     <-- optional line (used by MythTV and VLC)
    353355    // #...                                  <-- ignored comments
    354356    // rtsp://maiptv.iptv.fr/iptvtv/201 <-- url
    355357
    static bool parse_chan_info(const QString &rawdata, 
    376378                if (!key.isEmpty())
    377379                    values[key] = data.mid(data.indexOf('=')+1);
    378380            }
     381            else if (line.startsWith("#EXTVLCOPT:program="))
     382            {
     383                values["programnumber"] = line.mid(line.indexOf('=')+1);
     384            }
    379385            continue;
    380386        }
    381387
    static bool parse_chan_info(const QString &rawdata, 
    394400            line, values["bitrate"].toUInt(),
    395401            values["fectype"],
    396402            values["fecurl0"], values["fecbitrate0"].toUInt(),
    397             values["fecurl1"], values["fecbitrate1"].toUInt());
     403            values["fecurl1"], values["fecbitrate1"].toUInt(),
     404            values["programnumber"].toUInt());
    398405        return true;
    399406    }
    400407}
  • mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.h

    diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.h b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.h
    index 030da62..af728b5 100644
    a b class IPTVChannelInfo 
    3535                    const QString &fec_url0,
    3636                    uint fec_bitrate0,
    3737                    const QString &fec_url1,
    38                     uint fec_bitrate1) :
    39         m_name(name), m_xmltvid(xmltvid),
     38                    uint fec_bitrate1,
     39                    uint programnumber) :
     40        m_name(name), m_xmltvid(xmltvid), m_programnumber(programnumber),
    4041        m_tuning(data_url, data_bitrate,
    4142                 fec_type, fec_url0, fec_bitrate0, fec_url1, fec_bitrate1)
    4243    {
    class IPTVChannelInfo 
    5051  public:
    5152    QString m_name;
    5253    QString m_xmltvid;
     54    uint m_programnumber;
    5355    IPTVTuningData m_tuning;
    5456};
    5557typedef QMap<QString,IPTVChannelInfo> fbox_chan_map_t;