MythTV  master
recorderbase.cpp
Go to the documentation of this file.
1 #include <algorithm> // for min
2 #include <cstdint>
3 
4 #include "firewirerecorder.h"
5 #include "recordingprofile.h"
6 #include "firewirechannel.h"
7 #include "importrecorder.h"
8 #include "cetonrecorder.h"
9 #include "dummychannel.h"
10 #include "hdhrrecorder.h"
11 #include "iptvrecorder.h"
12 #include "mpegrecorder.h"
13 #include "recorderbase.h"
14 #include "cetonchannel.h"
15 #include "asirecorder.h"
16 #include "dvbrecorder.h"
17 #include "ExternalRecorder.h"
18 #include "hdhrchannel.h"
19 #include "iptvchannel.h"
20 #include "mythsystemevent.h"
21 #include "mythlogging.h"
22 #include "programinfo.h"
23 #include "asichannel.h"
24 #include "dtvchannel.h"
25 #include "dvbchannel.h"
26 #include "satipchannel.h"
27 #include "satiprecorder.h"
28 #include "ExternalChannel.h"
29 #include "io/mythmediabuffer.h"
30 #include "cardutil.h"
31 #include "tv_rec.h"
32 #include "mythdate.h"
33 #if CONFIG_LIBMP3LAME
34 #include "NuppelVideoRecorder.h"
35 #endif
36 #if CONFIG_V4L2
37 #include "v4l2encrecorder.h"
38 #include "v4lchannel.h"
39 #endif
40 
41 #define TVREC_CARDNUM \
42  ((m_tvrec != nullptr) ? QString::number(m_tvrec->GetInputId()) : "NULL")
43 
44 #define LOC QString("RecBase[%1](%2): ") \
45  .arg(TVREC_CARDNUM).arg(m_videodevice)
46 
48  : m_tvrec(rec)
49 {
51 }
52 
54 {
56  {
57  delete m_ringBuffer;
58  m_ringBuffer = nullptr;
59  }
60  SetRecording(nullptr);
61  if (m_nextRingBuffer)
62  {
63  QMutexLocker locker(&m_nextRingBufferLock);
64  delete m_nextRingBuffer;
65  m_nextRingBuffer = nullptr;
66  }
67  if (m_nextRecording)
68  {
69  delete m_nextRecording;
70  m_nextRecording = nullptr;
71  }
72 }
73 
75 {
76  if (VERBOSE_LEVEL_CHECK(VB_RECORD, LOG_INFO))
77  {
78  QString msg("");
79  if (Buffer)
80  msg = " '" + Buffer->GetFilename() + "'";
81  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetRingBuffer(0x%1)")
82  .arg((uint64_t)Buffer,0,16) + msg);
83  }
85  m_weMadeBuffer = false;
86 }
87 
89 {
90  if (pginfo)
91  {
92  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetRecording(0x%1) title(%2)")
93  .arg((uint64_t)pginfo,0,16).arg(pginfo->GetTitle()));
94  }
95  else
96  {
97  LOG(VB_RECORD, LOG_INFO, LOC + "SetRecording(0x0)");
98  }
99 
100  ProgramInfo *oldrec = m_curRecording;
101  if (pginfo)
102  {
103  // NOTE: RecorderBase and TVRec do not share a single RecordingInfo
104  // instance which may lead to the possibility that changes made
105  // in the database by one are overwritten by the other
106  m_curRecording = new RecordingInfo(*pginfo);
107  // Compute an estimate of the actual progstart delay for setting the
108  // MARK_UTIL_PROGSTART mark. We can't reliably use
109  // m_curRecording->GetRecordingStartTime() because the scheduler rounds it
110  // to the nearest minute, so we use the current time instead.
115  recFile->Save();
116  }
117  else
118  m_curRecording = nullptr;
119 
120  delete oldrec;
121 }
122 
124 {
125  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetNextRecording(0x%1, 0x%2)")
126  .arg(reinterpret_cast<intptr_t>(ri),0,16)
127  .arg(reinterpret_cast<intptr_t>(Buffer),0,16));
128 
129  // First we do some of the time consuming stuff we can do now
130  SavePositionMap(true);
131  if (m_ringBuffer)
132  {
134  if (m_curRecording)
136  }
137 
138  // Then we set the next info
139  QMutexLocker locker(&m_nextRingBufferLock);
140  if (m_nextRecording)
141  {
142  delete m_nextRecording;
143  m_nextRecording = nullptr;
144  }
145  if (ri)
146  m_nextRecording = new RecordingInfo(*ri);
147 
148  delete m_nextRingBuffer;
150 }
151 
152 void RecorderBase::SetOption(const QString &name, const QString &value)
153 {
154  if (name == "videocodec")
155  m_videocodec = value;
156  else if (name == "videodevice")
157  m_videodevice = value;
158  else if (name == "tvformat")
159  {
160  m_ntsc = false;
161  if (value.toLower() == "ntsc" || value.toLower() == "ntsc-jp")
162  { // NOLINT(bugprone-branch-clone)
163  m_ntsc = true;
164  SetFrameRate(29.97);
165  }
166  else if (value.toLower() == "pal-m")
167  SetFrameRate(29.97);
168  else if (value.toLower() == "atsc")
169  {
170  // Here we set the TV format values for ATSC. ATSC isn't really
171  // NTSC, but users who configure a non-ATSC-recorder as ATSC
172  // are far more likely to be using a mix of ATSC and NTSC than
173  // a mix of ATSC and PAL or SECAM. The atsc recorder itself
174  // does not care about these values, except in so much as tv_rec
175  // cares about m_videoFrameRate which should be neither 29.97
176  // nor 25.0, but based on the actual video.
177  m_ntsc = true;
178  SetFrameRate(29.97);
179  }
180  else
181  SetFrameRate(25.00);
182  }
183  else
184  {
185  LOG(VB_GENERAL, LOG_WARNING, LOC +
186  QString("SetOption(%1,%2): Option not recognized")
187  .arg(name).arg(value));
188  }
189 }
190 
191 void RecorderBase::SetOption(const QString &name, int value)
192 {
193  LOG(VB_GENERAL, LOG_ERR, LOC +
194  QString("SetOption(): Unknown int option: %1: %2")
195  .arg(name).arg(value));
196 }
197 
199 {
200  const StandardSetting *setting = profile->byName(name);
201  if (setting)
202  SetOption(name, setting->getValue().toInt());
203  else
204  LOG(VB_GENERAL, LOG_ERR, LOC +
205  QString("SetIntOption(...%1): Option not in profile.").arg(name));
206 }
207 
209 {
210  const StandardSetting *setting = profile->byName(name);
211  if (setting)
212  SetOption(name, setting->getValue());
213  else
214  LOG(VB_GENERAL, LOG_ERR, LOC +
215  QString("SetStrOption(...%1): Option not in profile.").arg(name));
216 }
217 
224 {
225  QMutexLocker locker(&m_pauseLock);
226  m_requestRecording = false;
227  m_unpauseWait.wakeAll();
228  while (m_recording)
229  {
230  m_recordingWait.wait(&m_pauseLock, 100);
231  if (m_requestRecording)
232  {
233  LOG(VB_GENERAL, LOG_ERR, LOC +
234  "Programmer Error: Recorder started while we were in "
235  "StopRecording");
236  m_requestRecording = false;
237  }
238  }
239 }
240 
243 {
244  QMutexLocker locker(&m_pauseLock);
245  return m_recording;
246 }
247 
250 {
251  QMutexLocker locker(&m_pauseLock);
252  return m_requestRecording;
253 }
254 
263 {
264  (void) clear;
265  QMutexLocker locker(&m_pauseLock);
266  m_requestPause = true;
267 }
268 
274 {
275  QMutexLocker locker(&m_pauseLock);
276  m_requestPause = false;
277  m_unpauseWait.wakeAll();
278 }
279 
281 bool RecorderBase::IsPaused(bool holding_lock) const
282 {
283  if (!holding_lock)
284  m_pauseLock.lock();
285  bool ret = m_paused;
286  if (!holding_lock)
287  m_pauseLock.unlock();
288  return ret;
289 }
290 
298 bool RecorderBase::WaitForPause(std::chrono::milliseconds timeout)
299 {
300  MythTimer t;
301  t.start();
302 
303  QMutexLocker locker(&m_pauseLock);
304  while (!IsPaused(true) && m_requestPause)
305  {
306  std::chrono::milliseconds wait = timeout - t.elapsed();
307  if (wait <= 0ms)
308  return false;
309  m_pauseWait.wait(&m_pauseLock, wait.count());
310  }
311  return true;
312 }
313 
326 bool RecorderBase::PauseAndWait(std::chrono::milliseconds timeout)
327 {
328  QMutexLocker locker(&m_pauseLock);
329  if (m_requestPause)
330  {
331  if (!IsPaused(true))
332  {
333  m_paused = true;
334  m_pauseWait.wakeAll();
335  if (m_tvrec)
337  }
338 
339  m_unpauseWait.wait(&m_pauseLock, timeout.count());
340  }
341 
342  if (!m_requestPause && IsPaused(true))
343  {
344  m_paused = false;
345  m_unpauseWait.wakeAll();
346  }
347 
348  return IsPaused(true);
349 }
350 
352 {
353  bool did_switch = false;
354 
355  m_nextRingBufferLock.lock();
356 
357  RecordingQuality *recq = nullptr;
358 
359  if (m_nextRingBuffer)
360  {
361  FinishRecording();
362 
363  recq = GetRecordingQuality(nullptr);
364 
365  ResetForNewFile();
366 
368  m_frameRate = FrameRate(0);
369 
372 
373  m_nextRingBuffer = nullptr;
374  m_nextRecording = nullptr;
375 
376  StartNewFile();
377  did_switch = true;
378  }
379  m_nextRingBufferLock.unlock();
380 
381  if (recq && m_tvrec)
382  {
383  // This call will free recq.
385  }
386  else
387  {
388  delete recq;
389  }
390 
392  return did_switch;
393 }
394 
396  const QString& file, int line)
397 {
399  {
400  LOG(VB_RECORD, LOG_INFO,
401  QString("Modifying recording status from %1 to %2 at %3:%4")
403  .arg(RecStatus::toString(status, kSingleRecord)).arg(file).arg(line));
404 
406 
407  if (status == RecStatus::Failing)
408  {
409  m_curRecording->SaveVideoProperties(VID_DAMAGED, VID_DAMAGED);
410  SendMythSystemRecEvent("REC_FAILING", m_curRecording);
411  }
412 
413  MythEvent me(QString("UPDATE_RECORDING_STATUS %1 %2 %3 %4 %5")
414  .arg(m_curRecording->GetInputID())
415  .arg(m_curRecording->GetChanID())
417  .arg(status)
419  gCoreContext->dispatch(me);
420  }
421 }
422 
424 {
425  QMutexLocker locker(&m_statisticsLock);
426  m_timeOfFirstData = QDateTime();
427  m_timeOfFirstDataIsSet.fetchAndStoreRelaxed(0);
428  m_timeOfLatestData = QDateTime();
429  m_timeOfLatestDataCount.fetchAndStoreRelaxed(0);
430  m_timeOfLatestDataPacketInterval.fetchAndStoreRelaxed(2000);
431  m_recordingGaps.clear();
432 }
433 
435 {
436  if (m_curRecording)
437  {
438  if (m_primaryVideoCodec == AV_CODEC_ID_H264)
439  m_curRecording->SaveVideoProperties(VID_AVC, VID_AVC);
440  else if (m_primaryVideoCodec == AV_CODEC_ID_H265)
441  m_curRecording->SaveVideoProperties(VID_HEVC, VID_HEVC);
442  else if (m_primaryVideoCodec == AV_CODEC_ID_MPEG2VIDEO)
443  m_curRecording->SaveVideoProperties(VID_MPEG2, VID_MPEG2);
444 
446  if (recFile)
447  {
448  // Container
450 
451  // Video
452  recFile->m_videoCodec = ff_codec_id_string(m_primaryVideoCodec);
454  {
455  case MARK_ASPECT_1_1 :
456  recFile->m_videoAspectRatio = 1.0;
457  break;
458  case MARK_ASPECT_4_3:
459  recFile->m_videoAspectRatio = 1.33333333333;
460  break;
461  case MARK_ASPECT_16_9:
462  recFile->m_videoAspectRatio = 1.77777777777;
463  break;
464  case MARK_ASPECT_2_21_1:
465  recFile->m_videoAspectRatio = 2.21;
466  break;
467  default:
468  recFile->m_videoAspectRatio = (double)m_videoAspect / 1000000.0;
469  break;
470  }
471  QSize resolution(m_curRecording->QueryAverageWidth(),
473  recFile->m_videoResolution = resolution;
474  recFile->m_videoFrameRate = (double)m_curRecording->QueryAverageFrameRate() / 1000.0;
475 
476  // Audio
477  recFile->m_audioCodec = ff_codec_id_string(m_primaryAudioCodec);
478 
479  recFile->Save();
480  }
481  else
482  LOG(VB_GENERAL, LOG_CRIT, "RecordingFile object is NULL. No video file metadata can be stored");
483 
484  SavePositionMap(true, true); // Save Position Map only, not file size
485 
486  if (m_ringBuffer)
488  }
489 
490  LOG(VB_GENERAL, LOG_NOTICE, QString("Finished Recording: "
491  "Container: %7 "
492  "Video Codec: %1 (%2x%3 A/R: %4 %5fps) "
493  "Audio Codec: %6")
494  .arg(avcodec_get_name(m_primaryVideoCodec))
495  .arg(m_videoWidth)
496  .arg(m_videoHeight)
497  .arg(m_videoAspect)
498  .arg(GetFrameRate())
499  .arg(avcodec_get_name(m_primaryAudioCodec))
501 }
502 
504  const RecordingInfo *r) const
505 {
506  QMutexLocker locker(&m_statisticsLock);
507  if (r && m_curRecording &&
509  {
512  }
513  return new RecordingQuality(
516 }
517 
518 long long RecorderBase::GetKeyframePosition(long long desired) const
519 {
520  QMutexLocker locker(&m_positionMapLock);
521  long long ret = -1;
522 
523  if (m_positionMap.empty())
524  return ret;
525 
526  // find closest exact or previous keyframe position...
527  frm_pos_map_t::const_iterator it = m_positionMap.lowerBound(desired);
528  if (it == m_positionMap.end())
529  ret = *m_positionMap.begin();
530  else if ((it.key() == desired) ||
531  (--it != m_positionMap.end()))
532  ret = *it;
533 
534  return ret;
535 }
536 
538  long long start, long long end, frm_pos_map_t &map) const
539 {
540  map.clear();
541 
542  QMutexLocker locker(&m_positionMapLock);
543  if (m_positionMap.empty())
544  return true;
545 
546  frm_pos_map_t::const_iterator it = m_positionMap.lowerBound(start);
547  end = (end < 0) ? INT64_MAX : end;
548  for (; (it != m_positionMap.end()) &&
549  (it.key() <= end); ++it)
550  map[it.key()] = *it;
551 
552  LOG(VB_GENERAL, LOG_DEBUG, LOC +
553  QString("GetKeyframePositions(%1,%2,#%3) out of %4")
554  .arg(start).arg(end).arg(map.size()).arg(m_positionMap.size()));
555 
556  return true;
557 }
558 
560  long long start, long long end, frm_pos_map_t &map) const
561 {
562  map.clear();
563 
564  QMutexLocker locker(&m_positionMapLock);
565  if (m_durationMap.empty())
566  return true;
567 
568  frm_pos_map_t::const_iterator it = m_durationMap.lowerBound(start);
569  end = (end < 0) ? INT64_MAX : end;
570  for (; (it != m_durationMap.end()) &&
571  (it.key() <= end); ++it)
572  map[it.key()] = *it;
573 
574  LOG(VB_GENERAL, LOG_DEBUG, LOC +
575  QString("GetKeyframeDurations(%1,%2,#%3) out of %4")
576  .arg(start).arg(end).arg(map.size()).arg(m_durationMap.size()));
577 
578  return true;
579 }
580 
589 void RecorderBase::SavePositionMap(bool force, bool finished)
590 {
591  bool needToSave = force;
592  m_positionMapLock.lock();
593 
594  bool has_delta = !m_positionMapDelta.empty();
595  // set pm_elapsed to a fake large value if the timer hasn't yet started
596  std::chrono::milliseconds pm_elapsed = (m_positionMapTimer.isRunning()) ?
597  m_positionMapTimer.elapsed() : std::chrono::milliseconds::max();
598  // save on every 1.5 seconds if in the first few frames of a recording
599  needToSave |= (m_positionMap.size() < 30) &&
600  has_delta && (pm_elapsed >= 1.5s);
601  // save every 10 seconds later on
602  needToSave |= has_delta && (pm_elapsed >= 10s);
603  // Assume that m_durationMapDelta is the same size as
604  // m_positionMapDelta and implicitly use the same logic about when
605  // to same m_durationMapDelta.
606 
607  if (m_curRecording && needToSave)
608  {
610  if (has_delta)
611  {
612  // copy the delta map because most times we are called it will be in
613  // another thread and we don't want to lock the main recorder thread
614  // which is populating the delta map
616  m_positionMapDelta.clear();
617  frm_pos_map_t durationDeltaCopy(m_durationMapDelta);
618  m_durationMapDelta.clear();
619  m_positionMapLock.unlock();
620 
622  m_curRecording->SavePositionMapDelta(durationDeltaCopy,
624 
625  TryWriteProgStartMark(durationDeltaCopy);
626  }
627  else
628  {
629  m_positionMapLock.unlock();
630  }
631 
632  if (m_ringBuffer && !finished) // Finished Recording will update the final size for us
633  {
635  }
636  }
637  else
638  {
639  m_positionMapLock.unlock();
640  }
641 
642  // Make sure a ringbuffer switch is checked at least every 3
643  // seconds. Otherwise, this check is only performed on keyframes,
644  // and if there is a problem with the input we may never see one
645  // again, resulting in a wedged recording.
646  if (!finished && m_ringBufferCheckTimer.isRunning() &&
648  {
650  LOG(VB_RECORD, LOG_WARNING, LOC +
651  "Ringbuffer was switched due to timeout instead of keyframe.");
652  }
653 }
654 
656 {
657  // Note: all log strings contain "progstart mark" for searching.
658  if (m_estimatedProgStartMS <= 0)
659  {
660  // Do nothing because no progstart mark is needed.
661  LOG(VB_RECORD, LOG_DEBUG,
662  QString("No progstart mark needed because delta=%1")
663  .arg(m_estimatedProgStartMS));
664  return;
665  }
666  frm_pos_map_t::const_iterator last_it = durationDeltaCopy.end();
667  --last_it;
668  long long bookmarkFrame = 0;
669  LOG(VB_RECORD, LOG_DEBUG,
670  QString("durationDeltaCopy.begin() = (%1,%2)")
671  .arg(durationDeltaCopy.begin().key())
672  .arg(durationDeltaCopy.begin().value()));
673  if (m_estimatedProgStartMS > *last_it)
674  {
675  // Do nothing because we haven't reached recstartts yet.
676  LOG(VB_RECORD, LOG_DEBUG,
677  QString("No progstart mark yet because estimatedProgStartMS=%1 "
678  "and *last_it=%2")
679  .arg(m_estimatedProgStartMS).arg(*last_it));
680  }
682  m_estimatedProgStartMS < *durationDeltaCopy.begin())
683  {
684  // Set progstart mark @ lastSavedKeyframe
685  LOG(VB_RECORD, LOG_DEBUG,
686  QString("Set progstart mark=%1 because %2<=%3<%4")
688  .arg(m_estimatedProgStartMS).arg(*durationDeltaCopy.begin()));
689  bookmarkFrame = m_lastSavedKeyframe;
690  }
691  else if (*durationDeltaCopy.begin() <= m_estimatedProgStartMS &&
692  m_estimatedProgStartMS < *last_it)
693  {
694  frm_pos_map_t::const_iterator upper_it = durationDeltaCopy.begin();
695  for (; upper_it != durationDeltaCopy.end(); ++upper_it)
696  {
697  if (*upper_it > m_estimatedProgStartMS)
698  {
699  --upper_it;
700  // Set progstart mark @ upper_it.key()
701  LOG(VB_RECORD, LOG_DEBUG,
702  QString("Set progstart mark=%1 because "
703  "estimatedProgStartMS=%2 and upper_it.value()=%3")
704  .arg(upper_it.key()).arg(m_estimatedProgStartMS)
705  .arg(upper_it.value()));
706  bookmarkFrame = upper_it.key();
707  break;
708  }
709  }
710  }
711  else
712  {
713  // do nothing
714  LOG(VB_RECORD, LOG_DEBUG, "No progstart mark due to fallthrough");
715  }
716  if (bookmarkFrame)
717  {
718  frm_dir_map_t progStartMap;
719  progStartMap[bookmarkFrame] = MARK_UTIL_PROGSTART;
721  }
722  m_lastSavedKeyframe = last_it.key();
723  m_lastSavedDuration = last_it.value();
724  LOG(VB_RECORD, LOG_DEBUG,
725  QString("Setting lastSavedKeyframe=%1 lastSavedDuration=%2 "
726  "for progstart mark calculations")
728 }
729 
730 void RecorderBase::AspectChange(uint aspect, long long frame)
731 {
733  uint customAspect = 0;
734  if (aspect == ASPECT_1_1 || aspect >= ASPECT_CUSTOM)
735  {
736  if (aspect > 0x0F)
737  customAspect = aspect;
738  else if (m_videoWidth && m_videoHeight)
739  customAspect = m_videoWidth * 1000000 / m_videoHeight;
740 
741  mark = (customAspect) ? MARK_ASPECT_CUSTOM : mark;
742  }
743  if (aspect == ASPECT_4_3)
745  if (aspect == ASPECT_16_9)
747  if (aspect == ASPECT_2_21_1)
749 
750  // Populate the recordfile table as early as possible, the best
751  // value will be determined when the recording completes.
754  {
756  switch (m_videoAspect)
757  {
758  case ASPECT_1_1 :
759  recFile->m_videoAspectRatio = 1.0;
760  break;
761  case ASPECT_4_3:
762  recFile->m_videoAspectRatio = 1.33333333333;
763  break;
764  case ASPECT_16_9:
765  recFile->m_videoAspectRatio = 1.77777777777;
766  break;
767  case ASPECT_2_21_1:
768  recFile->m_videoAspectRatio = 2.21;
769  break;
770  default:
771  recFile->m_videoAspectRatio = (double)m_videoAspect / 1000000.0;
772  break;
773  }
774  recFile->Save();
775  }
776 
777  if (m_curRecording)
778  m_curRecording->SaveAspect(frame, mark, customAspect);
779 }
780 
781 void RecorderBase::ResolutionChange(uint width, uint height, long long frame)
782 {
783  if (m_curRecording)
784  {
785  // Populate the recordfile table as early as possible, the best value
786  // value will be determined when the recording completes.
789  {
790  m_curRecording->GetRecordingFile()->m_videoResolution = QSize(width, height);
792  }
793  m_curRecording->SaveResolution(frame, width, height);
794  }
795 }
796 
797 void RecorderBase::FrameRateChange(uint framerate, uint64_t frame)
798 {
799  if (m_curRecording)
800  {
801  // Populate the recordfile table as early as possible, the average
802  // value will be determined when the recording completes.
804  {
805  m_curRecording->GetRecordingFile()->m_videoFrameRate = (double)framerate / 1000.0;
807  }
808  m_curRecording->SaveFrameRate(frame, framerate);
809  }
810 }
811 
813 {
814  if (m_curRecording)
816 }
817 
818 void RecorderBase::VideoCodecChange(AVCodecID vCodec)
819 {
821  {
822  m_curRecording->GetRecordingFile()->m_videoCodec = ff_codec_id_string(vCodec);
824  }
825 }
826 
827 void RecorderBase::AudioCodecChange(AVCodecID aCodec)
828 {
830  {
831  m_curRecording->GetRecordingFile()->m_audioCodec = ff_codec_id_string(aCodec);
833  }
834 }
835 
836 void RecorderBase::SetDuration(std::chrono::milliseconds duration)
837 {
838  if (m_curRecording)
840 }
841 
842 void RecorderBase::SetTotalFrames(uint64_t total_frames)
843 {
844  if (m_curRecording)
845  m_curRecording->SaveTotalFrames(total_frames);
846 }
847 
848 
850  TVRec *tvrec,
851  ChannelBase *channel,
853  const GeneralDBOptions &genOpt)
854 {
855  if (!channel)
856  return nullptr;
857 
858  RecorderBase *recorder = nullptr;
859  if (genOpt.m_inputType == "MPEG")
860  { // NOLINTNEXTLINE(bugprone-branch-clone)
861 #ifdef USING_IVTV
862  recorder = new MpegRecorder(tvrec);
863 #endif // USING_IVTV
864  }
865 #ifdef USING_HDPVR
866  else if (genOpt.m_inputType == "HDPVR")
867  {
868  recorder = new MpegRecorder(tvrec);
869  }
870 #endif // USING_HDPVR
871 #ifdef USING_V4L2
872  else if (genOpt.m_inputType == "V4L2ENC")
873  {
874  if (dynamic_cast<V4LChannel*>(channel))
875  recorder = new V4L2encRecorder(tvrec, dynamic_cast<V4LChannel*>(channel));
876  }
877 #endif
878 #ifdef USING_FIREWIRE
879  else if (genOpt.m_inputType == "FIREWIRE")
880  {
881  if (dynamic_cast<FirewireChannel*>(channel))
882  recorder = new FirewireRecorder(tvrec, dynamic_cast<FirewireChannel*>(channel));
883  }
884 #endif // USING_FIREWIRE
885 #ifdef USING_HDHOMERUN
886  else if (genOpt.m_inputType == "HDHOMERUN")
887  {
888  if (dynamic_cast<HDHRChannel*>(channel))
889  {
890  recorder = new HDHRRecorder(tvrec, dynamic_cast<HDHRChannel*>(channel));
891  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
892  }
893  }
894 #endif // USING_HDHOMERUN
895 #ifdef USING_CETON
896  else if (genOpt.m_inputType == "CETON")
897  {
898  if (dynamic_cast<CetonChannel*>(channel))
899  {
900  recorder = new CetonRecorder(tvrec, dynamic_cast<CetonChannel*>(channel));
901  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
902  }
903  }
904 #endif // USING_CETON
905 #ifdef USING_DVB
906  else if (genOpt.m_inputType == "DVB")
907  {
908  if (dynamic_cast<DVBChannel*>(channel))
909  {
910  recorder = new DVBRecorder(tvrec, dynamic_cast<DVBChannel*>(channel));
911  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
912  }
913  }
914 #endif // USING_DVB
915 #ifdef USING_IPTV
916  else if (genOpt.m_inputType == "FREEBOX")
917  {
918  if (dynamic_cast<IPTVChannel*>(channel))
919  {
920  recorder = new IPTVRecorder(tvrec, dynamic_cast<IPTVChannel*>(channel));
921  recorder->SetOption("mrl", genOpt.m_videoDev);
922  }
923  }
924 #endif // USING_IPTV
925 #ifdef USING_VBOX
926  else if (genOpt.m_inputType == "VBOX")
927  {
928  if (dynamic_cast<IPTVChannel*>(channel))
929  recorder = new IPTVRecorder(tvrec, dynamic_cast<IPTVChannel*>(channel));
930  }
931 #endif // USING_VBOX
932 #ifdef USING_SATIP
933  else if (genOpt.m_inputType == "SATIP")
934  {
935  if (dynamic_cast<SatIPChannel*>(channel))
936  recorder = new SatIPRecorder(tvrec, dynamic_cast<SatIPChannel*>(channel));
937  }
938 #endif // USING_SATIP
939 #ifdef USING_ASI
940  else if (genOpt.m_inputType == "ASI")
941  {
942  if (dynamic_cast<ASIChannel*>(channel))
943  {
944  recorder = new ASIRecorder(tvrec, dynamic_cast<ASIChannel*>(channel));
945  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
946  }
947  }
948 #endif // USING_ASI
949  else if (genOpt.m_inputType == "IMPORT")
950  {
951  recorder = new ImportRecorder(tvrec);
952  }
953  else if (genOpt.m_inputType == "DEMO")
954  {
955 #ifdef USING_IVTV
956  recorder = new MpegRecorder(tvrec);
957 #else
958  recorder = new ImportRecorder(tvrec);
959 #endif
960  }
961 #if CONFIG_LIBMP3LAME && defined(USING_V4L2)
962  else if (CardUtil::IsV4L(genOpt.m_inputType))
963  {
964  // V4L/MJPEG/GO7007 from here on
965  recorder = new NuppelVideoRecorder(tvrec, channel);
966  recorder->SetBoolOption("skipbtaudio", genOpt.m_skipBtAudio);
967  }
968 #endif // USING_V4L2
969  else if (genOpt.m_inputType == "EXTERNAL")
970  {
971  if (dynamic_cast<ExternalChannel*>(channel))
972  recorder = new ExternalRecorder(tvrec, dynamic_cast<ExternalChannel*>(channel));
973  }
974 
975  if (recorder)
976  {
977  recorder->SetOptionsFromProfile(&profile,
978  genOpt.m_videoDev, genOpt.m_audioDev, genOpt.m_vbiDev);
979  // Override the samplerate defined in the profile if this card
980  // was configured with a fixed rate.
981  if (genOpt.m_audioSampleRate)
982  recorder->SetOption("samplerate", genOpt.m_audioSampleRate);
983  }
984  else
985  {
986  QString msg = "Need %1 recorder, but compiled without %2 support!";
987  msg = msg.arg(genOpt.m_inputType).arg(genOpt.m_inputType);
988  LOG(VB_GENERAL, LOG_ERR,
989  "RecorderBase::CreateRecorder() Error, " + msg);
990  }
991 
992  return recorder;
993 }
994 
995 /* vim: set expandtab tabstop=4 shiftwidth=4: */
GeneralDBOptions
Definition: tv_rec.h:68
RecorderBase::m_positionMapTimer
MythTimer m_positionMapTimer
Definition: recorderbase.h:362
force
bool force
Definition: mythtv/programs/mythcommflag/main.cpp:72
RecorderBase::~RecorderBase
~RecorderBase() override
Definition: recorderbase.cpp:53
RecStatus::Type
Type
Definition: recStatus.h:16
RecorderBase::WaitForPause
virtual bool WaitForPause(std::chrono::milliseconds timeout=1s)
WaitForPause blocks until recorder is actually paused, or timeout milliseconds elapse.
Definition: recorderbase.cpp:298
RecorderBase::ASPECT_4_3
@ ASPECT_4_3
Definition: recorderbase.h:246
MythTimer::elapsed
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:91
dtvchannel.h
ProgramInfo::MakeUniqueKey
QString MakeUniqueKey(void) const
Creates a unique string that can be used to identify an existing recording.
Definition: programinfo.h:338
ProgramInfo::SaveMarkupMap
void SaveMarkupMap(const frm_dir_map_t &marks, MarkTypes type=MARK_ALL, int64_t min_frame=-1, int64_t max_frame=-1) const
Definition: programinfo.cpp:3538
FirewireRecorder
This is a specialization of DTVRecorder used to handle DVB and ATSC streams from a firewire input.
Definition: firewirerecorder.h:24
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
RecordingFile::m_audioCodec
QString m_audioCodec
Definition: recordingfile.h:54
MARK_ASPECT_16_9
@ MARK_ASPECT_16_9
Definition: programtypes.h:68
ExternalRecorder.h
RecorderBase::m_estimatedProgStartMS
qint64 m_estimatedProgStartMS
Definition: recorderbase.h:365
RecorderBase::RecorderBase
RecorderBase(TVRec *rec)
Definition: recorderbase.cpp:47
MARK_ASPECT_2_21_1
@ MARK_ASPECT_2_21_1
Definition: programtypes.h:69
RecorderBase::m_timeOfLatestData
QDateTime m_timeOfLatestData
Definition: recorderbase.h:379
RecorderBase::VideoCodecChange
void VideoCodecChange(AVCodecID vCodec)
Note a change in video codec.
Definition: recorderbase.cpp:818
ProgramInfo::SetRecordingStatus
void SetRecordingStatus(RecStatus::Type status)
Definition: programinfo.h:580
ProgramInfo::QueryAverageFrameRate
uint QueryAverageFrameRate(void) const
If present in recording this loads average frame rate of the main video stream from database's stream...
Definition: programinfo.cpp:4406
RecorderBase::CreateRecorder
static RecorderBase * CreateRecorder(TVRec *tvrec, ChannelBase *channel, RecordingProfile &profile, const GeneralDBOptions &genOpt)
Definition: recorderbase.cpp:849
RecordingInfo::GetDesiredStartTime
QDateTime GetDesiredStartTime(void) const
Definition: recordinginfo.h:245
recorderbase.h
RecorderBase::ASPECT_2_21_1
@ ASPECT_2_21_1
Definition: recorderbase.h:248
MythTimer
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
RecorderBase::m_statisticsLock
QMutex m_statisticsLock
Definition: recorderbase.h:374
RecorderBase::ASPECT_16_9
@ ASPECT_16_9
Definition: recorderbase.h:247
ProgramInfo::SavePositionMapDelta
void SavePositionMapDelta(frm_pos_map_t &posMap, MarkTypes type) const
Definition: programinfo.cpp:3931
ProgramInfo::SaveTotalFrames
void SaveTotalFrames(int64_t frames)
Store the Total Frames at frame 0 in the recordedmarkup table.
Definition: programinfo.cpp:4280
SatIPRecorder
Definition: satiprecorder.h:13
RecordingInfo
Holds information on a TV Program one might wish to record.
Definition: recordinginfo.h:35
NuppelVideoRecorder.h
RecorderBase::Unpause
virtual void Unpause(void)
Unpause tells recorder to unpause.
Definition: recorderbase.cpp:273
RecorderBase::m_lastSavedDuration
long long m_lastSavedDuration
Definition: recorderbase.h:367
MythMediaBuffer::GetWritePosition
long long GetWritePosition(void) const
Returns how far into a ThreadedFileWriter file we have written.
Definition: mythmediabuffer.cpp:1775
firewirechannel.h
GeneralDBOptions::m_inputType
QString m_inputType
Definition: tv_rec.h:76
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
firewirerecorder.h
MythTimer::isRunning
bool isRunning(void) const
Returns true if start() or restart() has been called at least once since construction and since any c...
Definition: mythtimer.cpp:135
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:119
RecorderBase::m_videoAspect
uint m_videoAspect
Definition: recorderbase.h:328
RecorderBase::m_tvrec
TVRec * m_tvrec
Definition: recorderbase.h:314
RecordingFile
Holds information on a recording file and it's video and audio streams.
Definition: recordingfile.h:29
RecorderBase::m_nextRingBuffer
MythMediaBuffer * m_nextRingBuffer
Definition: recorderbase.h:351
RecorderBase::GetKeyframePositions
bool GetKeyframePositions(long long start, long long end, frm_pos_map_t &map) const
Definition: recorderbase.cpp:537
MythMediaBuffer
Definition: mythmediabuffer.h:50
RecorderBase::m_videoWidth
uint m_videoWidth
Definition: recorderbase.h:331
MythTimer::start
void start(void)
starts measuring elapsed time.
Definition: mythtimer.cpp:47
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
CetonChannel
Definition: cetonchannel.h:22
RecordingFile::AVContainerToString
static QString AVContainerToString(AVContainer format)
Definition: recordingfile.cpp:144
MARK_UTIL_PROGSTART
@ MARK_UTIL_PROGSTART
Definition: programtypes.h:77
LOC
#define LOC
Definition: recorderbase.cpp:44
mythsystemevent.h
build_compdb.file
file
Definition: build_compdb.py:55
RecorderBase::Pause
virtual void Pause(bool clear=true)
Pause tells recorder to pause, it should not block.
Definition: recorderbase.cpp:262
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:411
satipchannel.h
RecorderBase::m_timeOfLatestDataPacketInterval
QAtomicInt m_timeOfLatestDataPacketInterval
Definition: recorderbase.h:378
RecorderBase::GetKeyframeDurations
bool GetKeyframeDurations(long long start, long long end, frm_pos_map_t &map) const
Definition: recorderbase.cpp:559
hardwareprofile.scan.scan
def scan(profile, smoonURL, gate)
Definition: scan.py:57
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
RecorderBase::m_nextRecording
RecordingInfo * m_nextRecording
Definition: recorderbase.h:352
dvbchannel.h
HDHRChannel
Definition: hdhrchannel.h:20
RecorderBase::m_pauseLock
QMutex m_pauseLock
Definition: recorderbase.h:337
RecorderBase::m_requestPause
bool m_requestPause
Definition: recorderbase.h:338
ASIRecorder
This is a specialization of DTVRecorder used to handle streams from ASI drivers.
Definition: asirecorder.h:55
RecorderBase::m_recordingWait
QWaitCondition m_recordingWait
Definition: recorderbase.h:346
RecorderBase::m_curRecording
RecordingInfo * m_curRecording
Definition: recorderbase.h:334
dvbrecorder.h
asirecorder.h
SatIPChannel
Definition: satipchannel.h:12
GeneralDBOptions::m_vbiDev
QString m_vbiDev
Definition: tv_rec.h:74
TVRec::RecorderPaused
void RecorderPaused(void)
This is a callback, called by the "recorder" instance when it has actually paused.
Definition: tv_rec.cpp:2947
MythMediaBuffer::GetRealFileSize
long long GetRealFileSize(void) const
Definition: mythmediabuffer.cpp:461
RecorderBase::m_durationMapDelta
frm_pos_map_t m_durationMapDelta
Definition: recorderbase.h:361
mythdate.h
CetonRecorder
Definition: cetonrecorder.h:20
RecorderBase::m_paused
bool m_paused
Definition: recorderbase.h:339
ProgramInfo::SaveVideoProperties
void SaveVideoProperties(uint mask, uint video_property_flags)
Definition: programinfo.cpp:4765
ProgramInfo::SaveResolution
void SaveResolution(uint64_t frame, uint width, uint height)
Store the Resolution at frame in the recordedmarkup table.
Definition: programinfo.cpp:4314
RecorderBase::m_ringBufferCheckTimer
MythTimer m_ringBufferCheckTimer
Definition: recorderbase.h:353
RecorderBase::SetStrOption
void SetStrOption(RecordingProfile *profile, const QString &name)
Convenience function used to set QString options from a profile.
Definition: recorderbase.cpp:208
RecordingInfo::GetRecordingFile
RecordingFile * GetRecordingFile() const
Definition: recordinginfo.h:280
cetonchannel.h
programinfo.h
ProgramInfo::GetScheduledStartTime
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:389
mythlogging.h
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:446
RecordingFile::m_videoResolution
QSize m_videoResolution
Definition: recordingfile.h:50
ProgramInfo::QueryAverageAspectRatio
MarkTypes QueryAverageAspectRatio(void) const
Definition: programinfo.cpp:4411
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:31
RecorderBase::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Tells recorder to use an externally created ringbuffer.
Definition: recorderbase.cpp:74
hardwareprofile.scan.profile
profile
Definition: scan.py:99
RecorderBase::AspectChange
void AspectChange(uint aspect, long long frame)
Note a change in aspect ratio in the recordedmark table.
Definition: recorderbase.cpp:730
ProgramInfo::QueryAverageWidth
uint QueryAverageWidth(void) const
If present in recording this loads average width of the main video stream from database's stream mark...
Definition: programinfo.cpp:4397
MARK_DURATION_MS
@ MARK_DURATION_MS
Definition: programtypes.h:75
RecordingInfo::SaveFilesize
void SaveFilesize(uint64_t fsize) override
Sets recording file size in database, and sets "filesize" field.
Definition: recordinginfo.cpp:1681
hardwareprofile.i18n.t
t
Definition: i18n.py:36
ProgramInfo::SaveAspect
void SaveAspect(uint64_t frame, MarkTypes type, uint customAspect)
Store aspect ratio of a frame in the recordedmark table.
Definition: programinfo.cpp:4170
FirewireChannel
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
Definition: firewirechannel.h:14
RecorderBase::m_recordingGaps
RecordingGaps m_recordingGaps
Definition: recorderbase.h:381
RecorderBase::ClearStatistics
virtual void ClearStatistics(void)
Definition: recorderbase.cpp:423
RecordingFile::Save
bool Save()
Definition: recordingfile.cpp:55
v4lchannel.h
mark
Definition: lang.cpp:21
MARK_ASPECT_CUSTOM
@ MARK_ASPECT_CUSTOM
Definition: programtypes.h:70
RecordingFile::m_containerFormat
AVContainer m_containerFormat
Definition: recordingfile.h:47
RecorderBase::m_videoHeight
uint m_videoHeight
Definition: recorderbase.h:330
RecorderBase::GetRecordingQuality
virtual RecordingQuality * GetRecordingQuality(const RecordingInfo *ri) const
Returns a report about the current recordings quality.
Definition: recorderbase.cpp:503
RecStatus::Failing
@ Failing
Definition: recStatus.h:18
RecordingInfo::SetDesiredStartTime
void SetDesiredStartTime(const QDateTime &dt)
Definition: recordinginfo.h:243
MythTimer::restart
std::chrono::milliseconds restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
RecorderBase::ResolutionChange
void ResolutionChange(uint width, uint height, long long frame)
Note a change in video size in the recordedmark table.
Definition: recorderbase.cpp:781
RecorderBase::GetFrameRate
double GetFrameRate(void) const
Returns the latest frame rate.
Definition: recorderbase.h:233
MpegRecorder
Definition: mpegrecorder.h:14
recorder
RemoteEncoder * recorder
Definition: mythtv/programs/mythcommflag/main.cpp:78
ProgramInfo::SaveTotalDuration
void SaveTotalDuration(std::chrono::milliseconds duration)
Store the Total Duration at frame 0 in the recordedmarkup table.
Definition: programinfo.cpp:4248
FrameRate
Definition: recorderbase.h:36
importrecorder.h
RecorderBase::AudioCodecChange
void AudioCodecChange(AVCodecID aCodec)
Note a change in audio codec.
Definition: recorderbase.cpp:827
RecorderBase::IsRecordingRequested
virtual bool IsRecordingRequested(void)
Tells us if StopRecording() has been called.
Definition: recorderbase.cpp:249
v4l2encrecorder.h
clear
static void clear(SettingsMap &cache, SettingsMap &overrides, const QString &myKey)
Definition: mythdb.cpp:860
RecorderBase::m_lastSavedKeyframe
long long m_lastSavedKeyframe
Definition: recorderbase.h:366
IPTVChannel
Definition: iptvchannel.h:24
hdhrrecorder.h
RecorderBase::m_durationMap
frm_pos_map_t m_durationMap
Definition: recorderbase.h:360
RecorderBase::IsRecording
virtual bool IsRecording(void)
Tells whether the StartRecorder() loop is running.
Definition: recorderbase.cpp:242
RecorderBase::SetTotalFrames
void SetTotalFrames(uint64_t total_frames)
Note the total frames in the recordedmark table.
Definition: recorderbase.cpp:842
StandardSetting::getValue
virtual QString getValue(void) const
Definition: standardsettings.h:52
RecorderBase::m_nextRingBufferLock
QMutex m_nextRingBufferLock
Definition: recorderbase.h:350
RecordingQuality
Definition: recordingquality.h:34
IPTVRecorder
Definition: iptvrecorder.h:18
uint
unsigned int uint
Definition: compat.h:140
ExternalChannel
-*- Mode: c++ -*-
Definition: ExternalChannel.h:17
RecorderBase::m_videocodec
QString m_videocodec
Definition: recorderbase.h:321
RecorderBase::m_positionMap
frm_pos_map_t m_positionMap
Definition: recorderbase.h:358
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
RecorderBase::m_containerFormat
AVContainer m_containerFormat
Definition: recorderbase.h:318
RecorderBase::SetDuration
void SetDuration(std::chrono::milliseconds duration)
Note the total duration in the recordedmark table.
Definition: recorderbase.cpp:836
RecorderBase::m_weMadeBuffer
bool m_weMadeBuffer
Definition: recorderbase.h:316
RecorderBase::FrameRateChange
void FrameRateChange(uint framerate, uint64_t frame)
Note a change in video frame rate in the recordedmark table.
Definition: recorderbase.cpp:797
RecorderBase::TryWriteProgStartMark
void TryWriteProgStartMark(const frm_pos_map_t &durationDeltaCopy)
Definition: recorderbase.cpp:655
satiprecorder.h
CardUtil::IsV4L
static bool IsV4L(const QString &rawtype)
Definition: cardutil.h:140
RecordingFile::m_videoFrameRate
double m_videoFrameRate
Definition: recordingfile.h:52
asichannel.h
DVBRecorder
This is a specialization of DTVRecorder used to handle streams from DVB drivers.
Definition: dvbrecorder.h:21
mythmediabuffer.h
GeneralDBOptions::m_skipBtAudio
bool m_skipBtAudio
Definition: tv_rec.h:78
MARK_ASPECT_4_3
@ MARK_ASPECT_4_3
Definition: programtypes.h:67
cetonrecorder.h
RecorderBase::FinishRecording
virtual void FinishRecording(void)
Definition: recorderbase.cpp:434
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
RecorderBase::m_positionMapDelta
frm_pos_map_t m_positionMapDelta
Definition: recorderbase.h:359
RecorderBase::m_videodevice
QString m_videodevice
Definition: recorderbase.h:322
ProgramInfo::SaveFrameRate
void SaveFrameRate(uint64_t frame, uint framerate)
Store the Frame Rate at frame in the recordedmarkup table.
Definition: programinfo.cpp:4200
RecorderBase::StopRecording
virtual void StopRecording(void)
StopRecording() signals to the recorder that it should stop recording and exit cleanly.
Definition: recorderbase.cpp:223
RecorderBase::SetFrameRate
void SetFrameRate(double rate)
Sets the video frame rate.
Definition: recorderbase.h:82
iptvchannel.h
ProgramInfo::GetInputID
uint GetInputID(void) const
Definition: programinfo.h:462
RecorderBase::SavePositionMap
void SavePositionMap(bool force=false, bool finished=false)
Save the seektable to the DB.
Definition: recorderbase.cpp:589
RecorderBase::m_pauseWait
QWaitCondition m_pauseWait
Definition: recorderbase.h:340
RecorderBase::m_positionMapType
MarkTypes m_positionMapType
Definition: recorderbase.h:356
ExternalRecorder
This is a specialization of DTVRecorder used to handle streams from External 'blackbox' recorders.
Definition: ExternalRecorder.h:28
MythMediaBuffer::WriterFlush
void WriterFlush(void)
Calls ThreadedFileWriter::Flush(void)
Definition: mythmediabuffer.cpp:1686
RecorderBase::m_ringBuffer
MythMediaBuffer * m_ringBuffer
Definition: recorderbase.h:315
GeneralDBOptions::m_audioSampleRate
int m_audioSampleRate
Definition: tv_rec.h:77
DVBChannel
Provides interface to the tuning hardware when using DVB drivers.
Definition: dvbchannel.h:30
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:371
RecorderBase::m_ntsc
bool m_ntsc
Definition: recorderbase.h:324
MARK_ASPECT_1_1
@ MARK_ASPECT_1_1
deprecated, it is only 1:1 sample aspect ratio
Definition: programtypes.h:66
Buffer
Definition: MythExternControl.h:36
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
VERBOSE_LEVEL_CHECK
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
Definition: mythlogging.h:14
SCAN_t::INTERLACED
@ INTERLACED
ASIChannel
-*- Mode: c++ -*-
Definition: asichannel.h:14
RecorderBase::SetRecordingStatus
virtual void SetRecordingStatus(RecStatus::Type status, const QString &file, int line)
Definition: recorderbase.cpp:395
RecorderBase::m_timeOfFirstData
QDateTime m_timeOfFirstData
Definition: recorderbase.h:376
cardutil.h
RecordingFile::m_videoCodec
QString m_videoCodec
Definition: recordingfile.h:49
TVRec::RingBufferChanged
void RingBufferChanged(MythMediaBuffer *Buffer, RecordingInfo *pginfo, RecordingQuality *recq)
Definition: tv_rec.cpp:3388
RecorderBase::StartNewFile
virtual void StartNewFile(void)
Definition: recorderbase.h:274
ProgramInfo::QueryAverageHeight
uint QueryAverageHeight(void) const
If present in recording this loads average height of the main video stream from database's stream mar...
Definition: programinfo.cpp:4388
ExternalChannel.h
mpegrecorder.h
RecorderBase::SetNextRecording
void SetNextRecording(const RecordingInfo *ri, MythMediaBuffer *Buffer)
Sets next recording info, to be applied as soon as practical.
Definition: recorderbase.cpp:123
RecorderBase::m_timeOfFirstDataIsSet
QAtomicInt m_timeOfFirstDataIsSet
Definition: recorderbase.h:375
RecorderBase::m_positionMapLock
QMutex m_positionMapLock
Definition: recorderbase.h:357
MarkTypes
MarkTypes
Definition: programtypes.h:48
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:17
RecorderBase
This is the abstract base class for supporting recorder hardware.
Definition: recorderbase.h:73
GeneralDBOptions::m_videoDev
QString m_videoDev
Definition: tv_rec.h:73
kSingleRecord
@ kSingleRecord
Definition: recordingtypes.h:22
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:145
GeneralDBOptions::m_audioDev
QString m_audioDev
Definition: tv_rec.h:75
RecorderBase::m_recording
bool m_recording
True while recording is actually being performed.
Definition: recorderbase.h:345
RecorderBase::m_primaryAudioCodec
AVCodecID m_primaryAudioCodec
Definition: recorderbase.h:320
ImportRecorder
ImportRecorder imports files, creating a seek map and other stuff that MythTV likes to have for recor...
Definition: importrecorder.h:23
tv_rec.h
SCAN_t
SCAN_t
Definition: recorderbase.h:54
RecorderBase::SetOption
virtual void SetOption(const QString &name, const QString &value)
Set an specific option.
Definition: recorderbase.cpp:152
RecorderBase::m_primaryVideoCodec
AVCodecID m_primaryVideoCodec
Definition: recorderbase.h:319
HDHRRecorder
Definition: hdhrrecorder.h:19
dummychannel.h
iptvrecorder.h
ProgramInfo::SaveVideoScanType
void SaveVideoScanType(uint64_t frame, bool progressive)
Store the Progressive/Interlaced state in the recordedmarkup table.
Definition: programinfo.cpp:4225
RecordingFile::m_videoAspectRatio
double m_videoAspectRatio
Definition: recordingfile.h:51
StandardSetting
Definition: standardsettings.h:29
SendMythSystemRecEvent
void SendMythSystemRecEvent(const QString &msg, const RecordingInfo *pginfo)
Definition: mythsystemevent.cpp:331
recordingprofile.h
V4L2encRecorder
This is a specialization of DTVRecorder used to handle streams from V4L2 recorders.
Definition: v4l2encrecorder.h:29
RecorderBase::GetKeyframePosition
long long GetKeyframePosition(long long desired) const
Returns closest keyframe position before the desired frame.
Definition: recorderbase.cpp:518
RecordingInfo::GetDesiredEndTime
QDateTime GetDesiredEndTime(void) const
Definition: recordinginfo.h:246
RecordingProfile
Definition: recordingprofile.h:39
RecorderBase::m_frameRate
FrameRate m_frameRate
Definition: recorderbase.h:332
RecStatus::toString
static QString toString(Type recstatus, uint id)
Converts "recstatus" into a short (unreadable) string.
Definition: recStatus.cpp:39
RecorderBase::ASPECT_CUSTOM
@ ASPECT_CUSTOM
Definition: recorderbase.h:249
hdhrchannel.h
RecorderBase::m_unpauseWait
QWaitCondition m_unpauseWait
Definition: recorderbase.h:341
RecorderBase::CheckForRingBufferSwitch
virtual bool CheckForRingBufferSwitch(void)
If requested, switch to new RingBuffer/ProgramInfo objects.
Definition: recorderbase.cpp:351
V4LChannel
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
Definition: v4lchannel.h:30
RecorderBase::ASPECT_1_1
@ ASPECT_1_1
Definition: recorderbase.h:245
GeneralDBOptions::m_waitForSeqstart
bool m_waitForSeqstart
Definition: tv_rec.h:81
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1739
RecorderBase::m_timeOfLatestDataCount
QAtomicInt m_timeOfLatestDataCount
Definition: recorderbase.h:377
RecorderBase::IsPaused
virtual bool IsPaused(bool holding_lock=false) const
Returns true iff recorder is paused.
Definition: recorderbase.cpp:281
RecorderBase::SetRecording
void SetRecording(const RecordingInfo *pginfo)
Changes the Recording from the one set initially with SetOptionsFromProfile().
Definition: recorderbase.cpp:88
RecorderBase::ResetForNewFile
virtual void ResetForNewFile(void)=0
RecorderBase::VideoScanChange
void VideoScanChange(SCAN_t scan, uint64_t frame)
Note a change in video scan type in the recordedmark table.
Definition: recorderbase.cpp:812
RecorderBase::PauseAndWait
virtual bool PauseAndWait(std::chrono::milliseconds timeout=100ms)
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
Definition: recorderbase.cpp:326
RecordingInfo::SetDesiredEndTime
void SetDesiredEndTime(const QDateTime &dt)
Definition: recordinginfo.h:244
RecorderBase::m_requestRecording
bool m_requestRecording
True if API call has requested a recording be [re]started.
Definition: recorderbase.h:343
NuppelVideoRecorder
Definition: NuppelVideoRecorder.h:71
RecorderBase::SetIntOption
void SetIntOption(RecordingProfile *profile, const QString &name)
Convenience function used to set integer options from a profile.
Definition: recorderbase.cpp:198