Ticket #8580: mythtv-add_demo_tuner.patch
File mythtv-add_demo_tuner.patch, 7.1 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/cardutil.h
--- libs/libmythtv/cardutil.cpp | 6 6 + 0 - 0 ! libs/libmythtv/cardutil.h | 11 7 + 4 - 0 ! libs/libmythtv/mpegrecorder.cpp | 11 2 + 9 - 0 ! libs/libmythtv/tv_rec.cpp | 6 2 + 4 - 0 ! libs/libmythtv/videosource.cpp | 42 42 + 0 - 0 ! libs/libmythtv/videosource.h | 16 16 + 0 - 0 ! 6 files changed, 75 insertions(+), 17 deletions(-)
old new 52 52 OFDM = 5, DVBT = 5, 53 53 ATSC = 6, 54 54 V4L = 7, 55 MPEG = 8, 55 MPEG = 8, DEMO = 8, 56 56 FIREWIRE = 9, 57 57 HDHOMERUN = 10, 58 58 FREEBOX = 11, … … 93 93 return DVBS2; 94 94 if ("IMPORT" == name) 95 95 return IMPORT; 96 if ("DEMO" == name) 97 return DEMO; 96 98 return ERROR_UNKNOWN; 97 99 } 98 100 … … 113 115 { 114 116 return 115 117 (rawtype == "FIREWIRE") || (rawtype == "IMPORT") || 116 (rawtype == "HDPVR") ;118 (rawtype == "HDPVR") || (rawtype == "DEMO"); 117 119 } 118 120 119 121 static bool IsEITCapable(const QString &rawtype) … … 139 141 { 140 142 return 141 143 (rawtype == "V4L") || (rawtype == "MPEG") || 142 (rawtype == "HDPVR") ;144 (rawtype == "HDPVR") || (rawtype == "DEMO"); 143 145 } 144 146 145 147 static bool IsSingleInputCard(const QString &rawtype) 146 148 { 147 149 return 148 150 (rawtype == "FIREWIRE") || (rawtype == "FREEBOX") || 149 (rawtype == "HDHOMERUN") || (rawtype == "IMPORT"); 151 (rawtype == "HDHOMERUN") || (rawtype == "IMPORT") || 152 (rawtype == "DEMO"); 150 153 } 151 154 152 155 /// Convenience function for GetCardIDs() -
libs/libmythtv/videosource.h
old new 519 519 TunerCardInput *input; 520 520 }; 521 521 522 class DemoConfigurationGroup: public VerticalConfigurationGroup 523 { 524 Q_OBJECT 525 526 public: 527 DemoConfigurationGroup(CaptureCard &parent); 528 529 public slots: 530 void probeCard(const QString &device); 531 532 private: 533 CaptureCard &parent; 534 TransLabelSetting *cardinfo; 535 TunerCardInput *input; 536 }; 537 522 538 class HDPVRConfigurationGroup: public VerticalConfigurationGroup 523 539 { 524 540 Q_OBJECT -
libs/libmythtv/cardutil.cpp
old new 1644 1644 { 1645 1645 bool ok; 1646 1646 QStringList ret; 1647 if (device.endsWith(".mpg")) 1648 { 1649 ret += "MPEG2TS"; 1650 return ret; 1651 } 1652 1647 1653 QByteArray dev = device.toAscii(); 1648 1654 int videofd = open(dev.constData(), O_RDWR); 1649 1655 if (videofd < 0) -
libs/libmythtv/videosource.cpp
old new 20 20 #include <QDir> 21 21 #include <QProcess> 22 22 #include <QDateTime> 23 #include <QFile> 23 24 24 25 // MythTV headers 25 26 #include "mythconfig.h" … … 1938 1939 input->fillSelections(device); 1939 1940 } 1940 1941 1942 DemoConfigurationGroup::DemoConfigurationGroup(CaptureCard &a_parent) : 1943 VerticalConfigurationGroup(false, true, false, false), 1944 parent(a_parent), cardinfo(new TransLabelSetting()), 1945 input(new TunerCardInput(parent)) 1946 { 1947 VideoDevice *device = 1948 new VideoDevice(parent, 0, 15, QString::null, "ivtv"); 1949 1950 cardinfo->setLabel(tr("Probed info")); 1951 1952 addChild(device); 1953 addChild(cardinfo); 1954 //addChild(input); 1955 1956 connect(device, SIGNAL(valueChanged(const QString&)), 1957 this, SLOT( probeCard( const QString&))); 1958 1959 probeCard(device->getValue()); 1960 } 1961 1962 void DemoConfigurationGroup::probeCard(const QString &device) 1963 { 1964 QString cn = tr("Failed to open"), ci = cn, dn = QString::null; 1965 QFileInfo fileInfo(device); 1966 if (fileInfo.exists()) 1967 { 1968 if (fileInfo.isReadable() && (fileInfo.isFile())) 1969 ci = cn = tr("File Access Success"); 1970 } 1971 else 1972 { 1973 ci = cn = tr("File Access Failure"); 1974 } 1975 cardinfo->setValue(ci); 1976 input->fillSelections(device); 1977 } 1978 1941 1979 HDPVRConfigurationGroup::HDPVRConfigurationGroup(CaptureCard &a_parent) : 1942 1980 VerticalConfigurationGroup(false, true, false, false), 1943 1981 parent(a_parent), cardinfo(new TransLabelSetting()), … … 2016 2054 addTarget("FREEBOX", new IPTVConfigurationGroup(parent)); 2017 2055 #endif // USING_IPTV 2018 2056 2057 //for development or testing purposes 2058 addTarget("DEMO", new DemoConfigurationGroup(parent)); 2059 2019 2060 addTarget("IMPORT", new ImportConfigurationGroup(parent)); 2020 2061 } 2021 2062 … … 2221 2262 setting->addSelection(QObject::tr("Network recorder"), "FREEBOX"); 2222 2263 #endif // USING_IPTV 2223 2264 2265 setting->addSelection(QObject::tr("Demo recorder"), "DEMO"); 2224 2266 setting->addSelection(QObject::tr("Import recorder"), "IMPORT"); 2225 2267 } 2226 2268 -
libs/libmythtv/mpegrecorder.cpp
old new 307 307 (void)audiodev; 308 308 (void)vbidev; 309 309 310 if (videodev.toLower(). left(5) == "file:")310 if (videodev.toLower().right(4) == ".mpg") 311 311 { 312 312 deviceIsMpegFile = true; 313 313 bufferSize = 64000; 314 QString newVideoDev = videodev;315 if (newVideoDev.startsWith("file:", Qt::CaseInsensitive))316 newVideoDev = newVideoDev.remove(0,5);317 SetOption("videodevice", newVideoDev);318 }319 else320 {321 SetOption("videodevice", videodev);322 314 } 323 315 316 SetOption("videodevice", videodev); 324 317 SetOption("audiodevice", audiodev); 325 318 326 319 SetOption("tvformat", gCoreContext->GetSetting("TVFormat")); -
libs/libmythtv/tv_rec.cpp
old new 181 181 init_run = true; 182 182 #endif 183 183 } 184 else if ((genOpt.cardtype == "IMPORT") || 185 (genOpt.cardtype == "MPEG" && 186 genOpt.videodev.toLower().left(5) == "file:")) 184 else if ((genOpt.cardtype == "IMPORT") || (genOpt.cardtype == "DEMO")) 187 185 { 188 186 channel = new DummyChannel(this); 189 187 if (!channel->Open()) … … 976 974 bool TVRec::SetupRecorder(RecordingProfile &profile) 977 975 { 978 976 recorder = NULL; 979 if ( genOpt.cardtype == "MPEG")977 if ((genOpt.cardtype == "MPEG") || (genOpt.cardtype == "DEMO")) 980 978 { 981 979 #ifdef USING_IVTV 982 980 recorder = new MpegRecorder(this);