Ticket #5443: 5443-recording-profiles-v1.patch
| File 5443-recording-profiles-v1.patch, 28.6 KB (added by , 17 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 … … 3017 3023 if enabled backend; then 3018 3024 echo "Video4Linux sup. ${v4l-no}" 3019 3025 echo "ivtv support ${ivtv-no}" 3026 echo "hdpvr support ${hdpvr-no}" 3020 3027 echo "FireWire support ${firewire-no}" 3021 3028 echo "DVB support ${dvb-no} [$dvb_path]" 3022 3029 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
367 367 } 368 368 }; 369 369 370 class TunerCardAudioInput : public ComboBoxSetting, public CaptureCardDBStorage 371 { 372 Q_OBJECT 373 public: 374 TunerCardAudioInput(const CaptureCard &parent, 375 QString dev = QString::null, 376 QString type = QString::null); 377 378 public slots: 379 void fillSelections(const QString &device); 380 381 private: 382 QString last_device; 383 QString last_cardtype; 384 }; 385 370 386 class DVBAudioDevice : public LineEditSetting, public CaptureCardDBStorage 371 387 { 372 388 Q_OBJECT … … 453 469 TunerCardInput *input; 454 470 }; 455 471 472 class HDPVRConfigurationGroup: public VerticalConfigurationGroup 473 { 474 Q_OBJECT 475 476 public: 477 HDPVRConfigurationGroup(CaptureCard &parent); 478 479 public slots: 480 void probeCard(const QString &device); 481 482 private: 483 CaptureCard &parent; 484 TransLabelSetting *cardinfo; 485 TunerCardInput *videoinput; 486 TunerCardAudioInput *audioinput; 487 }; 488 456 489 class DVBCardNum; 457 490 class DVBInput; 458 491 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
16 16 #define MINIMUM_DBMS_VERSION 5 17 17 18 18 /// This is the DB schema version expected by the running MythTV instance. 19 const QString currentDatabaseVersion = "122 1";19 const QString currentDatabaseVersion = "1222"; 20 20 21 21 static bool UpdateDBVersionNumber(const QString &newnumber); 22 22 static bool performActualUpdate( … … 4292 4292 return false; 4293 4293 } 4294 4294 4295 if (dbver == "1221") 4296 { 4297 const char *updates[] = { 4298 "INSERT INTO profilegroups SET name = 'HD-PVR Recorders', " 4299 " cardtype = 'HDPVR', is_default = 1;", 4300 "INSERT INTO recordingprofiles SET name = 'Default', profilegroup = 13;", 4301 "INSERT INTO recordingprofiles SET name = 'Live TV', profilegroup = 13;", 4302 "INSERT INTO recordingprofiles SET name = 'High Quality', profilegroup = 13;", 4303 "INSERT INTO recordingprofiles SET name = 'Low Quality', profilegroup = 13;", 4304 NULL 4305 }; 4306 if (!performActualUpdate(updates, "1222", dbver)) 4307 return false; 4308 } 4309 4295 4310 return true; 4296 4311 } 4297 4312 -
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
1417 1417 return !card.isEmpty(); 1418 1418 } 1419 1419 1420 InputNames CardUtil:: probeV4LInputs(int videofd, bool &ok)1420 InputNames CardUtil::ProbeV4LVideoInputs(int videofd, bool &ok) 1421 1421 { 1422 1422 (void) videofd; 1423 1423 … … 1482 1482 return list; 1483 1483 } 1484 1484 1485 InputNames CardUtil::ProbeV4LAudioInputs(int videofd, bool &ok) 1486 { 1487 (void) videofd; 1488 1489 InputNames list; 1490 ok = false; 1491 1492 #ifdef USING_V4L 1493 bool usingv4l2 = hasV4L2(videofd); 1494 1495 // V4L v2 query 1496 struct v4l2_audio ain; 1497 bzero(&ain, sizeof(ain)); 1498 while (usingv4l2 && (ioctl(videofd, VIDIOC_ENUMAUDIO, &ain) >= 0)) 1499 { 1500 QString input((char *)ain.name); 1501 list[ain.index] = input; 1502 ain.index++; 1503 } 1504 if (ain.index) 1505 { 1506 ok = true; 1507 return list; 1508 } 1509 1510 ok = true; 1511 #else // if !USING_V4L 1512 list[-1] += QObject::tr( 1513 "ERROR, Compile with V4L support to query audio inputs"); 1514 #endif // !USING_V4L 1515 return list; 1516 } 1517 1485 1518 InputNames CardUtil::GetConfiguredDVBInputs(uint cardid) 1486 1519 { 1487 1520 InputNames list; … … 1502 1535 return list; 1503 1536 } 1504 1537 1505 QStringList CardUtil:: probeInputs(QString device, QString cardtype)1538 QStringList CardUtil::ProbeVideoInputs(QString device, QString cardtype) 1506 1539 { 1507 1540 QStringList ret; 1508 1541 … … 1514 1547 ret += "MPEG2TS"; 1515 1548 } 1516 1549 else if ("DVB" == cardtype) 1517 ret += probeDVBInputs(device);1550 ret += ProbeDVBInputs(device); 1518 1551 else 1519 ret += probeV4LInputs(device);1552 ret += ProbeV4LVideoInputs(device); 1520 1553 1521 1554 return ret; 1522 1555 } 1523 1556 1524 QStringList CardUtil:: probeV4LInputs(QString device)1557 QStringList CardUtil::ProbeAudioInputs(QString device, QString cardtype) 1525 1558 { 1559 VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs(%1,%2)").arg(device).arg(cardtype)); 1560 QStringList ret; 1561 1562 if ("HDPVR" == cardtype) 1563 ret += ProbeV4LAudioInputs(device); 1564 1565 return ret; 1566 } 1567 1568 QStringList CardUtil::ProbeV4LVideoInputs(QString device) 1569 { 1526 1570 bool ok; 1527 1571 QStringList ret; 1528 1572 int videofd = open(device.ascii(), O_RDWR); … … 1532 1576 "to probe its inputs.").arg(device); 1533 1577 return ret; 1534 1578 } 1535 InputNames list = CardUtil:: probeV4LInputs(videofd, ok);1579 InputNames list = CardUtil::ProbeV4LVideoInputs(videofd, ok); 1536 1580 close(videofd); 1537 1581 1538 1582 if (!ok) … … 1551 1595 return ret; 1552 1596 } 1553 1597 1554 QStringList CardUtil:: probeDVBInputs(QString device)1598 QStringList CardUtil::ProbeV4LAudioInputs(QString device) 1555 1599 { 1600 VERBOSE(VB_IMPORTANT, QString("ProbeV4LAudioInputs(%1)").arg(device)); 1601 1602 bool ok; 1556 1603 QStringList ret; 1604 int videofd = open(device.ascii(), O_RDWR); 1605 if (videofd < 0) 1606 { 1607 VERBOSE(VB_IMPORTANT, QString("ProbeAudioInputs() -> couldn't open device")); 1608 ret += QObject::tr("Could not open '%1' " 1609 "to probe its inputs.").arg(device); 1610 return ret; 1611 } 1612 InputNames list = CardUtil::ProbeV4LAudioInputs(videofd, ok); 1613 close(videofd); 1557 1614 1615 if (!ok) 1616 { 1617 ret += list[-1]; 1618 return ret; 1619 } 1620 1621 InputNames::iterator it; 1622 for (it = list.begin(); it != list.end(); ++it) 1623 { 1624 if (it.key() >= 0) 1625 ret += *it; 1626 } 1627 1628 return ret; 1629 } 1630 1631 QStringList CardUtil::ProbeDVBInputs(QString device) 1632 { 1633 QStringList ret; 1634 1558 1635 #ifdef USING_DVB 1559 1636 uint cardid = CardUtil::GetFirstCardID(device); 1560 1637 if (!cardid) … … 1639 1716 inputs += "MPEG2TS"; 1640 1717 } 1641 1718 else if ("DVB" != cardtype) 1642 inputs += probeV4LInputs(device);1719 inputs += ProbeV4LVideoInputs(device); 1643 1720 1644 1721 QString dev_label = GetDeviceLabel(cardid, cardtype, device); 1645 1722 -
libs/libmythtv/videosource.cpp
1521 1521 input(new TunerCardInput(parent)) 1522 1522 { 1523 1523 VideoDevice *device = 1524 new VideoDevice(parent, 0, 15, QString::null, " (ivtv|hdpvr)");1524 new VideoDevice(parent, 0, 15, QString::null, "ivtv"); 1525 1525 1526 1526 cardinfo->setLabel(tr("Probed info")); 1527 1527 … … 1553 1553 input->fillSelections(device); 1554 1554 } 1555 1555 1556 HDPVRConfigurationGroup::HDPVRConfigurationGroup(CaptureCard &a_parent) : 1557 VerticalConfigurationGroup(false, true, false, false), 1558 parent(a_parent), cardinfo(new TransLabelSetting()), 1559 videoinput(new TunerCardInput(parent)), 1560 audioinput(new TunerCardAudioInput(parent, QString::null, "HDPVR")) 1561 { 1562 VideoDevice *device = 1563 new VideoDevice(parent, 0, 15, QString::null, "hdpvr"); 1564 1565 cardinfo->setLabel(tr("Probed info")); 1566 1567 addChild(device); 1568 addChild(cardinfo); 1569 addChild(videoinput); 1570 addChild(audioinput); 1571 1572 connect(device, SIGNAL(valueChanged(const QString&)), 1573 this, SLOT( probeCard( const QString&))); 1574 1575 probeCard(device->getValue()); 1576 } 1577 1578 void HDPVRConfigurationGroup::probeCard(const QString &device) 1579 { 1580 QString cn = tr("Failed to open"), ci = cn, dn = QString::null; 1581 1582 int videofd = open(device.ascii(), O_RDWR); 1583 if (videofd >= 0) 1584 { 1585 if (!CardUtil::GetV4LInfo(videofd, cn, dn)) 1586 ci = cn = tr("Failed to probe"); 1587 else if (!dn.isEmpty()) 1588 ci = cn + " [" + dn + "]"; 1589 close(videofd); 1590 } 1591 1592 cardinfo->setValue(ci); 1593 videoinput->fillSelections(device); 1594 audioinput->fillSelections(device); 1595 } 1596 1556 1597 CaptureCardGroup::CaptureCardGroup(CaptureCard &parent) : 1557 1598 TriggeredConfigurationGroup(true, true, false, false) 1558 1599 { … … 1569 1610 # ifdef USING_IVTV 1570 1611 addTarget("MPEG", new MPEGConfigurationGroup(parent)); 1571 1612 # endif // USING_IVTV 1613 # ifdef USING_HDPVR 1614 addTarget("HDPVR", new HDPVRConfigurationGroup(parent)); 1615 # endif // USING_HDPVR 1572 1616 #endif // USING_V4L 1573 1617 1574 1618 #ifdef USING_DVB … … 1755 1799 setting->addSelection( 1756 1800 QObject::tr("MPEG-2 encoder card (PVR-x50, PVR-500)"), "MPEG"); 1757 1801 # endif // USING_IVTV 1802 # ifdef USING_HDPVR 1803 setting->addSelection( 1804 QObject::tr("H.264 encoder card (HD-PVR)"), "HDPVR"); 1805 # endif // USING_HDPVR 1758 1806 #endif // USING_V4L 1759 1807 1760 1808 #ifdef USING_DVB … … 2965 3013 2966 3014 last_device = device; 2967 3015 QStringList inputs = 2968 CardUtil:: probeInputs(device, last_cardtype);3016 CardUtil::ProbeVideoInputs(device, last_cardtype); 2969 3017 2970 3018 for (QStringList::iterator i = inputs.begin(); i != inputs.end(); ++i) 2971 3019 addSelection(*i); 2972 3020 } 2973 3021 3022 TunerCardAudioInput::TunerCardAudioInput(const CaptureCard &parent, 3023 QString dev, QString type) : 3024 ComboBoxSetting(this), CaptureCardDBStorage(this, parent, "audiodevice"), 3025 last_device(dev), last_cardtype(type) 3026 { 3027 setLabel(QObject::tr("Audio input")); 3028 int cardid = parent.getCardID(); 3029 if (cardid <= 0) 3030 return; 3031 3032 last_cardtype = CardUtil::GetRawCardType(cardid); 3033 last_device = CardUtil::GetAudioDevice(cardid); 3034 } 3035 3036 void TunerCardAudioInput::fillSelections(const QString &device) 3037 { 3038 clearSelections(); 3039 3040 if (device.isEmpty()) 3041 return; 3042 3043 last_device = device; 3044 QStringList inputs = 3045 CardUtil::ProbeAudioInputs(device, last_cardtype); 3046 3047 for (uint i = 0; i < inputs.size(); i++) 3048 { 3049 addSelection(inputs[i], QString::number(i), 3050 last_device == QString::number(i)); 3051 } 3052 } 3053 2974 3054 class DVBExtra : public ConfigurationWizard 2975 3055 { 2976 3056 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 … … 178 181 } 179 182 else if (opt == "mpeg2audvolume") 180 183 audvolume = value; 184 else if (opt.right(16) == "_mpeg4avgbitrate") 185 { 186 if (opt.left(3) == "low") 187 low_mpeg4avgbitrate = value; 188 else if (opt.left(6) == "medium") 189 medium_mpeg4avgbitrate = value; 190 else if (opt.left(4) == "high") 191 high_mpeg4avgbitrate = value; 192 else 193 RecorderBase::SetOption(opt, value); 194 } 195 else if (opt.right(17) == "_mpeg4peakbitrate") 196 { 197 if (opt.left(3) == "low") 198 low_mpeg4peakbitrate = value; 199 else if (opt.left(6) == "medium") 200 medium_mpeg4peakbitrate = value; 201 else if (opt.left(4) == "high") 202 high_mpeg4peakbitrate = value; 203 else 204 RecorderBase::SetOption(opt, value); 205 } 181 206 else 182 207 RecorderBase::SetOption(opt, value); 183 208 } … … 274 299 SetOption("videodevice", videodev); 275 300 } 276 301 302 SetOption("audiodevice", audiodev); 303 277 304 SetOption("tvformat", gContext->GetSetting("TVFormat")); 278 305 SetOption("vbiformat", gContext->GetSetting("VbiFormat")); 279 306 … … 679 706 680 707 add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_STREAM_TYPE, 681 708 streamtype_ivtv_to_v4l2(GetFilteredStreamType())); 709 682 710 } 711 else 712 { 713 maxbitrate = high_mpeg4peakbitrate; 714 bitrate = high_mpeg4avgbitrate; 715 } 683 716 684 717 add_ext_ctrl(ext_ctrls, V4L2_CID_MPEG_VIDEO_BITRATE_PEAK, 685 718 maxbitrate * 1000); … … 732 765 _keyframedist = ext_ctrl.value; 733 766 } 734 767 768 bool ok; 769 int audioinput = audiodevice.toUInt(&ok); 770 if (ok) 771 { 772 struct v4l2_audio ain; 773 bzero(&ain, sizeof(ain)); 774 ain.index = audioinput; 775 if (ioctl(chanfd, VIDIOC_ENUMAUDIO, &ain) < 0) 776 { 777 VERBOSE(VB_IMPORTANT, LOC_WARN + 778 "Unable to get audio input."); 779 } 780 else 781 { 782 ain.index = audioinput; 783 if (ioctl(chanfd, VIDIOC_S_AUDIO, &ain) < 0) 784 { 785 VERBOSE(VB_IMPORTANT, LOC_WARN + 786 "Unable to set audio input."); 787 } 788 } 789 } 790 735 791 return true; 736 792 } 737 793 -
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
652 652 }; 653 653 }; 654 654 655 class MPEG2bitrate : public SliderSetting, public CodecParamStorage655 class AverageBitrate : public SliderSetting, public CodecParamStorage 656 656 { 657 657 public: 658 MPEG2bitrate(const RecordingProfile &parent) : 659 SliderSetting(this, 1000, 16000, 100), 660 CodecParamStorage(this, parent, "mpeg2bitrate") 658 AverageBitrate(const RecordingProfile &parent, 659 QString setting = "mpeg2bitrate", 660 uint min_br = 1000, uint max_br = 16000, 661 uint default_br = 4500, uint increment = 100, 662 QString label = QString::null) : 663 SliderSetting(this, min_br, max_br, increment), 664 CodecParamStorage(this, parent, setting) 661 665 { 662 663 setLabel(QObject::tr("Bitrate")); 664 setValue(4500); 665 setHelpText(QObject::tr("Bitrate in kilobits/second. 2200Kbps is " 666 "approximately 1 Gigabyte per hour.")); 666 if (label.isEmpty()) 667 label = QObject::tr("Avg. Bitrate"); 668 setLabel(label); 669 setValue(default_br); 670 setHelpText(QObject::tr( 671 "Average bit rate in kilobits/second. " 672 "2200Kbps is approximately 1 Gigabyte per hour.")); 667 673 }; 668 674 }; 669 675 670 class MPEG2maxBitrate : public SliderSetting, public CodecParamStorage676 class PeakBitrate : public SliderSetting, public CodecParamStorage 671 677 { 672 678 public: 673 MPEG2maxBitrate(const RecordingProfile &parent) : 674 SliderSetting(this, 1000, 16000, 100), 675 CodecParamStorage(this, parent, "mpeg2maxbitrate") 679 PeakBitrate(const RecordingProfile &parent, 680 QString setting = "mpeg2maxbitrate", 681 uint min_br = 1000, uint max_br = 16000, 682 uint default_br = 6000, uint increment = 100, 683 QString label = QString::null) : 684 SliderSetting(this, min_br, max_br, increment), 685 CodecParamStorage(this, parent, setting) 676 686 { 677 678 setLabel(QObject::tr("Max. Bitrate")); 679 setValue(6000); 680 setHelpText(QObject::tr("Maximum Bitrate in kilobits/second. " 687 if (label.isEmpty()) 688 label = QObject::tr("Max. Bitrate"); 689 setLabel(label); 690 setValue(default_br); 691 setHelpText(QObject::tr("Maximum bit rate in kilobits/second. " 681 692 "2200Kbps is approximately 1 Gigabyte per hour.")); 682 693 }; 683 694 }; … … 819 830 820 831 params = new VerticalConfigurationGroup(false); 821 832 params->setLabel(QObject::tr("MPEG-2 Parameters")); 822 params->addChild(new MPEG2bitrate(parent));833 params->addChild(new AverageBitrate(parent)); 823 834 params->addChild(new ScaleBitrate(parent)); 824 835 //params->addChild(new MPEG4MaxQuality(parent)); 825 836 //params->addChild(new MPEG4MinQuality(parent)); … … 843 854 params->setLabel(QObject::tr("MPEG-2 Hardware Encoder")); 844 855 params->addChild(new MPEG2streamType(parent)); 845 856 params->addChild(new MPEG2aspectRatio(parent)); 846 params->addChild(new MPEG2bitrate(parent));847 params->addChild(new MPEG2maxBitrate(parent));857 params->addChild(new AverageBitrate(parent)); 858 params->addChild(new PeakBitrate(parent)); 848 859 849 860 addTarget("MPEG-2 Hardware Encoder", params); 861 862 params = new VerticalConfigurationGroup(false); 863 params->setLabel(QObject::tr("MPEG-4 AVC Hardware Encoder")); 864 ConfigurationGroup *h0 = new HorizontalConfigurationGroup( 865 true, false, true, true); 866 h0->setLabel(QObject::tr("Low Resolution")); 867 h0->addChild(new AverageBitrate(parent, "low_mpeg4avgbitrate", 868 1000, 13500, 4500, 500)); 869 h0->addChild(new PeakBitrate(parent, "low_mpeg4peakbitrate", 870 1100, 20200, 6000, 500)); 871 params->addChild(h0); 872 ConfigurationGroup *h1 = new HorizontalConfigurationGroup( 873 true, false, true, true); 874 h1->setLabel(QObject::tr("Medium Resolution")); 875 h1->addChild(new AverageBitrate(parent, "medium_mpeg4avgbitrate", 876 1000, 13500, 9000, 500)); 877 h1->addChild(new PeakBitrate(parent, "medium_mpeg4peakbitrate", 878 1100, 20200, 11000, 500)); 879 params->addChild(h1); 880 ConfigurationGroup *h2 = new HorizontalConfigurationGroup( 881 true, false, true, true); 882 h2->setLabel(QObject::tr("High Resolution")); 883 h2->addChild(new AverageBitrate(parent, "high_mpeg4avgbitrate", 884 1000, 13500, 13500, 500)); 885 h2->addChild(new PeakBitrate(parent, "high_mpeg4peakbitrate", 886 1100, 20200, 20200, 500)); 887 params->addChild(h2); 888 addTarget("MPEG-4 AVC Hardware Encoder", params); 850 889 } 851 890 852 891 void selectCodecs(QString groupType) 853 892 { 854 893 if (!groupType.isNull()) 855 894 { 856 if (groupType == "MPEG") 895 if (groupType == "HDPVR") 896 codecName->addSelection("MPEG-4 AVC Hardware Encoder"); 897 else if (groupType == "MPEG") 857 898 codecName->addSelection("MPEG-2 Hardware Encoder"); 858 899 else if (groupType == "MJPEG") 859 900 codecName->addSelection("Hardware MJPEG"); … … 1210 1251 if (isEncoder) 1211 1252 { 1212 1253 QString tvFormat = gContext->GetSetting("TVFormat"); 1213 addChild(new ImageSize(*this, tvFormat, profileName)); 1254 if (type.upper() != "HDPVR") 1255 addChild(new ImageSize(*this, tvFormat, profileName)); 1214 1256 1215 1257 videoSettings = new VideoCompressionSettings(*this, profileName); 1216 1258 addChild(videoSettings); 1217 1259 1218 audioSettings = new AudioCompressionSettings(*this, profileName); 1219 addChild(audioSettings); 1260 if (type.upper() != "HDPVR") 1261 { 1262 audioSettings = new AudioCompressionSettings(*this, profileName); 1263 addChild(audioSettings); 1264 } 1220 1265 1221 1266 if (!profileName.isEmpty() && profileName.left(11) == "Transcoders") 1222 1267 { -
libs/libmythtv/scanwizardhelpers.cpp
59 59 # ifdef USING_IVTV 60 60 cardTypes += ",'MPEG'"; 61 61 # endif // USING_IVTV 62 # ifdef USING_HDPVR 63 cardTypes += ",'HDPVR'"; 64 # endif // USING_HDPVR 62 65 #endif // USING_V4L 63 66 64 67 #ifdef USING_IPTV
