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) |
140 | 140 | QString channum = it.key(); |
141 | 141 | QString name = (*it).m_name; |
142 | 142 | QString xmltvid = (*it).m_xmltvid.isEmpty() ? "" : (*it).m_xmltvid; |
| 143 | uint programnumber = (*it).m_programnumber; |
143 | 144 | //: %1 is the channel number, %2 is the channel name |
144 | 145 | QString msg = tr("Channel #%1 : %2").arg(channum).arg(name); |
145 | 146 | |
… |
… |
void IPTVChannelFetcher::run(void) |
157 | 158 | chanid = ChannelUtil::CreateChanID(_sourceid, channum); |
158 | 159 | ChannelUtil::CreateChannel( |
159 | 160 | 0, _sourceid, chanid, name, name, channum, |
160 | | 0, 0, 0, false, false, false, QString::null, |
| 161 | programnumber, 0, 0, false, false, false, QString::null, |
161 | 162 | QString::null, "Default", xmltvid); |
162 | 163 | ChannelUtil::CreateIPTVTuningData(chanid, (*it).m_tuning); |
163 | 164 | } |
… |
… |
void IPTVChannelFetcher::run(void) |
170 | 171 | } |
171 | 172 | ChannelUtil::UpdateChannel( |
172 | 173 | 0, _sourceid, chanid, name, name, channum, |
173 | | 0, 0, 0, false, false, false, QString::null, |
| 174 | programnumber, 0, 0, false, false, false, QString::null, |
174 | 175 | QString::null, "Default", xmltvid); |
175 | 176 | ChannelUtil::UpdateIPTVTuningData(chanid, (*it).m_tuning); |
176 | 177 | } |
… |
… |
static bool parse_chan_info(const QString &rawdata, |
350 | 351 | // #EXTMYTHTV:fecurl1=URL <-- optional line (myth specific) |
351 | 352 | // #EXTMYTHTV:fecbitrate0=BITRATE <-- optional line (myth specific) |
352 | 353 | // #EXTMYTHTV:fecbitrate1=BITRATE <-- optional line (myth specific) |
| 354 | // #EXTVLCOPT:program=program_number <-- optional line (used by MythTV and VLC) |
353 | 355 | // #... <-- ignored comments |
354 | 356 | // rtsp://maiptv.iptv.fr/iptvtv/201 <-- url |
355 | 357 | |
… |
… |
static bool parse_chan_info(const QString &rawdata, |
376 | 378 | if (!key.isEmpty()) |
377 | 379 | values[key] = data.mid(data.indexOf('=')+1); |
378 | 380 | } |
| 381 | else if (line.startsWith("#EXTVLCOPT:program=")) |
| 382 | { |
| 383 | values["programnumber"] = line.mid(line.indexOf('=')+1); |
| 384 | } |
379 | 385 | continue; |
380 | 386 | } |
381 | 387 | |
… |
… |
static bool parse_chan_info(const QString &rawdata, |
394 | 400 | line, values["bitrate"].toUInt(), |
395 | 401 | values["fectype"], |
396 | 402 | values["fecurl0"], values["fecbitrate0"].toUInt(), |
397 | | values["fecurl1"], values["fecbitrate1"].toUInt()); |
| 403 | values["fecurl1"], values["fecbitrate1"].toUInt(), |
| 404 | values["programnumber"].toUInt()); |
398 | 405 | return true; |
399 | 406 | } |
400 | 407 | } |
diff --git a/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.h b/mythtv/libs/libmythtv/channelscan/iptvchannelfetcher.h
index 030da62..af728b5 100644
a
|
b
|
class IPTVChannelInfo |
35 | 35 | const QString &fec_url0, |
36 | 36 | uint fec_bitrate0, |
37 | 37 | 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), |
40 | 41 | m_tuning(data_url, data_bitrate, |
41 | 42 | fec_type, fec_url0, fec_bitrate0, fec_url1, fec_bitrate1) |
42 | 43 | { |
… |
… |
class IPTVChannelInfo |
50 | 51 | public: |
51 | 52 | QString m_name; |
52 | 53 | QString m_xmltvid; |
| 54 | uint m_programnumber; |
53 | 55 | IPTVTuningData m_tuning; |
54 | 56 | }; |
55 | 57 | typedef QMap<QString,IPTVChannelInfo> fbox_chan_map_t; |