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, 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, 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")
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 = ff_codec_id_string(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 = ff_codec_id_string(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 last_it = durationDeltaCopy.end();
669  --last_it;
670  long long bookmarkFrame = 0;
671  LOG(VB_RECORD, LOG_DEBUG,
672  QString("durationDeltaCopy.begin() = (%1,%2)")
673  .arg(durationDeltaCopy.begin().key())
674  .arg(durationDeltaCopy.begin().value()));
675  if (m_estimatedProgStartMS > *last_it)
676  {
677  // Do nothing because we haven't reached recstartts yet.
678  LOG(VB_RECORD, LOG_DEBUG,
679  QString("No progstart mark yet because estimatedProgStartMS=%1 "
680  "and *last_it=%2")
681  .arg(m_estimatedProgStartMS).arg(*last_it));
682  }
684  m_estimatedProgStartMS < *durationDeltaCopy.begin())
685  {
686  // Set progstart mark @ lastSavedKeyframe
687  LOG(VB_RECORD, LOG_DEBUG,
688  QString("Set progstart mark=%1 because %2<=%3<%4")
690  .arg(m_estimatedProgStartMS).arg(*durationDeltaCopy.begin()));
691  bookmarkFrame = m_lastSavedKeyframe;
692  }
693  else if (*durationDeltaCopy.begin() <= m_estimatedProgStartMS &&
694  m_estimatedProgStartMS < *last_it)
695  {
696  frm_pos_map_t::const_iterator upper_it = durationDeltaCopy.begin();
697  for (; upper_it != durationDeltaCopy.end(); ++upper_it)
698  {
699  if (*upper_it > m_estimatedProgStartMS)
700  {
701  --upper_it;
702  // Set progstart mark @ upper_it.key()
703  LOG(VB_RECORD, LOG_DEBUG,
704  QString("Set progstart mark=%1 because "
705  "estimatedProgStartMS=%2 and upper_it.value()=%3")
706  .arg(upper_it.key()).arg(m_estimatedProgStartMS)
707  .arg(upper_it.value()));
708  bookmarkFrame = upper_it.key();
709  break;
710  }
711  }
712  }
713  else
714  {
715  // do nothing
716  LOG(VB_RECORD, LOG_DEBUG, "No progstart mark due to fallthrough");
717  }
718  if (bookmarkFrame)
719  {
720  frm_dir_map_t progStartMap;
721  progStartMap[bookmarkFrame] = MARK_UTIL_PROGSTART;
723  }
724  m_lastSavedKeyframe = last_it.key();
725  m_lastSavedDuration = last_it.value();
726  LOG(VB_RECORD, LOG_DEBUG,
727  QString("Setting lastSavedKeyframe=%1 lastSavedDuration=%2 "
728  "for progstart mark calculations")
730 }
731 
732 void RecorderBase::AspectChange(uint aspect, long long frame)
733 {
735  uint customAspect = 0;
736  if (aspect == ASPECT_1_1 || aspect >= ASPECT_CUSTOM)
737  {
738  if (aspect > 0x0F)
739  customAspect = aspect;
740  else if (m_videoWidth && m_videoHeight)
741  customAspect = m_videoWidth * 1000000 / m_videoHeight;
742 
743  mark = (customAspect) ? MARK_ASPECT_CUSTOM : mark;
744  }
745  if (aspect == ASPECT_4_3)
747  if (aspect == ASPECT_16_9)
749  if (aspect == ASPECT_2_21_1)
751 
752  // Populate the recordfile table as early as possible, the best
753  // value will be determined when the recording completes.
756  {
758  switch (m_videoAspect)
759  {
760  case ASPECT_1_1 :
761  recFile->m_videoAspectRatio = 1.0;
762  break;
763  case ASPECT_4_3:
764  recFile->m_videoAspectRatio = 1.33333333333;
765  break;
766  case ASPECT_16_9:
767  recFile->m_videoAspectRatio = 1.77777777777;
768  break;
769  case ASPECT_2_21_1:
770  recFile->m_videoAspectRatio = 2.21;
771  break;
772  default:
773  recFile->m_videoAspectRatio = (double)m_videoAspect / 1000000.0;
774  break;
775  }
776  recFile->Save();
777  }
778 
779  if (m_curRecording)
780  m_curRecording->SaveAspect(frame, mark, customAspect);
781 }
782 
783 void RecorderBase::ResolutionChange(uint width, uint height, long long frame)
784 {
785  if (m_curRecording)
786  {
787  // Populate the recordfile table as early as possible, the best value
788  // value will be determined when the recording completes.
791  {
792  m_curRecording->GetRecordingFile()->m_videoResolution = QSize(width, height);
794  }
795  m_curRecording->SaveResolution(frame, width, height);
796  }
797 }
798 
799 void RecorderBase::FrameRateChange(uint framerate, uint64_t frame)
800 {
801  if (m_curRecording)
802  {
803  // Populate the recordfile table as early as possible, the average
804  // value will be determined when the recording completes.
806  {
807  m_curRecording->GetRecordingFile()->m_videoFrameRate = (double)framerate / 1000.0;
809  }
810  m_curRecording->SaveFrameRate(frame, framerate);
811  }
812 }
813 
815 {
816  if (m_curRecording)
818 }
819 
820 void RecorderBase::VideoCodecChange(AVCodecID vCodec)
821 {
823  {
824  m_curRecording->GetRecordingFile()->m_videoCodec = ff_codec_id_string(vCodec);
826  }
827 }
828 
829 void RecorderBase::AudioCodecChange(AVCodecID aCodec)
830 {
832  {
833  m_curRecording->GetRecordingFile()->m_audioCodec = ff_codec_id_string(aCodec);
835  }
836 }
837 
838 void RecorderBase::SetDuration(std::chrono::milliseconds duration)
839 {
840  if (m_curRecording)
842 }
843 
844 void RecorderBase::SetTotalFrames(uint64_t total_frames)
845 {
846  if (m_curRecording)
847  m_curRecording->SaveTotalFrames(total_frames);
848 }
849 
850 
852  TVRec *tvrec,
853  ChannelBase *channel,
855  const GeneralDBOptions &genOpt)
856 {
857  if (!channel)
858  return nullptr;
859 
860  RecorderBase *recorder = nullptr;
861  if (genOpt.m_inputType == "MPEG")
862  { // NOLINTNEXTLINE(bugprone-branch-clone)
863 #ifdef USING_IVTV
864  recorder = new MpegRecorder(tvrec);
865 #endif // USING_IVTV
866  }
867 #ifdef USING_HDPVR
868  else if (genOpt.m_inputType == "HDPVR")
869  {
870  recorder = new MpegRecorder(tvrec);
871  }
872 #endif // USING_HDPVR
873 #ifdef USING_V4L2
874  else if (genOpt.m_inputType == "V4L2ENC")
875  {
876  if (dynamic_cast<V4LChannel*>(channel))
877  recorder = new V4L2encRecorder(tvrec, dynamic_cast<V4LChannel*>(channel));
878  }
879 #endif
880 #ifdef USING_FIREWIRE
881  else if (genOpt.m_inputType == "FIREWIRE")
882  {
883  if (dynamic_cast<FirewireChannel*>(channel))
884  recorder = new FirewireRecorder(tvrec, dynamic_cast<FirewireChannel*>(channel));
885  }
886 #endif // USING_FIREWIRE
887 #ifdef USING_HDHOMERUN
888  else if (genOpt.m_inputType == "HDHOMERUN")
889  {
890  if (dynamic_cast<HDHRChannel*>(channel))
891  {
892  recorder = new HDHRRecorder(tvrec, dynamic_cast<HDHRChannel*>(channel));
893  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
894  }
895  }
896 #endif // USING_HDHOMERUN
897 #ifdef USING_CETON
898  else if (genOpt.m_inputType == "CETON")
899  {
900  if (dynamic_cast<CetonChannel*>(channel))
901  {
902  recorder = new CetonRecorder(tvrec, dynamic_cast<CetonChannel*>(channel));
903  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
904  }
905  }
906 #endif // USING_CETON
907 #ifdef USING_DVB
908  else if (genOpt.m_inputType == "DVB")
909  {
910  if (dynamic_cast<DVBChannel*>(channel))
911  {
912  recorder = new DVBRecorder(tvrec, dynamic_cast<DVBChannel*>(channel));
913  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
914  }
915  }
916 #endif // USING_DVB
917 #ifdef USING_IPTV
918  else if (genOpt.m_inputType == "FREEBOX")
919  {
920  if (dynamic_cast<IPTVChannel*>(channel))
921  {
922  recorder = new IPTVRecorder(tvrec, dynamic_cast<IPTVChannel*>(channel));
923  recorder->SetOption("mrl", genOpt.m_videoDev);
924  }
925  }
926 #endif // USING_IPTV
927 #ifdef USING_VBOX
928  else if (genOpt.m_inputType == "VBOX")
929  {
930  if (dynamic_cast<IPTVChannel*>(channel))
931  recorder = new IPTVRecorder(tvrec, dynamic_cast<IPTVChannel*>(channel));
932  }
933 #endif // USING_VBOX
934 #ifdef USING_SATIP
935  else if (genOpt.m_inputType == "SATIP")
936  {
937  if (dynamic_cast<SatIPChannel*>(channel))
938  recorder = new SatIPRecorder(tvrec, dynamic_cast<SatIPChannel*>(channel));
939  }
940 #endif // USING_SATIP
941 #ifdef USING_ASI
942  else if (genOpt.m_inputType == "ASI")
943  {
944  if (dynamic_cast<ASIChannel*>(channel))
945  {
946  recorder = new ASIRecorder(tvrec, dynamic_cast<ASIChannel*>(channel));
947  recorder->SetBoolOption("wait_for_seqstart", genOpt.m_waitForSeqstart);
948  }
949  }
950 #endif // USING_ASI
951  else if (genOpt.m_inputType == "IMPORT")
952  {
953  recorder = new ImportRecorder(tvrec);
954  }
955  else if (genOpt.m_inputType == "DEMO")
956  {
957 #ifdef USING_IVTV
958  recorder = new MpegRecorder(tvrec);
959 #else
960  recorder = new ImportRecorder(tvrec);
961 #endif
962  }
963 #if CONFIG_LIBMP3LAME && defined(USING_V4L2)
964  else if (CardUtil::IsV4L(genOpt.m_inputType))
965  {
966  // V4L/MJPEG/GO7007 from here on
967  recorder = new NuppelVideoRecorder(tvrec, channel);
968  recorder->SetBoolOption("skipbtaudio", genOpt.m_skipBtAudio);
969  }
970 #endif // USING_V4L2
971  else if (genOpt.m_inputType == "EXTERNAL")
972  {
973  if (dynamic_cast<ExternalChannel*>(channel))
974  recorder = new ExternalRecorder(tvrec, dynamic_cast<ExternalChannel*>(channel));
975  }
976 
977  if (recorder)
978  {
979  recorder->SetOptionsFromProfile(&profile,
980  genOpt.m_videoDev, genOpt.m_audioDev, genOpt.m_vbiDev);
981  // Override the samplerate defined in the profile if this card
982  // was configured with a fixed rate.
983  if (genOpt.m_audioSampleRate)
984  recorder->SetOption("samplerate", genOpt.m_audioSampleRate);
985  }
986  else
987  {
988  QString msg = "Need %1 recorder, but compiled without %2 support!";
989  msg = msg.arg(genOpt.m_inputType, genOpt.m_inputType);
990  LOG(VB_GENERAL, LOG_ERR,
991  "RecorderBase::CreateRecorder() Error, " + msg);
992  }
993 
994  return recorder;
995 }
996 
997 /* 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:3525
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:820
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:4400
RecorderBase::CreateRecorder
static RecorderBase * CreateRecorder(TVRec *tvrec, ChannelBase *channel, RecordingProfile &profile, const GeneralDBOptions &genOpt)
Definition: recorderbase.cpp:851
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:3918
ProgramInfo::SaveTotalFrames
void SaveTotalFrames(int64_t frames)
Store the Total Frames at frame 0 in the recordedmarkup table.
Definition: programinfo.cpp:4274
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:1786
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:539
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:561
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:2951
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:4759
ProgramInfo::SaveResolution
void SaveResolution(uint64_t frame, uint width, uint height)
Store the Resolution at frame in the recordedmarkup table.
Definition: programinfo.cpp:4308
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:4405
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:732
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:4391
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:1679
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:4157
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:425
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:505
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:783
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:4242
FrameRate
Definition: recorderbase.h:36
importrecorder.h
RecorderBase::AudioCodecChange
void AudioCodecChange(AVCodecID aCodec)
Note a change in audio codec.
Definition: recorderbase.cpp:829
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:866
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:844
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:838
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:799
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: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:436
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:4194
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:591
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:1697
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:3392
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:4382
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:4219
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:332
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: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:1737
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:814
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