MythTV  master
recordingprofile.cpp
Go to the documentation of this file.
1 
2 #include "recordingprofile.h"
3 
4 #include "cardutil.h"
5 #include "mythcorecontext.h"
6 #include "mythdb.h"
7 #include "mythlogging.h"
8 #include "v4l2util.h"
9 #include <utility>
10 
12 {
13  QString idTag(":WHEREID");
14  QString query("id = " + idTag);
15 
16  bindings.insert(idTag, m_parent.getProfileNum());
17 
18  return query;
19 }
20 
22 {
23  protected:
25  const RecordingProfile &parentProfile,
26  const QString& name) :
27  SimpleDBStorage(_setting, "codecparams", "value"),
28  m_parent(parentProfile), m_codecName(name)
29  {
30  _setting->setName(name);
31  }
32 
33  QString GetSetClause(MSqlBindings &bindings) const override; // SimpleDBStorage
34  QString GetWhereClause(MSqlBindings &bindings) const override; // SimpleDBStorage
35 
37  QString m_codecName;
38 };
39 
41 {
42  QString profileTag(":SETPROFILE");
43  QString nameTag(":SETNAME");
44  QString valueTag(":SETVALUE");
45 
46  QString query("profile = " + profileTag + ", name = " + nameTag
47  + ", value = " + valueTag);
48 
49  bindings.insert(profileTag, m_parent.getProfileNum());
50  bindings.insert(nameTag, m_codecName);
51  bindings.insert(valueTag, m_user->GetDBValue());
52 
53  return query;
54 }
55 
57 {
58  QString profileTag(":WHEREPROFILE");
59  QString nameTag(":WHERENAME");
60 
61  QString query("profile = " + profileTag + " AND name = " + nameTag);
62 
63  bindings.insert(profileTag, m_parent.getProfileNum());
64  bindings.insert(nameTag, m_codecName);
65 
66  return query;
67 }
68 
70 {
71  public:
72  explicit AudioCodecName(const RecordingProfile &parent) :
74  new RecordingProfileStorage(this, parent, "audiocodec"))
75  {
76  setLabel(QObject::tr("Codec"));
77  setName("audiocodec");
78  }
79 };
80 
82 {
83  public:
84  explicit MP3Quality(const RecordingProfile &parent) :
85  MythUISpinBoxSetting(this, 1, 9, 1),
86  CodecParamStorage(this, parent, "mp3quality")
87  {
88  setLabel(QObject::tr("MP3 quality"));
89  setValue(7);
90  setHelpText(QObject::tr("The higher the slider number, the lower the "
91  "quality of the audio. Better quality audio (lower "
92  "numbers) requires more CPU."));
93  };
94 };
95 
97 {
98  public:
99  explicit BTTVVolume(const RecordingProfile& parent) :
100  MythUISpinBoxSetting(this, 0, 100, 1),
101  CodecParamStorage(this, parent, "volume")
102  {
103  setLabel(QObject::tr("Volume (%)"));
104  setValue(90);
105  setHelpText(QObject::tr("Recording volume of the capture card."));
106  };
107 };
108 
110 {
111  public:
112  explicit SampleRate(const RecordingProfile &parent, bool analog = true) :
113  MythUIComboBoxSetting(this), CodecParamStorage(this, parent, "samplerate")
114  {
115  setLabel(QObject::tr("Sampling rate"));
116  setHelpText(QObject::tr("Sets the audio sampling rate for your DSP. "
117  "Ensure that you choose a sampling rate appropriate "
118  "for your device. btaudio may only allow 32000."));
119 
120  m_rates.push_back(32000);
121  m_rates.push_back(44100);
122  m_rates.push_back(48000);
123 
124  m_allowedRate[48000] = true;
125  for (uint i = 0; analog && (i < m_rates.size()); i++)
126  m_allowedRate[m_rates[i]] = true;
127 
128  };
129 
130  void Load(void) override // StandardSetting
131  {
133  QString val = getValue();
134 
135  clearSelections();
136  for (uint rate : m_rates)
137  {
138  if (m_allowedRate[rate])
139  addSelection(QString::number(rate));
140  }
141 
142  int which = getValueIndex(val);
143  setValue(std::max(which,0));
144 
145  if (m_allowedRate.size() <= 1)
146  setEnabled(false);
147  }
148 
149  void addSelection(const QString &label,
150  const QString& value = QString(),
151  bool select = false)
152  {
153  QString val = value.isEmpty() ? label : value;
154  uint rate = val.toUInt();
155  if (m_allowedRate[rate])
156  {
157  MythUIComboBoxSetting::addSelection(label, value, select);
158  }
159  else
160  {
161  LOG(VB_GENERAL, LOG_ERR, QString("SampleRate: ") +
162  QString("Attempted to add a rate %1 Hz, which is "
163  "not in the list of allowed rates.").arg(rate));
164  }
165  }
166 
167  std::vector<uint> m_rates;
168  QMap<uint,bool> m_allowedRate;
169 };
170 
172 {
173  public:
175  bool layer1, bool layer2, bool layer3) :
176  MythUIComboBoxSetting(this), CodecParamStorage(this, parent, "mpeg2audtype"),
177  m_allowLayer1(layer1), m_allowLayer2(layer2), m_allowLayer3(layer3)
178  {
179  setLabel(QObject::tr("Type"));
180 
181  if (m_allowLayer1)
182  addSelection("Layer I");
183  if (m_allowLayer2)
184  addSelection("Layer II");
185  if (m_allowLayer3)
186  addSelection("Layer III");
187 
188  uint allowed_cnt = 0;
189  allowed_cnt += ((m_allowLayer1) ? 1 : 0);
190  allowed_cnt += ((m_allowLayer2) ? 1 : 0);
191  allowed_cnt += ((m_allowLayer3) ? 1 : 0);
192 
193  if (1 == allowed_cnt)
194  setEnabled(false);
195 
196  setHelpText(QObject::tr("Sets the audio type"));
197  }
198 
199  void Load(void) override // StandardSetting
200  {
202  QString val = getValue();
203 
204  if ((val == "Layer I") && !m_allowLayer1)
205  {
206  val = (m_allowLayer2) ? "Layer II" :
207  ((m_allowLayer3) ? "Layer III" : val);
208  }
209 
210  if ((val == "Layer II") && !m_allowLayer2)
211  {
212  val = (m_allowLayer3) ? "Layer III" :
213  ((m_allowLayer1) ? "Layer I" : val);
214  }
215 
216  if ((val == "Layer III") && !m_allowLayer3)
217  {
218  val = (m_allowLayer2) ? "Layer II" :
219  ((m_allowLayer1) ? "Layer I" : val);
220  }
221 
222  if (getValue() != val)
223  {
224  int which = getValueIndex(val);
225  if (which >= 0)
226  setValue(which);
227  }
228  }
229 
230  private:
234 };
235 
237 {
238  public:
239  explicit MPEG2audBitrateL1(const RecordingProfile &parent) :
240  MythUIComboBoxSetting(this),
241  CodecParamStorage(this, parent, "mpeg2audbitratel1")
242  {
243  setLabel(QObject::tr("Bitrate"));
244 
245  addSelection("32 kbps", "32");
246  addSelection("64 kbps", "64");
247  addSelection("96 kbps", "96");
248  addSelection("128 kbps", "128");
249  addSelection("160 kbps", "160");
250  addSelection("192 kbps", "192");
251  addSelection("224 kbps", "224");
252  addSelection("256 kbps", "256");
253  addSelection("288 kbps", "288");
254  addSelection("320 kbps", "320");
255  addSelection("352 kbps", "352");
256  addSelection("384 kbps", "384");
257  addSelection("416 kbps", "416");
258  addSelection("448 kbps", "448");
259  setValue(13);
260  setHelpText(QObject::tr("Sets the audio bitrate"));
261  };
262 };
263 
265 {
266  public:
267  explicit MPEG2audBitrateL2(const RecordingProfile &parent) :
268  MythUIComboBoxSetting(this),
269  CodecParamStorage(this, parent, "mpeg2audbitratel2")
270  {
271  setLabel(QObject::tr("Bitrate"));
272 
273  addSelection("32 kbps", "32");
274  addSelection("48 kbps", "48");
275  addSelection("56 kbps", "56");
276  addSelection("64 kbps", "64");
277  addSelection("80 kbps", "80");
278  addSelection("96 kbps", "96");
279  addSelection("112 kbps", "112");
280  addSelection("128 kbps", "128");
281  addSelection("160 kbps", "160");
282  addSelection("192 kbps", "192");
283  addSelection("224 kbps", "224");
284  addSelection("256 kbps", "256");
285  addSelection("320 kbps", "320");
286  addSelection("384 kbps", "384");
287  setValue(13);
288  setHelpText(QObject::tr("Sets the audio bitrate"));
289  };
290 };
291 
293 {
294  public:
295  explicit MPEG2audBitrateL3(const RecordingProfile &parent) :
296  MythUIComboBoxSetting(this),
297  CodecParamStorage(this, parent, "mpeg2audbitratel3")
298  {
299  setLabel(QObject::tr("Bitrate"));
300 
301  addSelection("32 kbps", "32");
302  addSelection("40 kbps", "40");
303  addSelection("48 kbps", "48");
304  addSelection("56 kbps", "56");
305  addSelection("64 kbps", "64");
306  addSelection("80 kbps", "80");
307  addSelection("96 kbps", "96");
308  addSelection("112 kbps", "112");
309  addSelection("128 kbps", "128");
310  addSelection("160 kbps", "160");
311  addSelection("192 kbps", "192");
312  addSelection("224 kbps", "224");
313  addSelection("256 kbps", "256");
314  addSelection("320 kbps", "320");
315  setValue(10);
316  setHelpText(QObject::tr("Sets the audio bitrate"));
317  };
318 };
319 
321 {
322  public:
323  explicit MPEG2audVolume(const RecordingProfile &parent) :
324  MythUISpinBoxSetting(this, 0, 100, 1),
325  CodecParamStorage(this, parent, "mpeg2audvolume")
326  {
327 
328  setLabel(QObject::tr("Volume (%)"));
329  setValue(90);
330  setHelpText(QObject::tr("Volume of the recording "));
331  };
332 };
333 
335 {
336  public:
338  bool layer1, bool layer2, bool layer3,
339  uint default_layer)
340  {
341  const std::array<const QString,3> layers { "Layer I", "Layer II", "Layer III", };
342 
343  setLabel(QObject::tr("Bitrate Settings"));
344 
345  auto *audType = new MPEG2audType(parent, layer1, layer2, layer3);
346 
347  addChild(audType);
348 
349  addTargetedChild(layers[0], new MPEG2audBitrateL1(parent));
350  addTargetedChild(layers[1], new MPEG2audBitrateL2(parent));
351  addTargetedChild(layers[2], new MPEG2audBitrateL3(parent));
352 
353  uint desired_layer = std::max(std::min(3U, default_layer), 1U) - 1;
354  int which = audType->getValueIndex(layers[desired_layer]);
355  if (which >= 0)
356  audType->setValue(which);
357  };
358 };
359 
361 {
362  public:
363  explicit MPEG2Language(const RecordingProfile &parent) :
364  MythUIComboBoxSetting(this), CodecParamStorage(this, parent, "mpeg2language")
365  {
366  setLabel(QObject::tr("SAP/Bilingual"));
367 
368  addSelection(QObject::tr("Main Language"), "0");
369  addSelection(QObject::tr("SAP Language"), "1");
370  addSelection(QObject::tr("Dual"), "2");
371 
372  setValue(0);
373  setHelpText(QObject::tr(
374  "Chooses the language(s) to record when "
375  "two languages are broadcast. Only Layer II "
376  "supports the recording of two languages (Dual)."
377  "Requires ivtv 0.4.0 or later."));
378  };
379 };
380 
382 {
383  public:
384  explicit BitrateMode(const RecordingProfile& parent,
385  const QString& setting = "mpeg2bitratemode") :
386  MythUIComboBoxSetting(this),
387  CodecParamStorage(this, parent, setting)
388  {
389  setLabel(QObject::tr("Bitrate Mode"));
390 
391  addSelection("Variable Bitrate", "0");
392  addSelection("Constant Bitrate", "1");
393  setValue(0);
394  setHelpText(QObject::tr("Bitrate mode"));
395  }
396 };
397 
399 {
400  public:
402  V4L2util* v4l2) :
403  m_parent(parentProfile)
404  {
405  setName(QObject::tr("Audio Quality"));
406 
409 
410  QString label("MP3");
414 
415  label = "MPEG-2 Hardware Encoder";
416  m_codecName->addTargetedChild(label, new SampleRate(m_parent, false));
419  (m_parent, false, true, false, 2));
422 
423  label = "Uncompressed";
426 
427  m_codecName->addTargetedChild("AC3 Hardware Encoder",
428  new GroupSetting());
429 
430  m_codecName->addTargetedChild("AAC Hardware Encoder",
431  new GroupSetting());
432 
433 #ifdef USING_V4L2
434  if (v4l2)
435  {
436  // Dynamically create user options based on the
437  // capabilties the driver reports.
438 
440 
441  if (v4l2->GetOptions(options))
442  {
443  /* StandardSetting cannot handle multiple 'targets' pointing
444  * to the same setting configuration, so we need to do
445  * this in two passes. */
446 
447  for (const auto & option : qAsConst(options))
448  {
449  if (option.m_category == DriverOption::AUDIO_ENCODING)
450  {
451  for (const auto & Imenu : qAsConst(option.m_menu))
452  {
453  if (!Imenu.isEmpty())
454  m_v4l2codecs << "V4L2:" + Imenu;
455  }
456  }
457  }
458 
459  for (auto Icodec = m_v4l2codecs.begin(); Icodec < m_v4l2codecs.end(); ++Icodec)
460  {
461  for (const auto & option : qAsConst(options))
462  {
463  if (option.m_category == DriverOption::AUDIO_BITRATE_MODE)
464  {
465  m_codecName->addTargetedChild(*Icodec,
466  new BitrateMode(m_parent, "audbitratemode"));
467  }
468  else if (option.m_category ==
470  {
471  m_codecName->addTargetedChild(*Icodec,
472  new SampleRate(m_parent, false));
473  }
474  else if (option.m_category ==
476  {
477  m_codecName->addTargetedChild(*Icodec,
478  new MPEG2Language(m_parent));
479  }
480  else if (option.m_category == DriverOption::AUDIO_BITRATE)
481  {
482  bool layer1 = false;
483  bool layer2 = false;
484  bool layer3 = false;
485 
486  for (const auto & Imenu : qAsConst(option.m_menu))
487  {
488  if (Imenu.indexOf("Layer III") >= 0)
489  layer3 = true;
490  else if (Imenu.indexOf("Layer II") >= 0)
491  layer2 = true;
492  else if (Imenu.indexOf("Layer I") >= 0)
493  layer1 = true;
494  }
495 
496  if (layer1 || layer2 || layer3)
497  {
498  m_codecName->addTargetedChild(*Icodec,
500  layer1,
501  layer2,
502  layer3, 2));
503  }
504  }
505  else if (option.m_category == DriverOption::VOLUME)
506  {
507  m_codecName->addTargetedChild(*Icodec,
508  new MPEG2audVolume(m_parent));
509  }
510  }
511  }
512  }
513  }
514 #else
515  Q_UNUSED(v4l2);
516 #endif // USING_V4L2
517  }
518 
519  void selectCodecs(const QString & groupType)
520  {
521  if (!groupType.isNull())
522  {
523  if (groupType == "MPEG")
524  m_codecName->addSelection("MPEG-2 Hardware Encoder");
525  else if (groupType == "HDPVR")
526  {
527  m_codecName->addSelection("AC3 Hardware Encoder");
528  m_codecName->addSelection("AAC Hardware Encoder");
529  }
530  else if (groupType.startsWith("V4L2:"))
531  {
532  for (const auto & codec : qAsConst(m_v4l2codecs))
533  m_codecName->addSelection(codec);
534  }
535  else
536  {
537  // V4L, TRANSCODE (and any undefined types)
538  m_codecName->addSelection("MP3");
539  m_codecName->addSelection("Uncompressed");
540  }
541  }
542  else
543  {
544  m_codecName->addSelection("MP3");
545  m_codecName->addSelection("Uncompressed");
546  m_codecName->addSelection("MPEG-2 Hardware Encoder");
547  }
548  }
549 private:
552  QStringList m_v4l2codecs;
553 };
554 
556 {
557  public:
558  explicit VideoCodecName(const RecordingProfile &parent) :
560  new RecordingProfileStorage(this, parent, "videocodec"))
561  {
562  setLabel(QObject::tr("Codec"));
563  setName("videocodec");
564  }
565 };
566 
568 {
569  public:
570  explicit RTjpegQuality(const RecordingProfile &parent) :
571  MythUISpinBoxSetting(this, 1, 255, 1),
572  CodecParamStorage(this, parent, "rtjpegquality")
573  {
574  setLabel(QObject::tr("RTjpeg Quality"));
575  setValue(170);
576  setHelpText(QObject::tr("Higher is better quality."));
577  };
578 };
579 
581 {
582  public:
583  explicit RTjpegLumaFilter(const RecordingProfile &parent) :
584  MythUISpinBoxSetting(this, 0, 31, 1),
585  CodecParamStorage(this, parent, "rtjpeglumafilter")
586  {
587  setLabel(QObject::tr("Luma filter"));
588  setValue(0);
589  setHelpText(QObject::tr("Lower is better."));
590  };
591 };
592 
594 {
595  public:
596  explicit RTjpegChromaFilter(const RecordingProfile &parent) :
597  MythUISpinBoxSetting(this, 0, 31, 1),
598  CodecParamStorage(this, parent, "rtjpegchromafilter")
599  {
600  setLabel(QObject::tr("Chroma filter"));
601  setValue(0);
602  setHelpText(QObject::tr("Lower is better."));
603  };
604 };
605 
607 {
608  public:
609  explicit MPEG4bitrate(const RecordingProfile &parent) :
610  MythUISpinBoxSetting(this, 100, 8000, 100),
611  CodecParamStorage(this, parent, "mpeg4bitrate")
612  {
613  setLabel(QObject::tr("Bitrate (kb/s)"));
614  setValue(2200);
615  setHelpText(QObject::tr("Bitrate in kilobits/second. As a guide, "
616  "2200 kb/s is approximately 1 GB/hr."));
617  };
618 };
619 
621 {
622  public:
623  explicit ScaleBitrate(const RecordingProfile &parent) :
624  MythUICheckBoxSetting(this),
625  CodecParamStorage(this, parent, "scalebitrate")
626  {
627  setLabel(QObject::tr("Scale bitrate for frame size"));
628  setValue(true);
629  setHelpText(QObject::tr("If set, the bitrate specified will be used "
630  "for 640x480. If other resolutions are used, the "
631  "bitrate will be scaled appropriately."));
632  };
633 };
634 
636 {
637  public:
638  explicit MPEG4MinQuality(const RecordingProfile &parent) :
639  MythUISpinBoxSetting(this, 1, 31, 1),
640  CodecParamStorage(this, parent, "mpeg4minquality")
641  {
642  setLabel(QObject::tr("Minimum quality"));
643  setValue(15);
644  setHelpText(QObject::tr("Modifying the default may have severe "
645  "consequences."));
646  };
647 };
648 
650 {
651  public:
652  explicit MPEG4MaxQuality(const RecordingProfile &parent) :
653  MythUISpinBoxSetting(this, 1, 31, 1),
654  CodecParamStorage(this, parent, "mpeg4maxquality")
655  {
656  setLabel(QObject::tr("Maximum quality"));
657  setValue(2);
658  setHelpText(QObject::tr("Modifying the default may have severe "
659  "consequences."));
660  };
661 };
662 
664 {
665  public:
666  explicit MPEG4QualDiff(const RecordingProfile &parent) :
667  MythUISpinBoxSetting(this, 1, 31, 1),
668  CodecParamStorage(this, parent, "mpeg4qualdiff")
669  {
670 
671  setLabel(QObject::tr("Max quality difference between frames"));
672  setValue(3);
673  setHelpText(QObject::tr("Modifying the default may have severe "
674  "consequences."));
675  };
676 };
677 
679 {
680  public:
681  explicit MPEG4OptionIDCT(const RecordingProfile &parent) :
682  MythUICheckBoxSetting(this),
683  CodecParamStorage(this, parent, "mpeg4optionidct")
684  {
685  setLabel(QObject::tr("Enable interlaced DCT encoding"));
686  setValue(false);
687  setHelpText(QObject::tr("If set, the MPEG4 encoder will use "
688  "interlaced DCT encoding. You may want this when encoding "
689  "interlaced video; however, this is experimental and may "
690  "cause damaged video."));
691  };
692 };
693 
695 {
696  public:
697  explicit MPEG4OptionIME(const RecordingProfile &parent) :
698  MythUICheckBoxSetting(this),
699  CodecParamStorage(this, parent, "mpeg4optionime")
700  {
701  setLabel(QObject::tr("Enable interlaced motion estimation"));
702  setValue(false);
703  setHelpText(QObject::tr("If set, the MPEG4 encoder will use "
704  "interlaced motion estimation. You may want this when "
705  "encoding interlaced video; however, this is experimental "
706  "and may cause damaged video."));
707  };
708 };
709 
711 {
712  public:
713  explicit MPEG4OptionVHQ(const RecordingProfile &parent) :
714  MythUICheckBoxSetting(this),
715  CodecParamStorage(this, parent, "mpeg4optionvhq")
716  {
717  setLabel(QObject::tr("Enable high-quality encoding"));
718  setValue(false);
719  setHelpText(QObject::tr("If set, the MPEG4 encoder will use "
720  "'high-quality' encoding options. This requires much "
721  "more processing, but can result in better video."));
722  };
723 };
724 
726 {
727  public:
728  explicit MPEG4Option4MV(const RecordingProfile &parent) :
729  MythUICheckBoxSetting(this),
730  CodecParamStorage(this, parent, "mpeg4option4mv")
731  {
732  setLabel(QObject::tr("Enable 4MV encoding"));
733  setValue(false);
734  setHelpText(QObject::tr("If set, the MPEG4 encoder will use '4MV' "
735  "motion-vector encoding. This requires "
736  "much more processing, but can result in better "
737  "video. It is highly recommended that the HQ option is "
738  "enabled if 4MV is enabled."));
739  };
740 };
741 
743 {
744  public:
745  explicit EncodingThreadCount(const RecordingProfile &parent) :
746  MythUISpinBoxSetting(this, 1, 8, 1),
747  CodecParamStorage(this, parent, "encodingthreadcount")
748  {
749 
750  setLabel(QObject::tr("Number of threads"));
751  setValue(1);
752  setHelpText(
753  QObject::tr("Threads to use for software encoding.") + " " +
754  QObject::tr("Set to a value less than or equal to the "
755  "number of processors on the backend that "
756  "will be doing the encoding."));
757  };
758 };
759 
761 {
762  public:
763  explicit AverageBitrate(const RecordingProfile &parent,
764  const QString& setting = "mpeg2bitrate",
765  uint min_br = 1000, uint max_br = 16000,
766  uint default_br = 4500, uint increment = 100,
767  QString label = QString()) :
768  MythUISpinBoxSetting(this, min_br, max_br, increment),
769  CodecParamStorage(this, parent, setting)
770  {
771  if (label.isEmpty())
772  label = QObject::tr("Avg. Bitrate (kb/s)");
773  setLabel(label);
774  setValue(default_br);
775  setHelpText(QObject::tr(
776  "Average bitrate in kilobits/second. As a guide, "
777  "2200 kb/s is approximately 1 GB/hour."));
778  };
779 };
780 
782 {
783  public:
784  explicit PeakBitrate(const RecordingProfile &parent,
785  const QString& setting = "mpeg2maxbitrate",
786  uint min_br = 1000, uint max_br = 16000,
787  uint default_br = 6000, uint increment = 100,
788  QString label = QString()) :
789  MythUISpinBoxSetting(this, min_br, max_br, increment),
790  CodecParamStorage(this, parent, setting)
791  {
792  if (label.isEmpty())
793  label = QObject::tr("Max. Bitrate (kb/s)");
794  setLabel(label);
795  setValue(default_br);
796  setHelpText(QObject::tr("Maximum bitrate in kilobits/second. "
797  "As a guide, 2200 kb/s is approximately 1 GB/hour."));
798  };
799 };
800 
802 {
803  public:
804  explicit MPEG2streamType(const RecordingProfile &parent,
805  uint minopt = 0, uint maxopt = 8, uint defopt = 0) :
806  MythUIComboBoxSetting(this),
807  CodecParamStorage(this, parent, "mpeg2streamtype")
808  {
809  if (maxopt > 8) maxopt = 8;
810 
811  setLabel(QObject::tr("Stream Type"));
812 
813  const std::array<const QString,9> options { "MPEG-2 PS", "MPEG-2 TS",
814  "MPEG-1 VCD", "PES AV",
815  "PES V", "PES A",
816  "DVD", "DVD-Special 1", "DVD-Special 2" };
817 
818  for (uint idx = minopt; idx <= maxopt; ++idx)
819  addSelection(options[idx]);
820 
821  setValue(defopt - minopt);
822  setHelpText(QObject::tr("Sets the type of stream generated by "
823  "your PVR."));
824  };
825 };
826 
828 {
829  public:
830  explicit MPEG2aspectRatio(const RecordingProfile &parent,
831  uint minopt = 0, uint maxopt = 8, uint defopt = 0) :
832  MythUIComboBoxSetting(this),
833  CodecParamStorage(this, parent, "mpeg2aspectratio")
834  {
835  if (maxopt > 3) maxopt = 3;
836 
837  setLabel(QObject::tr("Aspect Ratio"));
838 
839  const std::array<const QString,4> options { QObject::tr("Square"), "4:3",
840  "16:9", "2.21:1" };
841 
842  for (uint idx = minopt; idx <= maxopt; ++idx)
843  addSelection(options[idx]);
844 
845  setValue(defopt);
846  setHelpText(QObject::tr("Sets the aspect ratio of stream generated "
847  "by your PVR."));
848  };
849 };
850 
852 {
853  public:
854  explicit HardwareMJPEGQuality(const RecordingProfile &parent) :
855  MythUISpinBoxSetting(this, 0, 100, 1),
856  CodecParamStorage(this, parent, "hardwaremjpegquality")
857  {
858  setLabel(QObject::tr("Quality"));
859  setValue("100");
860  };
861 };
862 
864  public CodecParamStorage
865 {
866  public:
867  explicit HardwareMJPEGHDecimation(const RecordingProfile &parent) :
868  MythUIComboBoxSetting(this),
869  CodecParamStorage(this, parent, "hardwaremjpeghdecimation")
870  {
871  setLabel(QObject::tr("Horizontal Decimation"));
872  addSelection("1");
873  addSelection("2");
874  addSelection("4");
875  setValue(2);
876  };
877 };
878 
880  public CodecParamStorage
881 {
882  public:
883  explicit HardwareMJPEGVDecimation(const RecordingProfile &parent) :
884  MythUIComboBoxSetting(this),
885  CodecParamStorage(this, parent, "hardwaremjpegvdecimation") {
886  setLabel(QObject::tr("Vertical Decimation"));
887  addSelection("1");
888  addSelection("2");
889  addSelection("4");
890  setValue(2);
891  };
892 };
893 
895 {
896  public:
898  V4L2util* v4l2) :
899  m_parent(parentProfile)
900  {
901  setName(QObject::tr("Video Compression"));
902 
905 
906  QString label("RTjpeg");
910 
911  label = "MPEG-4";
917 
920 
923 #ifdef USING_FFMPEG_THREADS
925 #endif
926 
927  label = "MPEG-2";
930  //m_codecName->addTargetedChild(label, new MPEG4MaxQuality(m_parent));
931  //m_codecName->addTargetedChild(label, new MPEG4MinQuality(m_parent));
932  //m_codecName->addTargetedChild(label, new MPEG4QualDiff(m_parent));
933  //m_codecName->addTargetedChild(label, new MPEG4OptionVHQ(m_parent));
934  //m_codecName->addTargetedChild(label, new MPEG4Option4MV(m_parent));
935 #ifdef USING_FFMPEG_THREADS
937 #endif
938 
939  label = "Hardware MJPEG";
943 
944  label = "MPEG-2 Hardware Encoder";
949 
950  label = "MPEG-4 AVC Hardware Encoder";
951  auto *h0 = new GroupSetting();
952  h0->setLabel(QObject::tr("Low Resolution"));
953  h0->addChild(new AverageBitrate(m_parent, "low_mpeg4avgbitrate",
954  1000, 13500, 4500, 500));
955  h0->addChild(new PeakBitrate(m_parent, "low_mpeg4peakbitrate",
956  1100, 20200, 6000, 500));
957  m_codecName->addTargetedChild(label, h0);
958 
959  auto *h1 = new GroupSetting();
960  h1->setLabel(QObject::tr("Medium Resolution"));
961  h1->addChild(new AverageBitrate(m_parent, "medium_mpeg4avgbitrate",
962  1000, 13500, 9000, 500));
963  h1->addChild(new PeakBitrate(m_parent, "medium_mpeg4peakbitrate",
964  1100, 20200, 11000, 500));
965  m_codecName->addTargetedChild(label, h1);
966 
967  auto *h2 = new GroupSetting();
968  h2->setLabel(QObject::tr("High Resolution"));
969  h2->addChild(new AverageBitrate(m_parent, "high_mpeg4avgbitrate",
970  1000, 13500, 13500, 500));
971  h2->addChild(new PeakBitrate(m_parent, "high_mpeg4peakbitrate",
972  1100, 20200, 20200, 500));
973  m_codecName->addTargetedChild(label, h2);
974 
975 #ifdef USING_V4L2
976  if (v4l2)
977  {
979 
980  if (v4l2->GetOptions(options))
981  {
982  /* StandardSetting cannot handle multiple 'targets' pointing
983  * to the same setting configuration, so we need to do
984  * this in two passes. */
985 
986  for (const auto & option : qAsConst(options))
987  {
988  if (option.m_category == DriverOption::VIDEO_ENCODING)
989  {
990  for (const auto & Imenu : qAsConst(option.m_menu))
991  {
992  if (!Imenu.isEmpty())
993  m_v4l2codecs << "V4L2:" + Imenu;
994  }
995  }
996  }
997 
998  for (auto Icodec = m_v4l2codecs.begin(); Icodec < m_v4l2codecs.end(); ++Icodec)
999  {
1000  auto* bit_low = new GroupSetting();
1001  auto* bit_medium = new GroupSetting();
1002  auto* bit_high = new GroupSetting();
1003  bool dynamic_res = !v4l2->UserAdjustableResolution();
1004 
1005  for (auto & option : options)
1006  {
1007  if (option.m_category == DriverOption::STREAM_TYPE)
1008  {
1009  m_codecName->addTargetedChild(*Icodec,
1011  option.m_minimum,
1012  option.m_maximum,
1013  option.m_defaultValue));
1014  }
1015  else if (option.m_category == DriverOption::VIDEO_ASPECT)
1016  {
1017  m_codecName->addTargetedChild(*Icodec,
1019  option.m_minimum,
1020  option.m_maximum,
1021  option.m_defaultValue));
1022  }
1023  else if (option.m_category ==
1025  {
1026  if (dynamic_res)
1027  {
1028  bit_low->addChild(new BitrateMode(m_parent,
1029  "low_mpegbitratemode"));
1030  bit_medium->addChild(new BitrateMode(m_parent,
1031  "medium_mpegbitratemode"));
1032  bit_high->addChild(new BitrateMode(m_parent,
1033  "medium_mpegbitratemode"));
1034  }
1035  else
1036  bit_low->addChild(new BitrateMode(m_parent));
1037  }
1038  else if (option.m_category == DriverOption::VIDEO_BITRATE)
1039  {
1040  if (dynamic_res)
1041  {
1042  bit_low->setLabel(QObject::tr("Low Resolution"));
1043  bit_low->addChild(new AverageBitrate(m_parent,
1044  "low_mpegavgbitrate",
1045  option.m_minimum / 1000,
1046  option.m_maximum / 1000,
1047  option.m_defaultValue / 1000,
1048  option.m_step / 1000));
1049 
1050  bit_medium->setLabel(QObject::
1051  tr("Medium Resolution"));
1052  bit_medium->addChild(new AverageBitrate(m_parent,
1053  "medium_mpegavgbitrate",
1054  option.m_minimum / 1000,
1055  option.m_maximum / 1000,
1056  option.m_defaultValue / 1000,
1057  option.m_step / 1000));
1058 
1059  bit_high->setLabel(QObject::
1060  tr("High Resolution"));
1061  bit_high->addChild(new AverageBitrate(m_parent,
1062  "high_mpegavgbitrate",
1063  option.m_minimum / 1000,
1064  option.m_maximum / 1000,
1065  option.m_defaultValue / 1000,
1066  option.m_step / 1000));
1067  }
1068  else
1069  {
1070  bit_low->setLabel(QObject::tr("Bitrate"));
1071  bit_low->addChild(new AverageBitrate(m_parent,
1072  "mpeg2bitrate",
1073  option.m_minimum / 1000,
1074  option.m_maximum / 1000,
1075  option.m_defaultValue / 1000,
1076  option.m_step / 1000));
1077  }
1078  }
1079  else if (option.m_category ==
1081  {
1082  if (dynamic_res)
1083  {
1084  bit_low->addChild(new PeakBitrate(m_parent,
1085  "low_mpegpeakbitrate",
1086  option.m_minimum / 1000,
1087  option.m_maximum / 1000,
1088  option.m_defaultValue / 1000,
1089  option.m_step / 1000));
1090  bit_medium->addChild(new PeakBitrate(m_parent,
1091  "medium_mpegpeakbitrate",
1092  option.m_minimum / 1000,
1093  option.m_maximum / 1000,
1094  option.m_defaultValue / 1000,
1095  option.m_step / 1000));
1096  bit_high->addChild(new PeakBitrate(m_parent,
1097  "high_mpegpeakbitrate",
1098  option.m_minimum / 1000,
1099  option.m_maximum / 1000,
1100  option.m_defaultValue / 1000,
1101  option.m_step / 1000));
1102  }
1103  else
1104  {
1105  bit_low->addChild(new PeakBitrate(m_parent,
1106  "mpeg2maxbitrate",
1107  option.m_minimum / 1000,
1108  option.m_maximum / 1000,
1109  option.m_defaultValue / 1000,
1110  option.m_step / 1000));
1111  }
1112  }
1113  }
1114 
1115  m_codecName->addTargetedChild(*Icodec, bit_low);
1116  if (dynamic_res)
1117  {
1118  m_codecName->addTargetedChild(*Icodec, bit_medium);
1119  m_codecName->addTargetedChild(*Icodec, bit_high);
1120  }
1121  else
1122  {
1123  // These are only referenced when dynamic_res is true.
1124  delete bit_medium;
1125  delete bit_high;
1126  }
1127  }
1128  }
1129  }
1130 #else
1131  Q_UNUSED(v4l2);
1132 #endif // USING_V4L2
1133  }
1134 
1135  void selectCodecs(const QString& groupType)
1136  {
1137  if (!groupType.isNull())
1138  {
1139  if (groupType == "HDPVR")
1140  m_codecName->addSelection("MPEG-4 AVC Hardware Encoder");
1141  else if (groupType.startsWith("V4L2:"))
1142  {
1143  for (const auto & codec : qAsConst(m_v4l2codecs))
1144  m_codecName->addSelection(codec);
1145  }
1146  else if (groupType == "MPEG")
1147  m_codecName->addSelection("MPEG-2 Hardware Encoder");
1148  else if (groupType == "MJPEG")
1149  m_codecName->addSelection("Hardware MJPEG");
1150  else if (groupType == "GO7007")
1151  {
1152  m_codecName->addSelection("MPEG-4");
1153  m_codecName->addSelection("MPEG-2");
1154  }
1155  else
1156  {
1157  // V4L, TRANSCODE (and any undefined types)
1158  m_codecName->addSelection("RTjpeg");
1159  m_codecName->addSelection("MPEG-4");
1160  }
1161  }
1162  else
1163  {
1164  m_codecName->addSelection("RTjpeg");
1165  m_codecName->addSelection("MPEG-4");
1166  m_codecName->addSelection("Hardware MJPEG");
1167  m_codecName->addSelection("MPEG-2 Hardware Encoder");
1168  }
1169  }
1170 
1171 private:
1174  QStringList m_v4l2codecs;
1175 };
1176 
1178 {
1179  public:
1180  explicit AutoTranscode(const RecordingProfile &parent) :
1181  MythUICheckBoxSetting(this),
1182  CodecParamStorage(this, parent, "autotranscode")
1183  {
1184  setLabel(QObject::tr("Enable auto-transcode after recording"));
1185  setValue(false);
1186  setHelpText(QObject::tr("Automatically transcode when a recording is "
1187  "made using this profile and the recording's "
1188  "schedule is configured to allow transcoding."));
1189  };
1190 };
1191 
1193 {
1194  public:
1195  explicit TranscodeResize(const RecordingProfile &parent) :
1196  MythUICheckBoxSetting(this),
1197  CodecParamStorage(this, parent, "transcoderesize")
1198  {
1199  setLabel(QObject::tr("Resize video while transcoding"));
1200  setValue(false);
1201  setHelpText(QObject::tr("Allows the transcoder to "
1202  "resize the video during transcoding."));
1203  };
1204 };
1205 
1207 {
1208  public:
1209  explicit TranscodeLossless(const RecordingProfile &parent) :
1210  MythUICheckBoxSetting(this),
1211  CodecParamStorage(this, parent, "transcodelossless")
1212  {
1213  setLabel(QObject::tr("Lossless transcoding"));
1214  setValue(false);
1215  setHelpText(QObject::tr("Only reencode where absolutely needed "
1216  "(normally only around cutpoints). Otherwise "
1217  "keep audio and video formats identical to "
1218  "the source. This should result in the "
1219  "highest quality, but won't save as much "
1220  "space."));
1221  };
1222 };
1223 
1225 {
1226  public:
1227  explicit RecordingTypeStream(const RecordingProfile &parent) :
1228  MythUIComboBoxSetting(this), CodecParamStorage(this, parent, "recordingtype")
1229  {
1230  setLabel(QObject::tr("Recording Type"));
1231 
1232  QString msg = QObject::tr(
1233  "This option allows you to filter out unwanted streams. "
1234  "'Normal' will record all relevant streams including "
1235  "interactive television data. 'TV Only' will record only "
1236  "audio, video and subtitle streams. ");
1237  setHelpText(msg);
1238 
1239  addSelection(QObject::tr("Normal"), "all");
1240  addSelection(QObject::tr("TV Only"), "tv");
1241  addSelection(QObject::tr("Audio Only"), "audio");
1242  setValue(0);
1243  };
1244 };
1245 
1247 {
1248  public:
1249  explicit RecordFullTSStream(const RecordingProfile &parent) :
1250  MythUIComboBoxSetting(this), CodecParamStorage(this, parent, "recordmpts")
1251  {
1252  setLabel(QObject::tr("Record Full TS?"));
1253 
1254  QString msg = QObject::tr(
1255  "If set, extra files will be created for each recording with "
1256  "the name of the recording followed by '.ts.raw'. "
1257  "These extra files represent the full contents of the transport "
1258  "stream used to generate the recording. (For debugging purposes)");
1259  setHelpText(msg);
1260 
1261  addSelection(QObject::tr("Yes"), "1");
1262  addSelection(QObject::tr("No"), "0");
1263  setValue(1);
1264  };
1265 };
1266 
1268 {
1269  public:
1270  explicit TranscodeFilters(const RecordingProfile &parent) :
1271  MythUITextEditSetting(this),
1272  CodecParamStorage(this, parent, "transcodefilters")
1273  {
1274  setLabel(QObject::tr("Custom filters"));
1275  setHelpText(QObject::tr("Filters used when transcoding with this "
1276  "profile. This value must be blank to perform "
1277  "lossless transcoding. Format: "
1278  "[[<filter>=<options>,]...]"
1279  ));
1280  };
1281 };
1282 
1283 class ImageSize : public GroupSetting
1284 {
1285  public:
1287  {
1288  public:
1289  Width(const RecordingProfile &parent,
1290  uint defaultwidth, uint maxwidth,
1291  bool transcoding = false) :
1292  MythUISpinBoxSetting(this, transcoding ? 0 : 160,
1293  maxwidth, 16, 0,
1294  transcoding ? QObject::tr("Auto") : QString()),
1295  CodecParamStorage(this, parent, "width")
1296  {
1297  setLabel(QObject::tr("Width"));
1298  setValue(defaultwidth);
1299 
1300  QString help = (transcoding) ?
1301  QObject::tr("If the width is set to 'Auto', the width "
1302  "will be calculated based on the height and "
1303  "the recording's physical aspect ratio.") :
1304  QObject::tr("Width to use for encoding. "
1305  "Note: PVR-x50 cards may produce ghosting if "
1306  "this is not set to 720 or 768 for NTSC and "
1307  "PAL, respectively.");
1308 
1309  setHelpText(help);
1310  };
1311  };
1312 
1314  {
1315  public:
1316  Height(const RecordingProfile &parent,
1317  uint defaultheight, uint maxheight,
1318  bool transcoding = false):
1319  MythUISpinBoxSetting(this, transcoding ? 0 : 160,
1320  maxheight, 16, 0,
1321  transcoding ? QObject::tr("Auto") : QString()),
1322  CodecParamStorage(this, parent, "height")
1323  {
1324  setLabel(QObject::tr("Height"));
1325  setValue(defaultheight);
1326 
1327  QString help = (transcoding) ?
1328  QObject::tr("If the height is set to 'Auto', the height "
1329  "will be calculated based on the width and "
1330  "the recording's physical aspect ratio.") :
1331  QObject::tr("Height to use for encoding. "
1332  "Note: PVR-x50 cards may produce ghosting if "
1333  "this is not set to 480 or 576 for NTSC and "
1334  "PAL, respectively.");
1335 
1336  setHelpText(help);
1337  };
1338  };
1339 
1341  const QString& tvFormat, const QString& profName)
1342  {
1343  setLabel(QObject::tr("Image size"));
1344 
1345  QSize defaultsize(768, 576);
1346  QSize maxsize(768, 576);
1347  bool transcoding = profName.startsWith("Transcoders");
1348  bool ivtv = profName.startsWith("IVTV MPEG-2 Encoders");
1349 
1350  if (transcoding)
1351  {
1352  maxsize = QSize(1920, 1088);
1353  if (tvFormat.toLower() == "ntsc" || tvFormat.toLower() == "atsc")
1354  defaultsize = QSize(480, 480);
1355  else
1356  defaultsize = QSize(480, 576);
1357  }
1358  else if (tvFormat.startsWith("ntsc", Qt::CaseInsensitive))
1359  {
1360  maxsize = QSize(720, 480);
1361  defaultsize = (ivtv) ? QSize(720, 480) : QSize(480, 480);
1362  }
1363  else if (tvFormat.toLower() == "atsc")
1364  {
1365  maxsize = QSize(1920, 1088);
1366  defaultsize = QSize(1920, 1088);
1367  }
1368  else
1369  {
1370  maxsize = QSize(768, 576);
1371  defaultsize = (ivtv) ? QSize(720, 576) : QSize(480, 576);
1372  }
1373 
1374  addChild(new Width(parent, defaultsize.width(),
1375  maxsize.width(), transcoding));
1376  addChild(new Height(parent, defaultsize.height(),
1377  maxsize.height(), transcoding));
1378  };
1379 };
1380 
1381 // id and name will be deleted by ConfigurationGroup's destructor
1382 RecordingProfile::RecordingProfile(const QString& profName)
1383  : m_id(new ID()),
1384  m_name(new Name(*this)),
1385  m_profileName(profName)
1386 {
1387  // This must be first because it is needed to load/save the other settings
1388  addChild(m_id);
1389 
1390  setLabel(profName);
1391  addChild(m_name);
1392 
1393  m_trFilters = nullptr;
1394  m_trLossless = nullptr;
1395  m_trResize = nullptr;
1396 
1397  if (!profName.isEmpty())
1398  {
1399  if (profName.startsWith("Transcoders"))
1400  {
1401  m_trFilters = new TranscodeFilters(*this);
1402  m_trLossless = new TranscodeLossless(*this);
1403  m_trResize = new TranscodeResize(*this);
1407  }
1408  else
1409  addChild(new AutoTranscode(*this));
1410  }
1411  else
1412  {
1413  m_trFilters = new TranscodeFilters(*this);
1414  m_trLossless = new TranscodeLossless(*this);
1415  m_trResize = new TranscodeResize(*this);
1419  addChild(new AutoTranscode(*this));
1420  }
1421 };
1422 
1424 {
1425 #ifdef USING_V4L2
1426  delete m_v4l2util;
1427  m_v4l2util = nullptr;
1428 #endif
1429 }
1430 
1431 void RecordingProfile::ResizeTranscode(const QString & /*val*/)
1432 {
1433  if (m_imageSize)
1435 }
1436 
1437 void RecordingProfile::SetLosslessTranscode(const QString & /*val*/)
1438 {
1439  bool lossless = m_trLossless->boolValue();
1440  bool show_size = (lossless) ? false : m_trResize->boolValue();
1441  if (m_imageSize)
1442  m_imageSize->setEnabled(show_size);
1443  m_videoSettings->setEnabled(! lossless);
1444  m_audioSettings->setEnabled(! lossless);
1445  m_trResize->setEnabled(! lossless);
1446  m_trFilters->setEnabled(! lossless);
1447 }
1448 
1449 void RecordingProfile::loadByID(int profileId)
1450 {
1451  MSqlQuery result(MSqlQuery::InitCon());
1452  result.prepare(
1453  "SELECT cardtype, profilegroups.name "
1454  "FROM profilegroups, recordingprofiles "
1455  "WHERE profilegroups.id = recordingprofiles.profilegroup AND "
1456  " recordingprofiles.id = :PROFILEID");
1457  result.bindValue(":PROFILEID", profileId);
1458 
1459  QString type;
1460  QString name;
1461  if (!result.exec())
1462  {
1463  MythDB::DBError("RecordingProfile::loadByID -- cardtype", result);
1464  }
1465  else if (result.next())
1466  {
1467  type = result.value(0).toString();
1468  name = result.value(1).toString();
1469  }
1470 
1471  CompleteLoad(profileId, type, name);
1472 }
1473 
1474 void RecordingProfile::FiltersChanged(const QString &val)
1475 {
1476  // If there are filters, we cannot do lossless transcoding
1477  if (!val.trimmed().isEmpty())
1478  {
1479  m_trLossless->setValue(false);
1480  m_trLossless->setEnabled(false);
1481  }
1482  else
1483  {
1484  m_trLossless->setEnabled(true);
1485  }
1486 }
1487 
1488 bool RecordingProfile::loadByType(const QString &name, const QString &card,
1489  const QString &videodev)
1490 {
1491  QString hostname = gCoreContext->GetHostName().toLower();
1492  QString cardtype = card;
1493  uint profileId = 0;
1494 
1495 #ifdef USING_V4L2
1496  if (cardtype == "V4L2ENC")
1497  {
1498  m_v4l2util = new V4L2util(videodev);
1499  if (m_v4l2util->IsOpen())
1500  cardtype = m_v4l2util->ProfileName();
1501  }
1502 #else
1503  Q_UNUSED(videodev);
1504 #endif
1505 
1506  MSqlQuery result(MSqlQuery::InitCon());
1507  result.prepare(
1508  "SELECT recordingprofiles.id, profilegroups.hostname, "
1509  " profilegroups.is_default "
1510  "FROM recordingprofiles, profilegroups "
1511  "WHERE profilegroups.id = recordingprofiles.profilegroup AND "
1512  " profilegroups.cardtype = :CARDTYPE AND "
1513  " recordingprofiles.name = :NAME");
1514  result.bindValue(":CARDTYPE", cardtype);
1515  result.bindValue(":NAME", name);
1516 
1517  if (!result.exec())
1518  {
1519  MythDB::DBError("RecordingProfile::loadByType()", result);
1520  return false;
1521  }
1522 
1523  while (result.next())
1524  {
1525  if (result.value(1).toString().toLower() == hostname)
1526  {
1527  profileId = result.value(0).toUInt();
1528  }
1529  else if (result.value(2).toInt() == 1)
1530  {
1531  profileId = result.value(0).toUInt();
1532  break;
1533  }
1534  }
1535 
1536  if (profileId)
1537  {
1538  CompleteLoad(profileId, cardtype, name);
1539  return true;
1540  }
1541 
1542  return false;
1543 }
1544 
1545 bool RecordingProfile::loadByGroup(const QString &name, const QString &group)
1546 {
1547  MSqlQuery result(MSqlQuery::InitCon());
1548  result.prepare(
1549  "SELECT recordingprofiles.id, cardtype "
1550  "FROM recordingprofiles, profilegroups "
1551  "WHERE recordingprofiles.profilegroup = profilegroups.id AND "
1552  " profilegroups.name = :GROUPNAME AND "
1553  " recordingprofiles.name = :NAME");
1554  result.bindValue(":GROUPNAME", group);
1555  result.bindValue(":NAME", name);
1556 
1557  if (!result.exec())
1558  {
1559  MythDB::DBError("RecordingProfile::loadByGroup()", result);
1560  return false;
1561  }
1562 
1563  if (result.next())
1564  {
1565  uint profileId = result.value(0).toUInt();
1566  QString type = result.value(1).toString();
1567 
1568  CompleteLoad(profileId, type, name);
1569  return true;
1570  }
1571 
1572  return false;
1573 }
1574 
1575 void RecordingProfile::CompleteLoad(int profileId, const QString &type,
1576  const QString &name)
1577 {
1578  if (m_profileName.isEmpty())
1579  m_profileName = name;
1580 
1582 
1583  if (m_isEncoder)
1584  {
1585 #ifdef USING_V4L2
1586  if (type.startsWith("V4L2:"))
1587  {
1588  QStringList devices = CardUtil::GetVideoDevices("V4L2ENC");
1589  if (!devices.isEmpty())
1590  {
1591  for (const auto & device : qAsConst(devices))
1592  {
1593  delete m_v4l2util;
1594  m_v4l2util = new V4L2util(device);
1595  if (m_v4l2util->IsOpen() &&
1596  m_v4l2util->DriverName() == type.mid(5))
1597  break;
1598  delete m_v4l2util;
1599  m_v4l2util = nullptr;
1600  }
1601  }
1602  }
1603 #endif
1604 
1605  QString tvFormat = gCoreContext->GetSetting("TVFormat");
1606  // TODO: When mpegrecorder is removed, don't check for "HDPVR' anymore...
1607  if (type != "HDPVR" &&
1608  (!m_v4l2util
1609 #ifdef USING_V4L2
1611 #endif
1612  ))
1613  {
1614  addChild(new ImageSize(*this, tvFormat, m_profileName));
1615  }
1617  m_v4l2util);
1619 
1621  m_v4l2util);
1623 
1624  if (!m_profileName.isEmpty() && m_profileName.startsWith("Transcoders"))
1625  {
1626  connect(m_trResize, qOverload<const QString&>(&StandardSetting::valueChanged),
1628  connect(m_trLossless, qOverload<const QString&>(&StandardSetting::valueChanged),
1630  connect(m_trFilters, qOverload<const QString&>(&StandardSetting::valueChanged),
1632  }
1633  }
1634  else if (type.toUpper() == "DVB")
1635  {
1636  addChild(new RecordingTypeStream(*this));
1637  }
1638 
1640  {
1641  addChild(new RecordFullTSStream(*this));
1642  }
1643 
1644  m_id->setValue(profileId);
1645  Load();
1646 }
1647 
1649 {
1650  if (m_videoSettings)
1652  if (m_audioSettings)
1654 }
1655 
1657  m_group(id), m_labelName(std::move(profName))
1658 {
1659  if (!m_labelName.isEmpty())
1661 }
1662 
1664 {
1665  clearSettings();
1666  auto *newProfile = new ButtonStandardSetting(tr("(Create new profile)"));
1668  addChild(newProfile);
1671 }
1672 
1674 {
1675  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1676  auto *settingdialog = new MythTextInputDialog(popupStack,
1677  tr("Enter the name of the new profile"));
1678 
1679  if (settingdialog->Create())
1680  {
1681  connect(settingdialog, &MythTextInputDialog::haveResult,
1683  popupStack->AddScreen(settingdialog);
1684  }
1685  else
1686  {
1687  delete settingdialog;
1688  }
1689 }
1690 
1691 void RecordingProfileEditor::CreateNewProfile(const QString& profName)
1692 {
1694  query.prepare(
1695  "INSERT INTO recordingprofiles "
1696  "(name, videocodec, audiocodec, profilegroup) "
1697  "VALUES "
1698  "(:NAME, :VIDEOCODEC, :AUDIOCODEC, :PROFILEGROUP);");
1699  query.bindValue(":NAME", profName);
1700  query.bindValue(":VIDEOCODEC", "MPEG-4");
1701  query.bindValue(":AUDIOCODEC", "MP3");
1702  query.bindValue(":PROFILEGROUP", m_group);
1703  if (!query.exec())
1704  {
1705  MythDB::DBError("RecordingProfileEditor::open", query);
1706  }
1707  else
1708  {
1709  query.prepare(
1710  "SELECT id "
1711  "FROM recordingprofiles "
1712  "WHERE name = :NAME AND profilegroup = :PROFILEGROUP;");
1713  query.bindValue(":NAME", profName);
1714  query.bindValue(":PROFILEGROUP", m_group);
1715  if (!query.exec())
1716  {
1717  MythDB::DBError("RecordingProfileEditor::open", query);
1718  }
1719  else
1720  {
1721  if (query.next())
1722  {
1723  auto* profile = new RecordingProfile(profName);
1724 
1725  profile->loadByID(query.value(0).toInt());
1726  profile->setCodecTypes();
1727  addChild(profile);
1728  emit settingsChanged(this);
1729  }
1730  }
1731  }
1732 }
1733 
1735  bool foldautodetect)
1736 {
1737  if (!group)
1738  {
1739  for (const auto & name : kAvailProfiles)
1740  {
1741  auto *profile = new GroupSetting();
1742  profile->setLabel(name);
1743  setting->addChild(profile);
1744  }
1745  return;
1746  }
1747 
1748  MSqlQuery result(MSqlQuery::InitCon());
1749  result.prepare(
1750  "SELECT name, id "
1751  "FROM recordingprofiles "
1752  "WHERE profilegroup = :GROUP "
1753  "ORDER BY id");
1754  result.bindValue(":GROUP", group);
1755 
1756  if (!result.exec())
1757  {
1758  MythDB::DBError("RecordingProfile::fillSelections 1", result);
1759  return;
1760  }
1761  if (!result.next())
1762  {
1763  return;
1764  }
1765 
1766  if (group == RecordingProfile::TranscoderGroup && foldautodetect)
1767  {
1768  auto *profile = new GroupSetting();
1769  profile->setLabel(QObject::tr("Autodetect"));
1770  setting->addChild(profile);
1771  }
1772 
1773  do
1774  {
1775  QString name = result.value(0).toString();
1776  QString id = result.value(1).toString();
1777 
1778  if (group == RecordingProfile::TranscoderGroup)
1779  {
1780  if (name == "RTjpeg/MPEG4" || name == "MPEG2")
1781  {
1782  if (!foldautodetect)
1783  {
1784  auto *profile =
1785  new RecordingProfile(QObject::tr("Autodetect from %1")
1786  .arg(name));
1787  profile->loadByID(id.toInt());
1788  profile->setCodecTypes();
1789  setting->addChild(profile);
1790  }
1791  }
1792  else
1793  {
1794  auto *profile = new RecordingProfile(name);
1795  profile->loadByID(id.toInt());
1796  profile->setCodecTypes();
1797  setting->addChild(profile);
1798  }
1799  continue;
1800  }
1801 
1802  auto *profile = new RecordingProfile(name);
1803  profile->loadByID(id.toInt());
1804  profile->setCodecTypes();
1805  setting->addChild(profile);
1806  }
1807  while (result.next());
1808 }
1809 
1811 {
1812  QMap<int, QString> profiles;
1813 
1814  if (!group)
1815  {
1816  for (uint i = 0; !kAvailProfiles[i].isEmpty(); i++)
1817  profiles[i] = kAvailProfiles[i];
1818  return profiles;
1819  }
1820 
1822  query.prepare(
1823  "SELECT name, id "
1824  "FROM recordingprofiles "
1825  "WHERE profilegroup = :GROUPID "
1826  "ORDER BY id");
1827  query.bindValue(":GROUPID", group);
1828 
1829  if (!query.exec())
1830  {
1831  MythDB::DBError("RecordingProfile::GetProfileMap()", query);
1832  return profiles;
1833  }
1834  if (!query.next())
1835  {
1836  LOG(VB_GENERAL, LOG_WARNING,
1837  "RecordingProfile::fillselections, Warning: "
1838  "Failed to locate recording id for recording group.");
1839  return profiles;
1840  }
1841 
1842  if (group == RecordingProfile::TranscoderGroup)
1843  {
1845  profiles[id] = QObject::tr("Transcode using Autodetect");
1846  }
1847 
1848  do
1849  {
1850  QString name = query.value(0).toString();
1851  int id = query.value(1).toInt();
1852 
1853  if (group == RecordingProfile::TranscoderGroup)
1854  {
1855  /* RTjpeg/MPEG4 and MPEG2 are used by "Autodetect". */
1856  if (name != "RTjpeg/MPEG4" && name != "MPEG2")
1857  {
1858  QString lbl = QObject::tr("Transcode using \"%1\"").arg(name);
1859  profiles[id] = lbl;
1860  }
1861  continue;
1862  }
1863 
1864  QString lbl = QObject::tr("Record using the \"%1\" profile").arg(name);
1865  profiles[id] = lbl;
1866  } while (query.next());
1867 
1868  return profiles;
1869 }
1870 
1872 {
1874 }
1875 
1876 QString RecordingProfile::groupType(void) const
1877 {
1878  MSqlQuery result(MSqlQuery::InitCon());
1879  result.prepare(
1880  "SELECT profilegroups.cardtype "
1881  "FROM profilegroups, recordingprofiles "
1882  "WHERE profilegroups.id = recordingprofiles.profilegroup AND "
1883  " recordingprofiles.id = :ID");
1884  result.bindValue(":ID", getProfileNum());
1885 
1886  if (!result.exec())
1887  MythDB::DBError("RecordingProfile::groupType", result);
1888  else if (result.next())
1889  return result.value(0).toString();
1890 
1891  return QString();
1892 }
1893 
1895 {
1896  MSqlQuery result(MSqlQuery::InitCon());
1897  result.prepare(
1898  "SELECT name "
1899  "FROM recordingprofiles "
1900  "WHERE id = :ID");
1901 
1902  result.bindValue(":ID", id);
1903 
1904  if (!result.exec())
1905  MythDB::DBError("RecordingProfile::getName", result);
1906  else if (result.next())
1907  return result.value(0).toString();
1908 
1909  return QString();
1910 }
1911 
1913 {
1914  return true;
1915 }
1916 
1918 {
1919  MSqlQuery result(MSqlQuery::InitCon());
1920  result.prepare(
1921  "DELETE "
1922  "FROM recordingprofiles "
1923  "WHERE id = :ID");
1924 
1925  result.bindValue(":ID", m_id->getValue());
1926 
1927  if (!result.exec())
1928  MythDB::DBError("RecordingProfile::deleteEntry", result);
1929 
1930 }
1931 
1932 
1933 /* vim: set expandtab tabstop=4 shiftwidth=4: */
RecordingProfile::m_isEncoder
bool m_isEncoder
Definition: recordingprofile.h:147
MPEG2audType::m_allowLayer2
bool m_allowLayer2
Definition: recordingprofile.cpp:232
ImageSize::Width
Definition: recordingprofile.cpp:1287
MSqlBindings
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
Definition: mythdbcon.h:98
TranscodeLossless::TranscodeLossless
TranscodeLossless(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1209
MPEG2AudioBitrateSettings::MPEG2AudioBitrateSettings
MPEG2AudioBitrateSettings(const RecordingProfile &parent, bool layer1, bool layer2, bool layer3, uint default_layer)
Definition: recordingprofile.cpp:337
SampleRate::m_allowedRate
QMap< uint, bool > m_allowedRate
Definition: recordingprofile.cpp:168
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
HardwareMJPEGVDecimation::HardwareMJPEGVDecimation
HardwareMJPEGVDecimation(const RecordingProfile &parent)
Definition: recordingprofile.cpp:883
MythUIComboBoxSetting::clearSelections
void clearSelections()
Definition: standardsettings.cpp:494
RecordingProfile::m_profileName
QString m_profileName
Definition: recordingprofile.h:146
EncodingThreadCount
Definition: recordingprofile.cpp:743
StandardSetting::setName
virtual void setName(const QString &name)
Definition: standardsettings.cpp:247
kAvailProfiles
const std::array< QString, 4 > kAvailProfiles
Definition: recordingprofile.h:9
MPEG2audBitrateL2::MPEG2audBitrateL2
MPEG2audBitrateL2(const RecordingProfile &parent)
Definition: recordingprofile.cpp:267
RecordFullTSStream::RecordFullTSStream
RecordFullTSStream(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1249
StandardSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
RecordingProfile::m_audioSettings
AudioCompressionSettings * m_audioSettings
Definition: recordingprofile.h:145
MPEG2audBitrateL3::MPEG2audBitrateL3
MPEG2audBitrateL3(const RecordingProfile &parent)
Definition: recordingprofile.cpp:295
DriverOption::Options
QMap< category_t, DriverOption > Options
Definition: driveroption.h:20
mythdb.h
MPEG4MinQuality::MPEG4MinQuality
MPEG4MinQuality(const RecordingProfile &parent)
Definition: recordingprofile.cpp:638
CardUtil::GetVideoDevices
static QStringList GetVideoDevices(const QString &rawtype, QString hostname=QString())
Returns the videodevices of the matching inputs, duplicates removed.
Definition: cardutil.cpp:404
AudioCompressionSettings
Definition: recordingprofile.cpp:399
RecordingProfile::RecProfileGroup
RecProfileGroup
Definition: recordingprofile.h:106
TranscodeLossless
Definition: recordingprofile.cpp:1207
DBStorage::m_user
StorageUser * m_user
Definition: mythstorage.h:50
MythUICheckBoxSetting::setValue
virtual void setValue(const QString &newValue)
Definition: standardsettings.cpp:163
DriverOption::VIDEO_ENCODING
@ VIDEO_ENCODING
Definition: driveroption.h:9
TranscodeResize
Definition: recordingprofile.cpp:1193
HardwareMJPEGQuality
Definition: recordingprofile.cpp:852
V4L2util::DriverName
QString DriverName(void) const
Definition: v4l2util.h:48
VideoCompressionSettings::m_parent
const RecordingProfile & m_parent
Definition: recordingprofile.cpp:1172
AudioCodecName::AudioCodecName
AudioCodecName(const RecordingProfile &parent)
Definition: recordingprofile.cpp:72
MPEG2audType::Load
void Load(void) override
Definition: recordingprofile.cpp:199
MPEG2Language::MPEG2Language
MPEG2Language(const RecordingProfile &parent)
Definition: recordingprofile.cpp:363
ButtonStandardSetting
Definition: standardsettings.h:448
RecordingProfile::m_id
ID * m_id
Definition: recordingprofile.h:138
RecordingProfile::m_trFilters
TranscodeFilters * m_trFilters
Definition: recordingprofile.h:143
RecordingProfileEditor::ShowNewProfileDialog
void ShowNewProfileDialog() const
Definition: recordingprofile.cpp:1673
RecordingProfile::loadByGroup
virtual bool loadByGroup(const QString &name, const QString &group)
Definition: recordingprofile.cpp:1545
SampleRate::addSelection
void addSelection(const QString &label, const QString &value=QString(), bool select=false)
Definition: recordingprofile.cpp:149
PeakBitrate
Definition: recordingprofile.cpp:782
TranscodeResize::TranscodeResize
TranscodeResize(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1195
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
MythScreenStack
Definition: mythscreenstack.h:16
RecordingProfile::GetTranscodingProfiles
static QMap< int, QString > GetTranscodingProfiles()
Definition: recordingprofile.cpp:1871
arg
arg(title).arg(filename).arg(doDelete))
CodecParamStorage::GetWhereClause
QString GetWhereClause(MSqlBindings &bindings) const override
Definition: recordingprofile.cpp:56
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
RecordingProfileStorage::m_parent
const RecordingProfile & m_parent
Definition: recordingprofile.h:31
AverageBitrate::AverageBitrate
AverageBitrate(const RecordingProfile &parent, const QString &setting="mpeg2bitrate", uint min_br=1000, uint max_br=16000, uint default_br=4500, uint increment=100, QString label=QString())
Definition: recordingprofile.cpp:763
MPEG4bitrate::MPEG4bitrate
MPEG4bitrate(const RecordingProfile &parent)
Definition: recordingprofile.cpp:609
StandardSetting::clearSettings
virtual void clearSettings()
Definition: standardsettings.cpp:153
RecordingProfile::loadByID
virtual void loadByID(int id)
Definition: recordingprofile.cpp:1449
StorageUser::GetDBValue
virtual QString GetDBValue(void) const =0
RecordingProfile::setCodecTypes
void setCodecTypes()
Definition: recordingprofile.cpp:1648
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
RecordingProfile::~RecordingProfile
~RecordingProfile(void) override
Definition: recordingprofile.cpp:1423
RecordingProfileStorage::GetWhereClause
QString GetWhereClause(MSqlBindings &bindings) const override
Definition: recordingprofile.cpp:11
HardwareMJPEGQuality::HardwareMJPEGQuality
HardwareMJPEGQuality(const RecordingProfile &parent)
Definition: recordingprofile.cpp:854
StandardSetting::addTargetedChild
void addTargetedChild(const QString &value, StandardSetting *setting)
Definition: standardsettings.cpp:110
RecordingProfile::getName
QString getName(void) const
Definition: recordingprofile.h:98
RecordingProfile::deleteEntry
void deleteEntry(void) override
Definition: recordingprofile.cpp:1917
SampleRate::SampleRate
SampleRate(const RecordingProfile &parent, bool analog=true)
Definition: recordingprofile.cpp:112
SampleRate
Definition: recordingprofile.cpp:110
GroupSetting::GroupSetting
GroupSetting()=default
SimpleDBStorage
Definition: mythstorage.h:56
MP3Quality
Definition: recordingprofile.cpp:82
AudioCompressionSettings::m_codecName
AudioCodecName * m_codecName
Definition: recordingprofile.cpp:551
MythTextInputDialog::haveResult
void haveResult(QString)
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:326
DriverOption::VIDEO_BITRATE_PEAK
@ VIDEO_BITRATE_PEAK
Definition: driveroption.h:11
ButtonStandardSetting::clicked
void clicked()
RecordingProfile::m_videoSettings
VideoCompressionSettings * m_videoSettings
Definition: recordingprofile.h:144
MPEG4MinQuality
Definition: recordingprofile.cpp:636
ScaleBitrate::ScaleBitrate
ScaleBitrate(const RecordingProfile &parent)
Definition: recordingprofile.cpp:623
StandardSetting::settingsChanged
void settingsChanged(StandardSetting *selectedSetting=nullptr)
StandardSetting::addChild
virtual void addChild(StandardSetting *child)
Definition: standardsettings.cpp:64
AverageBitrate
Definition: recordingprofile.cpp:761
MPEG2streamType::MPEG2streamType
MPEG2streamType(const RecordingProfile &parent, uint minopt=0, uint maxopt=8, uint defopt=0)
Definition: recordingprofile.cpp:804
BTTVVolume::BTTVVolume
BTTVVolume(const RecordingProfile &parent)
Definition: recordingprofile.cpp:99
RecordingProfile::RecordingProfile
RecordingProfile(const QString &profName=QString())
Definition: recordingprofile.cpp:1382
MPEG2audBitrateL1
Definition: recordingprofile.cpp:237
mythlogging.h
RecordingTypeStream
Definition: recordingprofile.cpp:1225
DriverOption::AUDIO_SAMPLERATE
@ AUDIO_SAMPLERATE
Definition: driveroption.h:12
MPEG2streamType
Definition: recordingprofile.cpp:802
MPEG2Language
Definition: recordingprofile.cpp:361
MPEG4bitrate
Definition: recordingprofile.cpp:607
hardwareprofile.scan.profile
profile
Definition: scan.py:99
MythUIComboBoxSetting
Definition: standardsettings.h:216
AudioCodecName
Definition: recordingprofile.cpp:70
RecordingProfile::m_v4l2util
V4L2util * m_v4l2util
Definition: recordingprofile.h:149
CardUtil::IsEncoder
static bool IsEncoder(const QString &rawtype)
Definition: cardutil.h:129
MPEG2audVolume
Definition: recordingprofile.cpp:321
V4L2util::UserAdjustableResolution
bool UserAdjustableResolution(void) const
Definition: v4l2util.cpp:711
SampleRate::m_rates
std::vector< uint > m_rates
Definition: recordingprofile.cpp:167
MPEG2audBitrateL3
Definition: recordingprofile.cpp:293
TranscodeFilters
Definition: recordingprofile.cpp:1268
RTjpegChromaFilter
Definition: recordingprofile.cpp:594
v4l2util.h
RecordingProfile::groupType
QString groupType(void) const
Definition: recordingprofile.cpp:1876
MPEG2audType::MPEG2audType
MPEG2audType(const RecordingProfile &parent, bool layer1, bool layer2, bool layer3)
Definition: recordingprofile.cpp:174
RecordingProfileEditor::m_group
int m_group
Definition: recordingprofile.h:168
MPEG4MaxQuality
Definition: recordingprofile.cpp:650
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
RecordingProfile::m_trLossless
TranscodeLossless * m_trLossless
Definition: recordingprofile.h:142
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:178
RecordingProfile::m_trResize
TranscodeResize * m_trResize
Definition: recordingprofile.h:141
StandardSetting::Load
virtual void Load(void)
Definition: standardsettings.cpp:208
CodecParamStorage::CodecParamStorage
CodecParamStorage(StandardSetting *_setting, const RecordingProfile &parentProfile, const QString &name)
Definition: recordingprofile.cpp:24
MPEG2AudioBitrateSettings
Definition: recordingprofile.cpp:335
VideoCompressionSettings::m_v4l2codecs
QStringList m_v4l2codecs
Definition: recordingprofile.cpp:1174
VideoCompressionSettings
Definition: recordingprofile.cpp:895
AudioCompressionSettings::AudioCompressionSettings
AudioCompressionSettings(const RecordingProfile &parentProfile, V4L2util *v4l2)
Definition: recordingprofile.cpp:401
RTjpegLumaFilter
Definition: recordingprofile.cpp:581
StandardSetting::setHelpText
virtual void setHelpText(const QString &str)
Definition: standardsettings.h:37
RecordingProfileEditor::Load
void Load(void) override
Definition: recordingprofile.cpp:1663
MPEG4OptionIDCT::MPEG4OptionIDCT
MPEG4OptionIDCT(const RecordingProfile &parent)
Definition: recordingprofile.cpp:681
RecordingProfile::m_name
Name * m_name
Definition: recordingprofile.h:139
MythUIComboBoxSetting::getValueIndex
int getValueIndex(const QString &value) const
Definition: standardsettings.cpp:468
RecordingProfile::kTranscoderAutodetect
static const uint kTranscoderAutodetect
sentinel value
Definition: recordingprofile.h:130
MPEG4OptionIME::MPEG4OptionIME
MPEG4OptionIME(const RecordingProfile &parent)
Definition: recordingprofile.cpp:697
SampleRate::Load
void Load(void) override
Definition: recordingprofile.cpp:130
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:51
AutoTranscode
Definition: recordingprofile.cpp:1178
MPEG2aspectRatio
Definition: recordingprofile.cpp:828
MPEG4OptionVHQ::MPEG4OptionVHQ
MPEG4OptionVHQ(const RecordingProfile &parent)
Definition: recordingprofile.cpp:713
RecordingProfileEditor::CreateNewProfile
void CreateNewProfile(const QString &profName)
Definition: recordingprofile.cpp:1691
TranscodeFilters::TranscodeFilters
TranscodeFilters(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1270
CodecParamStorage::GetSetClause
QString GetSetClause(MSqlBindings &bindings) const override
Definition: recordingprofile.cpp:40
uint
unsigned int uint
Definition: compat.h:140
MPEG4MaxQuality::MPEG4MaxQuality
MPEG4MaxQuality(const RecordingProfile &parent)
Definition: recordingprofile.cpp:652
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
MPEG2audBitrateL1::MPEG2audBitrateL1
MPEG2audBitrateL1(const RecordingProfile &parent)
Definition: recordingprofile.cpp:239
RecordingProfile::ResizeTranscode
void ResizeTranscode(const QString &val)
Definition: recordingprofile.cpp:1431
MPEG4OptionIME
Definition: recordingprofile.cpp:695
MPEG2audType
Definition: recordingprofile.cpp:172
AutoTranscode::AutoTranscode
AutoTranscode(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1180
MPEG2audBitrateL2
Definition: recordingprofile.cpp:265
RTjpegLumaFilter::RTjpegLumaFilter
RTjpegLumaFilter(const RecordingProfile &parent)
Definition: recordingprofile.cpp:583
StandardSetting::setLabel
virtual void setLabel(QString str)
Definition: standardsettings.h:34
StandardSetting::valueChanged
void valueChanged(const QString &newValue)
MPEG4Option4MV
Definition: recordingprofile.cpp:726
RecordingProfile::Name
Definition: recordingprofile.h:52
RecordingProfile::getProfileNum
int getProfileNum(void) const
Definition: recordingprofile.h:97
MPEG4Option4MV::MPEG4Option4MV
MPEG4Option4MV(const RecordingProfile &parent)
Definition: recordingprofile.cpp:728
DriverOption::STREAM_TYPE
@ STREAM_TYPE
Definition: driveroption.h:9
V4L2util::IsOpen
bool IsOpen(void) const
Definition: v4l2util.h:29
StandardSetting::setEnabled
virtual void setEnabled(bool enabled)
Definition: standardsettings.cpp:47
AudioCompressionSettings::selectCodecs
void selectCodecs(const QString &groupType)
Definition: recordingprofile.cpp:519
MythUIComboBoxSetting::addSelection
void addSelection(const QString &label, QString value=QString(), bool select=false)
Definition: standardsettings.cpp:479
RecordingProfileEditor::m_labelName
QString m_labelName
Definition: recordingprofile.h:169
RecordingProfile::CompleteLoad
virtual void CompleteLoad(int profileId, const QString &type, const QString &name)
Definition: recordingprofile.cpp:1575
BTTVVolume
Definition: recordingprofile.cpp:97
MythUITextEditSetting
Definition: standardsettings.h:144
ImageSize::Width::Width
Width(const RecordingProfile &parent, uint defaultwidth, uint maxwidth, bool transcoding=false)
Definition: recordingprofile.cpp:1289
V4L2util
Definition: v4l2util.h:17
AudioCompressionSettings::m_v4l2codecs
QStringList m_v4l2codecs
Definition: recordingprofile.cpp:552
DriverOption::AUDIO_LANGUAGE
@ AUDIO_LANGUAGE
Definition: driveroption.h:13
MPEG2audVolume::MPEG2audVolume
MPEG2audVolume(const RecordingProfile &parent)
Definition: recordingprofile.cpp:323
mythcorecontext.h
cardutil.h
ImageSize
Definition: recordingprofile.cpp:1284
MPEG4OptionVHQ
Definition: recordingprofile.cpp:711
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
VideoCodecName::VideoCodecName
VideoCodecName(const RecordingProfile &parent)
Definition: recordingprofile.cpp:558
MPEG2aspectRatio::MPEG2aspectRatio
MPEG2aspectRatio(const RecordingProfile &parent, uint minopt=0, uint maxopt=8, uint defopt=0)
Definition: recordingprofile.cpp:830
MPEG4OptionIDCT
Definition: recordingprofile.cpp:679
VideoCodecName
Definition: recordingprofile.cpp:556
RecordingProfile::loadByType
virtual bool loadByType(const QString &name, const QString &cardtype, const QString &videodev)
Definition: recordingprofile.cpp:1488
BitrateMode
Definition: recordingprofile.cpp:382
V4L2util::GetOptions
bool GetOptions(DriverOption::Options &options)
Definition: v4l2util.cpp:540
EncodingThreadCount::EncodingThreadCount
EncodingThreadCount(const RecordingProfile &parent)
Definition: recordingprofile.cpp:745
RecordingProfile::m_imageSize
ImageSize * m_imageSize
Definition: recordingprofile.h:140
HardwareMJPEGHDecimation::HardwareMJPEGHDecimation
HardwareMJPEGHDecimation(const RecordingProfile &parent)
Definition: recordingprofile.cpp:867
VideoCompressionSettings::m_codecName
VideoCodecName * m_codecName
Definition: recordingprofile.cpp:1173
CodecParamStorage::m_codecName
QString m_codecName
Definition: recordingprofile.cpp:37
MythUISpinBoxSetting
Definition: standardsettings.h:326
VideoCompressionSettings::selectCodecs
void selectCodecs(const QString &groupType)
Definition: recordingprofile.cpp:1135
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:105
DriverOption::VIDEO_ASPECT
@ VIDEO_ASPECT
Definition: driveroption.h:9
DriverOption::AUDIO_ENCODING
@ AUDIO_ENCODING
Definition: driveroption.h:12
DriverOption::VIDEO_BITRATE_MODE
@ VIDEO_BITRATE_MODE
Definition: driveroption.h:11
CardUtil::IsTunerSharingCapable
static bool IsTunerSharingCapable(const QString &rawtype)
Definition: cardutil.h:171
build_compdb.help
help
Definition: build_compdb.py:10
MPEG4QualDiff::MPEG4QualDiff
MPEG4QualDiff(const RecordingProfile &parent)
Definition: recordingprofile.cpp:666
VideoCompressionSettings::VideoCompressionSettings
VideoCompressionSettings(const RecordingProfile &parentProfile, V4L2util *v4l2)
Definition: recordingprofile.cpp:897
RecordingProfile::ID
Definition: recordingprofile.h:43
V4L2util::ProfileName
QString ProfileName(void) const
Definition: v4l2util.h:50
SimpleDBStorage::Load
void Load(void) override
Definition: mythstorage.cpp:9
RTjpegQuality::RTjpegQuality
RTjpegQuality(const RecordingProfile &parent)
Definition: recordingprofile.cpp:570
RecordingProfile::FiltersChanged
void FiltersChanged(const QString &val)
Definition: recordingprofile.cpp:1474
StandardSetting
Definition: standardsettings.h:30
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:855
recordingprofile.h
RecordingTypeStream::RecordingTypeStream
RecordingTypeStream(const RecordingProfile &parent)
Definition: recordingprofile.cpp:1227
RecordingProfile::GetProfiles
static QMap< int, QString > GetProfiles(RecProfileGroup group=AllGroups)
Definition: recordingprofile.cpp:1810
RecordingProfile
Definition: recordingprofile.h:40
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
HardwareMJPEGVDecimation
Definition: recordingprofile.cpp:881
MythUICheckBoxSetting
Definition: standardsettings.h:388
CodecParamStorage::m_parent
const RecordingProfile & m_parent
Definition: recordingprofile.cpp:36
DriverOption::VOLUME
@ VOLUME
Definition: driveroption.h:13
HardwareMJPEGHDecimation
Definition: recordingprofile.cpp:865
BitrateMode::BitrateMode
BitrateMode(const RecordingProfile &parent, const QString &setting="mpeg2bitratemode")
Definition: recordingprofile.cpp:384
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:264
AudioCompressionSettings::m_parent
const RecordingProfile & m_parent
Definition: recordingprofile.cpp:550
RTjpegChromaFilter::RTjpegChromaFilter
RTjpegChromaFilter(const RecordingProfile &parent)
Definition: recordingprofile.cpp:596
MPEG2audType::m_allowLayer1
bool m_allowLayer1
Definition: recordingprofile.cpp:231
RecordingProfile::TranscoderGroup
@ TranscoderGroup
Definition: recordingprofile.h:113
DriverOption::AUDIO_BITRATE
@ AUDIO_BITRATE
Definition: driveroption.h:13
PeakBitrate::PeakBitrate
PeakBitrate(const RecordingProfile &parent, const QString &setting="mpeg2maxbitrate", uint min_br=1000, uint max_br=16000, uint default_br=6000, uint increment=100, QString label=QString())
Definition: recordingprofile.cpp:784
MythUICheckBoxSetting::setValue
void setValue(const QString &newValue) override
Definition: standardsettings.cpp:695
RecordingProfileEditor::RecordingProfileEditor
RecordingProfileEditor(int id, QString profName)
Definition: recordingprofile.cpp:1656
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
RecordingProfileStorage
Definition: recordingprofile.h:18
query
MSqlQuery query(MSqlQuery::InitCon())
build_compdb.options
options
Definition: build_compdb.py:11
RecordingProfile::fillSelections
static void fillSelections(GroupSetting *setting, int group, bool foldautodetect=false)
Definition: recordingprofile.cpp:1734
ScaleBitrate
Definition: recordingprofile.cpp:621
MP3Quality::MP3Quality
MP3Quality(const RecordingProfile &parent)
Definition: recordingprofile.cpp:84
MythUIComboBoxSetting::setValue
void setValue(int value) override
Definition: standardsettings.cpp:459
DriverOption::AUDIO_BITRATE_MODE
@ AUDIO_BITRATE_MODE
Definition: driveroption.h:12
ImageSize::Height::Height
Height(const RecordingProfile &parent, uint defaultheight, uint maxheight, bool transcoding=false)
Definition: recordingprofile.cpp:1316
RecordingProfile::canDelete
bool canDelete(void) override
Definition: recordingprofile.cpp:1912
DriverOption::VIDEO_BITRATE
@ VIDEO_BITRATE
Definition: driveroption.h:11
MPEG2audType::m_allowLayer3
bool m_allowLayer3
Definition: recordingprofile.cpp:233
RecordingProfile::SetLosslessTranscode
void SetLosslessTranscode(const QString &val)
Definition: recordingprofile.cpp:1437
RTjpegQuality
Definition: recordingprofile.cpp:568
ImageSize::Height
Definition: recordingprofile.cpp:1314
ImageSize::ImageSize
ImageSize(const RecordingProfile &parent, const QString &tvFormat, const QString &profName)
Definition: recordingprofile.cpp:1340
RecordFullTSStream
Definition: recordingprofile.cpp:1247
GroupSetting
Definition: standardsettings.h:433
MPEG4QualDiff
Definition: recordingprofile.cpp:664
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:915
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
CodecParamStorage
Definition: recordingprofile.cpp:22
MythUICheckBoxSetting::boolValue
bool boolValue()
Definition: standardsettings.h:398