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