Ticket #5443: 5443-recordingprofiles-schema1222-1223.patch
File 5443-recordingprofiles-schema1222-1223.patch, 30.3 KB (added by , 16 years ago) |
---|
-
configure
158 158 echo " --disable-hdhomerun disable support for HDHomeRun boxes" 159 159 echo " --disable-v4l disable Video4Linux support" 160 160 echo " --disable-ivtv disable ivtv support (PVR-x50) req. v4l support" 161 echo " --disable-hdpvr disable HD-PVR support" 161 162 echo " --disable-dvb disable DVB support" 162 163 echo " --dvb-path=HDRLOC location of directory containing" 163 164 echo " 'linux/dvb/frontend.h', not the" … … 892 893 hdhomerun 893 894 iptv 894 895 ivtv 896 hdpvr 895 897 joystick_menu 896 898 libfftw3 897 899 lirc … … 1049 1051 firewire_deps="backend" 1050 1052 iptv_deps="backend" 1051 1053 ivtv_deps="backend v4l" 1054 hdpvr_deps="backend v4l" 1052 1055 hdhomerun_deps="backend" 1053 1056 opengl_deps="GL_gl_h" 1054 1057 opengl_deps_any="windows x11" … … 1181 1184 hdhomerun="yes" 1182 1185 iptv="yes" 1183 1186 ivtv="yes" 1187 hdpvr="yes" 1184 1188 joystick_menu="default" 1185 1189 lamemp3="yes" 1186 1190 lirc="yes" … … 1618 1622 enable darwin 1619 1623 disable dvb 1620 1624 disable ivtv 1625 disable hdpvr 1621 1626 ldver=$(ld -v 2>&1 | sed -e s/^[^-]*-//) 1622 1627 osxver=$(uname -r | cut -c 1) 1623 1628 if [[ ${ldver%.*} -lt "82" && ${osxver} = "9" && ${arch} = "x86_32" ]]; then … … 1648 1653 disable dv1394 1649 1654 disable dvb 1650 1655 disable ivtv 1656 disable hdpvr 1651 1657 enable memalign_hack 1652 1658 disable network 1653 1659 enable opengl … … 3019 3025 if enabled backend; then 3020 3026 echo "Video4Linux sup. ${v4l-no}" 3021 3027 echo "ivtv support ${ivtv-no}" 3028 echo "hdpvr support ${hdpvr-no}" 3022 3029 echo "FireWire support ${firewire-no}" 3023 3030 echo "DVB support ${dvb-no} [$dvb_path]" 3024 3031 echo "DBox2 support ${dbox2-no}" -
libs/libmythtv/cardutil.h
53 53 FIREWIRE = 9, 54 54 HDHOMERUN = 10, 55 55 FREEBOX = 11, 56 HDPVR = 12, 56 57 }; 57 58 58 59 static enum CARD_TYPES toCardType(const QString &name) … … 81 82 return HDHOMERUN; 82 83 if ("FREEBOX" == name) 83 84 return FREEBOX; 85 if ("HDPVR" == name) 86 return HDPVR; 84 87 return ERROR_UNKNOWN; 85 88 } 86 89 … … 95 98 static bool IsUnscanable(const QString &rawtype) 96 99 { 97 100 return 98 (rawtype == "FIREWIRE") || (rawtype == "DBOX2"); 101 (rawtype == "FIREWIRE") || (rawtype == "DBOX2") || 102 (rawtype == "HDPVR"); 99 103 } 100 104 101 105 static bool IsEITCapable(const QString &rawtype) … … 119 123 120 124 static bool IsTuningAnalog(const QString &rawtype) 121 125 { 122 return (rawtype == "V4L"); 126 return 127 (rawtype == "V4L") || (rawtype == "MPEG") || 128 (rawtype == "HDPVR"); 123 129 } 124 130 125 131 /// Convenience function for GetCardIDs(const QString&, QString, QString) … … 146 152 { return get_on_cardid("cardtype", cardid).upper(); } 147 153 static QString GetVideoDevice(uint cardid) 148 154 { return get_on_cardid("videodevice", cardid); } 155 static QString GetAudioDevice(uint cardid) 156 { return get_on_cardid("audiodevice", cardid); } 149 157 static QString GetVBIDevice(uint cardid) 150 158 { return get_on_cardid("vbidevice", cardid); } 151 159 static uint GetHDHRTuner(uint cardid) … … 193 201 194 202 static QString ProbeSubTypeName(uint cardid); 195 203 196 static QStringList probeInputs(QString device, 197 QString cardtype = QString::null); 204 static QStringList ProbeVideoInputs(QString device, 205 QString cardtype = QString::null); 206 static QStringList ProbeAudioInputs(QString device, 207 QString cardtype = QString::null); 198 208 static void GetCardInputs(uint cardid, 199 209 const QString &device, 200 210 const QString &cardtype, … … 239 249 uint32_t &version); 240 250 static bool GetV4LInfo(int videofd, QString &card, QString &driver) 241 251 { uint32_t dummy; return GetV4LInfo(videofd, card, driver, dummy); } 242 static InputNames probeV4LInputs(int videofd, bool &ok); 252 static InputNames ProbeV4LVideoInputs(int videofd, bool &ok); 253 static InputNames ProbeV4LAudioInputs(int videofd, bool &ok); 243 254 244 255 private: 245 static QStringList probeV4LInputs(QString device); 246 static QStringList probeDVBInputs(QString device); 256 static QStringList ProbeV4LVideoInputs(QString device); 257 static QStringList ProbeV4LAudioInputs(QString device); 258 static QStringList ProbeDVBInputs(QString device); 247 259 }; 248 260 249 261 #endif //_CARDUTIL_H_ -
libs/libmythtv/videosource.h
365 365 } 366 366 }; 367 367 368 class TunerCardAudioInput : public ComboBoxSetting, public CaptureCardDBStorage 369 { 370 Q_OBJECT 371 public: 372 TunerCardAudioInput(const CaptureCard &parent, 373 QString dev = QString::null, 374 QString type = QString::null); 375 376 public slots: 377 void fillSelections(const QString &device); 378 379 private: 380 QString last_device; 381 QString last_cardtype; 382 }; 383 368 384 class DVBAudioDevice : public LineEditSetting, public CaptureCardDBStorage 369 385 { 370 386 Q_OBJECT … … 455 471 TunerCardInput *input; 456 472 }; 457 473 474 class HDPVRConfigurationGroup: public VerticalConfigurationGroup 475 { 476 Q_OBJECT 477 478 public: 479 HDPVRConfigurationGroup(CaptureCard &parent); 480 481 public slots: 482 void probeCard(const QString &device); 483 484 private: 485 CaptureCard &parent; 486 TransLabelSetting *cardinfo; 487 TunerCardInput *videoinput; 488 TunerCardAudioInput *audioinput; 489 }; 490 458 491 class DVBCardNum; 459 492 class DVBInput; 460 493 class DVBCardName; -
libs/libmythtv/libmythtv.pro
477 477 using_ivtv:SOURCES += mpegrecorder.cpp 478 478 using_ivtv:DEFINES += USING_IVTV 479 479 480 # Support for HD-PVR on Linux 481 using_hdpvr:HEADERS *= mpegrecorder.h 482 using_hdpvr:SOURCES *= mpegrecorder.cpp 483 using_hdpvr:DEFINES += USING_HDPVR 484 480 485 # Support for Linux DVB drivers 481 486 using_dvb { 482 487 # Basic DVB types -
libs/libmythtv/dbcheck.cpp
17 17 #define MINIMUM_DBMS_VERSION 5 18 18 19 19 /// This is the DB schema version expected by the running MythTV instance. 20 const QString currentDatabaseVersion = "122 2";20 const QString currentDatabaseVersion = "1223"; 21 21 22 22 static bool UpdateDBVersionNumber(const QString &newnumber); 23 23 static bool performActualUpdate( … … 4300 4300 "UPDATE channel SET commmethod='261' WHERE commmethod='511'", 4301 4301 NULL 4302 4302 }; 4303 if (!performActualUpdate(updates, "1221", dbver))4304 return false;4305 }4306 4307 if (dbver == "1221")4308 {4309 bool ok = true;4310 MSqlQuery query(MSqlQuery::InitCon());4311 query.prepare(4312 "SELECT cardid, videodevice "4313 "FROM capturecard "4314 "WHERE cardtype = 'DVB'");4315 4316 if (!query.exec())4317 {4318 MythDB::DBError(4319 "Could not perform select for update to '1222'", query);4320 ok = false;4321 }4322 else4323 {4324 MSqlQuery query2(MSqlQuery::InitCon());4325 while (query.next())4326 {4327 bool conv_ok;4328 uint dvbnum = query.value(1).toString().toUInt(&conv_ok);4329 if (!conv_ok)4330 continue;4331 4332 QString videodevice =4333 QString("/dev/dvb/adapter%1/frontend0").arg(dvbnum);4334 4335 query2.prepare(4336 "UPDATE capturecard "4337 "SET videodevice = :VIDEODEV "4338 "WHERE cardid = :CARDID");4339 query2.bindValue(":VIDEODEV", videodevice);4340 query2.bindValue(":CARDID", query.value(0).toUInt());4341 if (!query2.exec())4342 {4343 MythDB::DBError(4344 "Could not perform update for '1222'", query2);4345 ok = false;4346 }4347 }4348 }4349 4350 if (!ok)4351 return false;4352 4353 const char *updates[] = { NULL };4354 4303 if (!performActualUpdate(updates, "1222", dbver)) 4355 4304 return false; 4356 4305 } 4357 4306 4307 if (dbver == "1222") 4308 { 4309 const char *updates[] = { 4310 "INSERT INTO profilegroups SET name = 'HD-PVR Recorders', " 4311 " cardtype = 'HDPVR', is_default = 1;", 4312 "INSERT INTO recordingprofiles SET name = 'Default', profilegroup = 13;", 4313 "INSERT INTO recordingprofiles SET name = 'Live TV', profilegroup = 13;", 4314 "INSERT INTO recordingprofiles SET name = 'High Quality', profilegroup = 13;", 4315 "INSERT INTO recordingprofiles SET name = 'Low Quality', profilegroup = 13;", 4316 NULL 4317 }; 4318 if (!performActualUpdate(updates, "1223", dbver)) 4319 return false; 4320 } 4358 4321 4359 4322 return true; 4360 4323 } -
libs/libmythtv/scanwizardscanner.cpp
510 510 #endif 511 511 512 512 #ifdef USING_V4L 513 if (("V4L" == card_type) || ("MPEG" == card_type)) 513 if (("V4L" == card_type) || ("MPEG" == card_type) || 514 ("HDPVR" == card_type)) 515 { 514 516 channel = new V4LChannel(NULL, device); 517 } 515 518 #endif 516 519 517 520 #ifdef USING_HDHOMERUN -
libs/libmythtv/mpegrecorder.h
104 104 int audtype, audsamplerate, audbitratel1, audbitratel2, audbitratel3; 105 105 int audvolume; 106 106 unsigned int language; ///< 0 is Main Lang; 1 is SAP Lang; 2 is Dual 107 unsigned int low_mpeg4avgbitrate; 108 unsigned int low_mpeg4peakbitrate; 109 unsigned int medium_mpeg4avgbitrate; 110 unsigned int medium_mpeg4peakbitrate; 111 unsigned int high_mpeg4avgbitrate; 112 unsigned int high_mpeg4peakbitrate; 107 113 108 114 // Input file descriptors 109 115 int chanfd; -
libs/libmythtv/signalmonitor.cpp
93 93 94 94 #ifdef USING_V4L 95 95 if ((cardtype.upper() == "V4L") || 96 (cardtype.upper() == "MPEG")) 96 (cardtype.upper() == "MPEG") || 97 (cardtype.upper() == "HDPVR")) 97 98 { 98 99 V4LChannel *chan = dynamic_cast<V4LChannel*>(channel); 99 100 if (chan) -
libs/libmythtv/v4lchannel.cpp
279 279 int videomode_v4l2 = format_to_mode(fmt.upper(), 2); 280 280 281 281 bool ok = false; 282 InputNames v4l_inputs = CardUtil:: probeV4LInputs(videofd, ok);282 InputNames v4l_inputs = CardUtil::ProbeV4LVideoInputs(videofd, ok); 283 283 284 284 // Insert info from hardware 285 285 uint valid_cnt = 0; -
libs/libmythtv/cardutil.cpp
1409 1409 return !card.isEmpty(); 1410 1410 } 1411 1411 1412 InputNames CardUtil:: probeV4LInputs(int videofd, bool &ok)1412 InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok) 1413 1413 { 1414 1414 (void) videofd; 1415 1415 … … 1474 1474 return list; 1475 1475 } 1476 1476 1477 InputNames CardUtil::ProbeV4LAudioInputs(int videofd, bool &ok) 1478 { 1479 (void) videofd; 1480 1481 InputNames list; 1482 ok = false; 1483 1484 #ifdef USING_V4L 1485 bool usingv4l2 = hasV4L2(videofd); 1486 1487 // V4L v2 query 1488 struct v4l2_audio ain; 1489 bzero(&ain, sizeof(ain)); 1490 while (usingv4l2 && (ioctl(videofd, VIDIOC_ENUMAUDIO, &ain) >= 0)) 1491 { 1492 QString input((char *)ain.name); 1493 list[ain.index] = input; 1494 ain.index++; 1495 } 1496 if (ain.index) 1497 { 1498 ok = true; 1499 return list; 1500 } 1501 1502 ok = true; 1503 #else // if !USING_V4L 1504 list[-1] += QObject::tr( 1505 "ERROR, Compile with V4L support to query audio inputs"); 1506 #endif // !USING_V4L 1507 return list; 1508 } 1509 1477 1510 InputNames CardUtil::GetConfiguredDVBInputs(uint cardid) 1478 1511 { 1479 1512 InputNames list; … … 1494 1527 return list; 1495 1528 } 1496 1529 1497 QStringList CardUtil:: probeInputs(QString device, QString cardtype)1530 QStringList CardUtil::ProbeVideoInputs(QString device, QString cardtype) 1498 1531 { 1499 1532 QStringList ret; 1500 1533 … … 1506 1539 ret += "MPEG2TS"; 1507 1540 } 1508 1541 else if ("DVB" == cardtype) 1509 ret += probeDVBInputs(device);1542 ret += ProbeDVBInputs(device); 1510 1543 else 1511 ret += probeV4LInputs(device);1544 ret += ProbeV4LVideoInputs(device); 1512 1545 1513 1546 return ret; 1514 1547 } 1515 1548 1516 QStringList CardUtil:: probeV4LInputs(QString device)1549 QStringList CardUtil::ProbeAudioInputs(QString device, QString cardtype) 1517 1550 { 1551 VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs(%1,%2)").arg(device).arg(cardtype)); 1552 QStringList ret; 1553 1554 if ("HDPVR" == cardtype) 1555 ret += ProbeV4LAudioInputs(device); 1556 1557 return ret; 1558 } 1559 1560 QStringList CardUtil::ProbeV4LVideoInputs(QString device) 1561 { 1518 1562 bool ok; 1519 1563 QStringList ret; 1520 1564 int videofd = open(device.ascii(), O_RDWR); … … 1524 1568 "to probe its inputs.").arg(device); 1525 1569 return ret; 1526 1570 } 1527 InputNames list = CardUtil:: probeV4LInputs(videofd, ok);1571 InputNames list = CardUtil::ProbeV4LVideoInputs(videofd, ok); 1528 1572 close(videofd); 1529 1573 1530 1574 if (!ok) … … 1543 1587 return ret; 1544 1588 } 1545 1589 1546 QStringList CardUtil:: probeDVBInputs(QString device)1590 QStringList CardUtil::ProbeV4LAudioInputs(QString device) 1547 1591 { 1592 VERBOSE(VB_IMPORTANT, QString("ProbeV4LAudioInputs(%1)").arg(device)); 1593 1594 bool ok; 1548 1595 QStringList ret; 1596 int videofd = open(device.ascii(), O_RDWR); 1597 if (videofd < 0) 1598 { 1599 VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs() -> couldn't open device")); 1600 ret += QObject::tr("Could not open '%1' " 1601 "to probe its inputs.").arg(device); 1602 return ret; 1603 } 1604 InputNames list = CardUtil::ProbeV4LAudioInputs(videofd, ok); 1605 close(videofd); 1549 1606 1607 if (!ok) 1608 { 1609 ret += list[-1]; 1610 return ret; 1611 } 1612 1613 InputNames::iterator it; 1614 for (it = list.begin(); it != list.end(); ++it) 1615 { 1616 if (it.key() >= 0) 1617 ret += *it; 1618 } 1619 1620 return ret; 1621 } 1622 1623 QStringList CardUtil::ProbeDVBInputs(QString device) 1624 { 1625 QStringList ret; 1626 1550 1627 #ifdef USING_DVB 1551 1628 uint cardid = CardUtil::GetFirstCardID(device); 1552 1629 if (!cardid) … … 1631 1708 inputs += "MPEG2TS"; 1632 1709 } 1633 1710 else if ("DVB" != cardtype) 1634 inputs += probeV4LInputs(device);1711 inputs += ProbeV4LVideoInputs(device); 1635 1712 1636 1713 QString dev_label = GetDeviceLabel(cardid, cardtype, device); 1637 1714 -
libs/libmythtv/videosource.cpp
1513 1513 input(new TunerCardInput(parent)) 1514 1514 { 1515 1515 VideoDevice *device = 1516 new VideoDevice(parent, 0, 15, QString::null, " (ivtv|hdpvr)");1516 new VideoDevice(parent, 0, 15, QString::null, "ivtv"); 1517 1517 1518 1518 cardinfo->setLabel(tr("Probed info")); 1519 1519 … … 1545 1545 input->fillSelections(device); 1546 1546 } 1547 1547 1548 HDPVRConfigurationGroup::HDPVRConfigurationGroup(CaptureCard &a_parent) : 1549 VerticalConfigurationGroup(false, true, false, false), 1550 parent(a_parent), cardinfo(new TransLabelSetting()), 1551 videoinput(new TunerCardInput(parent)), 1552 audioinput(new TunerCardAudioInput(parent, QString::null, "HDPVR")) 1553 { 1554 VideoDevice *device = 1555 new VideoDevice(parent, 0, 15, QString::null, "hdpvr"); 1556 1557 cardinfo->setLabel(tr("Probed info")); 1558 1559 addChild(device); 1560 addChild(cardinfo); 1561 addChild(videoinput); 1562 addChild(audioinput); 1563 1564 connect(device, SIGNAL(valueChanged(const QString&)), 1565 this, SLOT( probeCard( const QString&))); 1566 1567 probeCard(device->getValue()); 1568 } 1569 1570 void HDPVRConfigurationGroup::probeCard(const QString &device) 1571 { 1572 QString cn = tr("Failed to open"), ci = cn, dn = QString::null; 1573 1574 int videofd = open(device.ascii(), O_RDWR); 1575 if (videofd >= 0) 1576 { 1577 if (!CardUtil::GetV4LInfo(videofd, cn, dn)) 1578 ci = cn = tr("Failed to probe"); 1579 else if (!dn.isEmpty()) 1580 ci = cn + " [" + dn + "]"; 1581 close(videofd); 1582 } 1583 1584 cardinfo->setValue(ci); 1585 videoinput->fillSelections(device); 1586 audioinput->fillSelections(device); 1587 } 1588 1548 1589 CaptureCardGroup::CaptureCardGroup(CaptureCard &parent) : 1549 1590 TriggeredConfigurationGroup(true, true, false, false) 1550 1591 { … … 1561 1602 # ifdef USING_IVTV 1562 1603 addTarget("MPEG", new MPEGConfigurationGroup(parent)); 1563 1604 # endif // USING_IVTV 1605 # ifdef USING_HDPVR 1606 addTarget("HDPVR", new HDPVRConfigurationGroup(parent)); 1607 # endif // USING_HDPVR 1564 1608 #endif // USING_V4L 1565 1609 1566 1610 #ifdef USING_DVB … … 1747 1791 setting->addSelection( 1748 1792 QObject::tr("MPEG-2 encoder card (PVR-x50, PVR-500)"), "MPEG"); 1749 1793 # endif // USING_IVTV 1794 # ifdef USING_HDPVR 1795 setting->addSelection( 1796 QObject::tr("H.264 encoder card (HD-PVR)"), "HDPVR"); 1797 # endif // USING_HDPVR 1750 1798 #endif // USING_V4L 1751 1799 1752 1800 #ifdef USING_DVB … … 2958 3006 2959 3007 last_device = device; 2960 3008 QStringList inputs = 2961 CardUtil:: probeInputs(device, last_cardtype);3009 CardUtil::ProbeVideoInputs(device, last_cardtype); 2962 3010 2963 3011 for (QStringList::iterator i = inputs.begin(); i != inputs.end(); ++i) 2964 3012 addSelection(*i); 2965 3013 } 2966 3014 3015 TunerCardAudioInput::TunerCardAudioInput(const CaptureCard &parent, 3016 QString dev, QString type) : 3017 ComboBoxSetting(this), CaptureCardDBStorage(this, parent, "audiodevice"), 3018 last_device(dev), last_cardtype(type) 3019 { 3020 setLabel(QObject::tr("Audio input")); 3021 int cardid = parent.getCardID(); 3022 if (cardid <= 0) 3023 return; 3024 3025 last_cardtype = CardUtil::GetRawCardType(cardid); 3026 last_device = CardUtil::GetAudioDevice(cardid); 3027 } 3028 3029 void TunerCardAudioInput::fillSelections(const QString &device) 3030 { 3031 clearSelections(); 3032 3033 if (device.isEmpty()) 3034 return; 3035 3036 last_device = device; 3037 QStringList inputs = 3038 CardUtil::ProbeAudioInputs(device, last_cardtype); 3039 3040 for (uint i = 0; i < inputs.size(); i++) 3041 { 3042 addSelection(inputs[i], QString::number(i), 3043 last_device == QString::number(i)); 3044 } 3045 } 3046 2967 3047 class DVBExtra : public ConfigurationWizard 2968 3048 { 2969 3049 public: -
libs/libmythtv/mpegrecorder.cpp
93 93 audbitratel1(14), audbitratel2(14), 94 94 audbitratel3(10), 95 95 audvolume(80), language(0), 96 low_mpeg4avgbitrate(4500), low_mpeg4peakbitrate(6000), 97 medium_mpeg4avgbitrate(9000), medium_mpeg4peakbitrate(13500), 98 high_mpeg4avgbitrate(13500), high_mpeg4peakbitrate(20200), 96 99 // Input file descriptors 97 100 chanfd(-1), readfd(-1), 98 101 // TS packet handling … … 177 180 } 178 181 else if (opt == "mpeg2audvolume") 179 182 audvolume = value; 183 else if (opt.right(16) == "_mpeg4avgbitrate") 184 { 185 if (opt.left(3) == "low") 186 low_mpeg4avgbitrate = value; 187 else if (opt.left(6) == "medium") 188 medium_mpeg4avgbitrate = value; 189 else if (opt.left(4) == "high") 190 high_mpeg4avgbitrate = value; 191 else 192 RecorderBase::SetOption(opt, value); 193 } 194 else if (opt.right(17) == "_mpeg4peakbitrate") 195 { 196 if (opt.left(3) == "low") 197 low_mpeg4peakbitrate = value; 198 else if (opt.left(6) == "medium") 199 medium_mpeg4peakbitrate = value; 200 else if (opt.left(4) == "high") 201 high_mpeg4peakbitrate = value; 202 else 203 RecorderBase::SetOption(opt, value); 204 } 180 205 else 181 206 RecorderBase::SetOption(opt, value); 182 207 } … … 273 298 SetOption("videodevice", videodev); 274 299 } 275 300 301 SetOption("audiodevice", audiodev); 302 276 303 SetOption("tvformat", gContext->GetSetting("TVFormat")); 277 304 SetOption("vbiformat", gContext->GetSetting("VbiFormat")); 278 305 … … 676 703 677 704 add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_STREAM_TYPE, 678 705 streamtype_ivtv_to_v4l2(GetFilteredStreamType())); 706 679 707 } 708 else 709 { 710 maxbitrate = high_mpeg4peakbitrate; 711 bitrate = high_mpeg4avgbitrate; 712 } 680 713 681 714 add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_PEAK, 682 715 maxbitrate * 1000); … … 703 736 } 704 737 } 705 738 739 bool ok; 740 int audioinput = audiodevice.toUInt(&ok); 741 if (ok) 742 { 743 struct v4l2_audio ain; 744 bzero(&ain, sizeof(ain)); 745 ain.index = audioinput; 746 if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) < 0) 747 { 748 VERBOSE(VB_IMPORTANT, LOC_WARN + 749 "Unable to get audio input."); 750 } 751 else 752 { 753 ain.index = audioinput; 754 if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) < 0) 755 { 756 VERBOSE(VB_IMPORTANT, LOC_WARN + 757 "Unable to set audio input."); 758 } 759 } 760 } 761 706 762 return true; 707 763 } 708 764 -
libs/libmythtv/tv_rec.cpp
209 209 CloseChannel(); 210 210 init_run = true; 211 211 #endif 212 if ( genOpt.cardtype != "MPEG")212 if ((genOpt.cardtype != "MPEG") && (genOpt.cardtype != "HDPVR")) 213 213 rbFileExt = "nuv"; 214 214 } 215 215 … … 952 952 * \brief Allocates and initializes the RecorderBase instance. 953 953 * 954 954 * Based on the card type, one of the possible recorders are started. 955 * If the card type is "MPEG" a MpegRecorder is started,955 * If the card type is "MPEG" or "HDPVR" a MpegRecorder is started, 956 956 * if the card type is "HDHOMERUN" a HDHRRecorder is started, 957 957 * if the card type is "FIREWIRE" a FirewireRecorder is started, 958 958 * if the card type is "DVB" a DVBRecorder is started, … … 970 970 recorder = new MpegRecorder(this); 971 971 #endif // USING_IVTV 972 972 } 973 if (genOpt.cardtype == "HDPVR") 974 { 975 #ifdef USING_HDPVR 976 recorder = new MpegRecorder(this); 977 #endif // USING_HDPVR 978 } 973 979 else if (genOpt.cardtype == "FIREWIRE") 974 980 { 975 981 #ifdef USING_FIREWIRE … … 2576 2582 long long bitrate; 2577 2583 if (genOpt.cardtype == "MPEG") 2578 2584 bitrate = 10080000LL; // use DVD max bit rate 2585 if (genOpt.cardtype == "HDPVR") 2586 bitrate = 20200000LL; // Peek bit rate for HD-PVR 2579 2587 else if (genOpt.cardtype == "DBOX2") 2580 2588 bitrate = 10080000LL; // use DVD max bit rate 2581 2589 else if (!CardUtil::IsEncoder(genOpt.cardtype)) -
libs/libmythtv/recordingprofile.cpp
654 654 }; 655 655 }; 656 656 657 class MPEG2bitrate : public SliderSetting, public CodecParamStorage657 class AverageBitrate : public SliderSetting, public CodecParamStorage 658 658 { 659 659 public: 660 MPEG2bitrate(const RecordingProfile &parent) : 661 SliderSetting(this, 1000, 16000, 100), 662 CodecParamStorage(this, parent, "mpeg2bitrate") 660 AverageBitrate(const RecordingProfile &parent, 661 QString setting = "mpeg2bitrate", 662 uint min_br = 1000, uint max_br = 16000, 663 uint default_br = 4500, uint increment = 100, 664 QString label = QString::null) : 665 SliderSetting(this, min_br, max_br, increment), 666 CodecParamStorage(this, parent, setting) 663 667 { 664 665 setLabel(QObject::tr("Bitrate")); 666 setValue(4500); 667 setHelpText(QObject::tr("Bitrate in kilobits/second. 2200Kbps is " 668 "approximately 1 Gigabyte per hour.")); 668 if (label.isEmpty()) 669 label = QObject::tr("Avg. Bitrate"); 670 setLabel(label); 671 setValue(default_br); 672 setHelpText(QObject::tr( 673 "Average bit rate in kilobits/second. " 674 "2200Kbps is approximately 1 Gigabyte per hour.")); 669 675 }; 670 676 }; 671 677 672 class MPEG2maxBitrate : public SliderSetting, public CodecParamStorage678 class PeakBitrate : public SliderSetting, public CodecParamStorage 673 679 { 674 680 public: 675 MPEG2maxBitrate(const RecordingProfile &parent) : 676 SliderSetting(this, 1000, 16000, 100), 677 CodecParamStorage(this, parent, "mpeg2maxbitrate") 681 PeakBitrate(const RecordingProfile &parent, 682 QString setting = "mpeg2maxbitrate", 683 uint min_br = 1000, uint max_br = 16000, 684 uint default_br = 6000, uint increment = 100, 685 QString label = QString::null) : 686 SliderSetting(this, min_br, max_br, increment), 687 CodecParamStorage(this, parent, setting) 678 688 { 679 680 setLabel(QObject::tr("Max. Bitrate")); 681 setValue(6000); 682 setHelpText(QObject::tr("Maximum Bitrate in kilobits/second. " 689 if (label.isEmpty()) 690 label = QObject::tr("Max. Bitrate"); 691 setLabel(label); 692 setValue(default_br); 693 setHelpText(QObject::tr("Maximum bit rate in kilobits/second. " 683 694 "2200Kbps is approximately 1 Gigabyte per hour.")); 684 695 }; 685 696 }; … … 821 832 822 833 params = new VerticalConfigurationGroup(false); 823 834 params->setLabel(QObject::tr("MPEG-2 Parameters")); 824 params->addChild(new MPEG2bitrate(parent));835 params->addChild(new AverageBitrate(parent)); 825 836 params->addChild(new ScaleBitrate(parent)); 826 837 //params->addChild(new MPEG4MaxQuality(parent)); 827 838 //params->addChild(new MPEG4MinQuality(parent)); … … 845 856 params->setLabel(QObject::tr("MPEG-2 Hardware Encoder")); 846 857 params->addChild(new MPEG2streamType(parent)); 847 858 params->addChild(new MPEG2aspectRatio(parent)); 848 params->addChild(new MPEG2bitrate(parent));849 params->addChild(new MPEG2maxBitrate(parent));859 params->addChild(new AverageBitrate(parent)); 860 params->addChild(new PeakBitrate(parent)); 850 861 851 862 addTarget("MPEG-2 Hardware Encoder", params); 863 864 params = new VerticalConfigurationGroup(false); 865 params->setLabel(QObject::tr("MPEG-4 AVC Hardware Encoder")); 866 ConfigurationGroup *h0 = new HorizontalConfigurationGroup( 867 true, false, true, true); 868 h0->setLabel(QObject::tr("Low Resolution")); 869 h0->addChild(new AverageBitrate(parent, "low_mpeg4avgbitrate", 870 1000, 13500, 4500, 500)); 871 h0->addChild(new PeakBitrate(parent, "low_mpeg4peakbitrate", 872 1100, 20200, 6000, 500)); 873 params->addChild(h0); 874 ConfigurationGroup *h1 = new HorizontalConfigurationGroup( 875 true, false, true, true); 876 h1->setLabel(QObject::tr("Medium Resolution")); 877 h1->addChild(new AverageBitrate(parent, "medium_mpeg4avgbitrate", 878 1000, 13500, 9000, 500)); 879 h1->addChild(new PeakBitrate(parent, "medium_mpeg4peakbitrate", 880 1100, 20200, 11000, 500)); 881 params->addChild(h1); 882 ConfigurationGroup *h2 = new HorizontalConfigurationGroup( 883 true, false, true, true); 884 h2->setLabel(QObject::tr("High Resolution")); 885 h2->addChild(new AverageBitrate(parent, "high_mpeg4avgbitrate", 886 1000, 13500, 13500, 500)); 887 h2->addChild(new PeakBitrate(parent, "high_mpeg4peakbitrate", 888 1100, 20200, 20200, 500)); 889 params->addChild(h2); 890 addTarget("MPEG-4 AVC Hardware Encoder", params); 852 891 } 853 892 854 893 void selectCodecs(QString groupType) 855 894 { 856 895 if (!groupType.isNull()) 857 896 { 858 if (groupType == "MPEG") 897 if (groupType == "HDPVR") 898 codecName->addSelection("MPEG-4 AVC Hardware Encoder"); 899 else if (groupType == "MPEG") 859 900 codecName->addSelection("MPEG-2 Hardware Encoder"); 860 901 else if (groupType == "MJPEG") 861 902 codecName->addSelection("Hardware MJPEG"); … … 1212 1253 if (isEncoder) 1213 1254 { 1214 1255 QString tvFormat = gContext->GetSetting("TVFormat"); 1215 addChild(new ImageSize(*this, tvFormat, profileName)); 1256 if (type.upper() != "HDPVR") 1257 addChild(new ImageSize(*this, tvFormat, profileName)); 1216 1258 1217 1259 videoSettings = new VideoCompressionSettings(*this, profileName); 1218 1260 addChild(videoSettings); 1219 1261 1220 audioSettings = new AudioCompressionSettings(*this, profileName); 1221 addChild(audioSettings); 1262 if (type.upper() != "HDPVR") 1263 { 1264 audioSettings = new AudioCompressionSettings(*this, profileName); 1265 addChild(audioSettings); 1266 } 1222 1267 1223 1268 if (!profileName.isEmpty() && profileName.left(11) == "Transcoders") 1224 1269 { -
libs/libmythtv/scanwizardhelpers.cpp
60 60 # ifdef USING_IVTV 61 61 cardTypes += ",'MPEG'"; 62 62 # endif // USING_IVTV 63 # ifdef USING_HDPVR 64 cardTypes += ",'HDPVR'"; 65 # endif // USING_HDPVR 63 66 #endif // USING_V4L 64 67 65 68 #ifdef USING_IPTV