MythTV  master
recorderbase.cpp
Go to the documentation of this file.
1 #include <algorithm> // for min
2 #include <cstdint>
3 using namespace std;
4 
5 #include "firewirerecorder.h"
6 #include "recordingprofile.h"
7 #include "firewirechannel.h"
8 #include "importrecorder.h"
9 #include "cetonrecorder.h"
10 #include "dummychannel.h"
11 #include "hdhrrecorder.h"
12 #include "iptvrecorder.h"
13 #include "mpegrecorder.h"
14 #include "recorderbase.h"
15 #include "cetonchannel.h"
16 #include "asirecorder.h"
17 #include "dvbrecorder.h"
18 #include "ExternalRecorder.h"
19 #include "hdhrchannel.h"
20 #include "iptvchannel.h"
21 #include "mythsystemevent.h"
22 #include "mythlogging.h"
23 #include "programinfo.h"
24 #include "asichannel.h"
25 #include "dtvchannel.h"
26 #include "dvbchannel.h"
27 #include "satipchannel.h"
28 #include "satiprecorder.h"
29 #include "ExternalChannel.h"
30 #include "io/mythmediabuffer.h"
31 #include "cardutil.h"
32 #include "tv_rec.h"
33 #include "mythdate.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).arg(m_videodevice)
47 
49 
51  : m_tvrec(rec)
52 {
54 }
55 
57 {
59  {
60  delete m_ringBuffer;
61  m_ringBuffer = nullptr;
62  }
63  SetRecording(nullptr);
64  if (m_nextRingBuffer)
65  {
66  QMutexLocker locker(&m_nextRingBufferLock);
67  delete m_nextRingBuffer;
68  m_nextRingBuffer = nullptr;
69  }
70  if (m_nextRecording)
71  {
72  delete m_nextRecording;
73  m_nextRecording = nullptr;
74  }
75 }
76 
78 {
79  if (VERBOSE_LEVEL_CHECK(VB_RECORD, LOG_INFO))
80  {
81  QString msg("");
82  if (Buffer)
83  msg = " '" + Buffer->GetFilename() + "'";
84  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetRingBuffer(0x%1)")
85  .arg((uint64_t)Buffer,0,16) + msg);
86  }
88  m_weMadeBuffer = false;
89 }
90 
92 {
93  if (pginfo)
94  {
95  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetRecording(0x%1) title(%2)")
96  .arg((uint64_t)pginfo,0,16).arg(pginfo->GetTitle()));
97  }
98  else
99  {
100  LOG(VB_RECORD, LOG_INFO, LOC + "SetRecording(0x0)");
101  }
102 
103  ProgramInfo *oldrec = m_curRecording;
104  if (pginfo)
105  {
106  // NOTE: RecorderBase and TVRec do not share a single RecordingInfo
107  // instance which may lead to the possibility that changes made
108  // in the database by one are overwritten by the other
109  m_curRecording = new RecordingInfo(*pginfo);
110  // Compute an estimate of the actual progstart delay for setting the
111  // MARK_UTIL_PROGSTART mark. We can't reliably use
112  // m_curRecording->GetRecordingStartTime() because the scheduler rounds it
113  // to the nearest minute, so we use the current time instead.
118  recFile->Save();
119  }
120  else
121  m_curRecording = nullptr;
122 
123  delete oldrec;
124 }
125 
127 {
128  LOG(VB_RECORD, LOG_INFO, LOC + QString("SetNextRecording(0x%1, 0x%2)")
129  .arg(reinterpret_cast<intptr_t>(ri),0,16)
130  .arg(reinterpret_cast<intptr_t>(Buffer),0,16));
131 
132  // First we do some of the time consuming stuff we can do now
133  SavePositionMap(true);
134  if (m_ringBuffer)
135  {
137  if (m_curRecording)
139  }
140 
141  // Then we set the next info
142  QMutexLocker locker(&m_nextRingBufferLock);
143  if (m_nextRecording)
144  {
145  delete m_nextRecording;
146  m_nextRecording = nullptr;
147  }
148  if (ri)
149  m_nextRecording = new RecordingInfo(*ri);
150 
151  delete m_nextRingBuffer;
153 }
154 
155 void RecorderBase::SetOption(const QString &name, const QString &value)
156 {
157  if (name == "videocodec")
158  m_videocodec = value;
159  else if (name == "videodevice")
160  m_videodevice = value;
161  else if (name == "tvformat")
162  {
163  m_ntsc = false;
164  if (value.toLower() == "ntsc" || value.toLower() == "ntsc-jp")
165  { // NOLINT(bugprone-branch-clone)
166  m_ntsc = true;
167  SetFrameRate(29.97);
168  }
169  else if (value.toLower() == "pal-m")
170  SetFrameRate(29.97);
171  else if (value.toLower() == "atsc")
172  {
173  // Here we set the TV format values for ATSC. ATSC isn't really
174  // NTSC, but users who configure a non-ATSC-recorder as ATSC
175  // are far more likely to be using a mix of ATSC and NTSC than
176  // a mix of ATSC and PAL or SECAM. The atsc recorder itself
177  // does not care about these values, except in so much as tv_rec
178  // cares about m_videoFrameRate which should be neither 29.97
179  // nor 25.0, but based on the actual video.
180  m_ntsc = true;
181  SetFrameRate(29.97);
182  }
183  else
184  SetFrameRate(25.00);
185  }
186  else
187  {
188  LOG(VB_GENERAL, LOG_WARNING, LOC +
189  QString("SetOption(%1,%2): Option not recognized")
190  .arg(name).arg(value));
191  }
192 }
193 
194 void RecorderBase::SetOption(const QString &name, int value)
195 {
196  LOG(VB_GENERAL, LOG_ERR, LOC +
197  QString("SetOption(): Unknown int option: %1: %2")
198  .arg(name).arg(value));
199 }
200 
202 {
203  const StandardSetting *setting = profile->byName(name);
204  if (setting)
205  SetOption(name, setting->getValue().toInt());
206  else
207  LOG(VB_GENERAL, LOG_ERR, LOC +
208  QString("SetIntOption(...%1): Option not in profile.").arg(name));
209 }
210 
212 {
213  const StandardSetting *setting = profile->byName(name);
214  if (setting)
215  SetOption(name, setting->getValue());
216  else
217  LOG(VB_GENERAL, LOG_ERR, LOC +
218  QString("SetStrOption(...%1): Option not in profile.").arg(name));
219 }
220 
227 {
228  QMutexLocker locker(&m_pauseLock);
229  m_requestRecording = false;
230  m_unpauseWait.wakeAll();
231  while (m_recording)
232  {
233  m_recordingWait.wait(&m_pauseLock, 100);
234  if (m_requestRecording)
235  {
236  LOG(VB_GENERAL, LOG_ERR, LOC +
237  "Programmer Error: Recorder started while we were in "
238  "StopRecording");
239  m_requestRecording = false;
240  }
241  }
242 }
243 
246 {
247  QMutexLocker locker(&m_pauseLock);
248  return m_recording;
249 }
250 
253 {
254  QMutexLocker locker(&m_pauseLock);
255  return m_requestRecording;
256 }
257 
266 {
267  (void) clear;
268  QMutexLocker locker(&m_pauseLock);
269  m_requestPause = true;
270 }
271 
277 {
278  QMutexLocker locker(&m_pauseLock);
279  m_requestPause = false;
280  m_unpauseWait.wakeAll();
281 }
282 
284 bool RecorderBase::IsPaused(bool holding_lock) const
285 {
286  if (!holding_lock)
287  m_pauseLock.lock();
288  bool ret = m_paused;
289  if (!holding_lock)
290  m_pauseLock.unlock();
291  return ret;
292 }
293 
301 {
302  MythTimer t;
303  t.start();
304 
305  QMutexLocker locker(&m_pauseLock);
306  while (!IsPaused(true) && m_requestPause)
307  {
308  int wait = timeout - t.elapsed();
309  if (wait <= 0)
310  return false;
311  m_pauseWait.wait(&m_pauseLock, wait);
312  }
313  return true;
314 }
315 
329 {
330  QMutexLocker locker(&m_pauseLock);
331  if (m_requestPause)
332  {
333  if (!IsPaused(true))
334  {
335  m_paused = true;
336  m_pauseWait.wakeAll();
337  if (m_tvrec)
339  }
340 
342  }
343 
344  if (!m_requestPause && IsPaused(true))
345  {
346  m_paused = false;
347  m_unpauseWait.wakeAll();
348  }
349 
350  return IsPaused(true);
351 }
352 
354 {
355  bool did_switch = false;
356 
357  m_nextRingBufferLock.lock();
358 
359  RecordingQuality *recq = nullptr;
360 
361  if (m_nextRingBuffer)
362  {
363  FinishRecording();
364 
365  recq = GetRecordingQuality(nullptr);
366 
367  ResetForNewFile();
368 
370  m_frameRate = FrameRate(0);
371 
374 
375  m_nextRingBuffer = nullptr;
376  m_nextRecording = nullptr;
377 
378  StartNewFile();
379  did_switch = true;
380  }
381  m_nextRingBufferLock.unlock();
382 
383  if (recq && m_tvrec)
384  {
385  // This call will free recq.
387  }
388  else
389  {
390  delete recq;
391  }
392 
394  return did_switch;
395 }
396 
398  const QString& file, int line)
399 {
401  {
402  LOG(VB_RECORD, LOG_INFO,
403  QString("Modifying recording status from %1 to %2 at %3:%4")
405  .arg(RecStatus::toString(status, kSingleRecord)).arg(file).arg(line));
406 
408 
409  if (status == RecStatus::Failing)
410  {
412  SendMythSystemRecEvent("REC_FAILING", m_curRecording);
413  }
414 
415  MythEvent me(QString("UPDATE_RECORDING_STATUS %1 %2 %3 %4 %5")
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)
442  else if (m_primaryVideoCodec == AV_CODEC_ID_H265)
444  else if (m_primaryVideoCodec == AV_CODEC_ID_MPEG2VIDEO)
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)
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  uint pm_elapsed = (m_positionMapTimer.isRunning()) ?
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 >= 1500);
603  // save every 10 seconds later on
604  needToSave |= has_delta && (pm_elapsed >= 10000);
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")
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(uint64_t 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,
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).arg(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:66
RecorderBase::m_positionMapTimer
MythTimer m_positionMapTimer
Definition: recorderbase.h:362
force
bool force
Definition: mythtv/programs/mythcommflag/main.cpp:75
RecorderBase::~RecorderBase
~RecorderBase() override
Definition: recorderbase.cpp:56
RecStatus::Type
Type
Definition: recStatus.h:16
RecorderBase::ASPECT_4_3
@ ASPECT_4_3
Definition: recorderbase.h:246
dtvchannel.h
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:498
ProgramInfo::MakeUniqueKey
QString MakeUniqueKey(void) const
Creates a unique string that can be used to identify an existing recording.
Definition: programinfo.h:334
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:3424
FirewireRecorder
This is a specialization of DTVRecorder used to handle DVB and ATSC streams from a firewire input.
Definition: firewirerecorder.h:27
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:67
ExternalRecorder.h
RecorderBase::m_estimatedProgStartMS
qint64 m_estimatedProgStartMS
Definition: recorderbase.h:365
RecorderBase::RecorderBase
RecorderBase(TVRec *rec)
Definition: recorderbase.cpp:50
MARK_ASPECT_2_21_1
@ MARK_ASPECT_2_21_1
Definition: programtypes.h:68
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:568
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:4293
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:238
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:14
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:3818
VID_DAMAGED
@ VID_DAMAGED
Definition: programtypes.h:197
ProgramInfo::SaveTotalFrames
void SaveTotalFrames(int64_t frames)
Store the Total Frames at frame 0 in the recordedmarkup table.
Definition: programinfo.cpp:4167
SatIPRecorder
Definition: satiprecorder.h:14
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:276
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:1795
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:17
firewirerecorder.h
arg
arg(title).arg(filename).arg(doDelete))
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:134
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:82
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:30
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:23
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
RecorderBase::Pause
virtual void Pause(bool clear=true)
Pause tells recorder to pause, it should not block.
Definition: recorderbase.cpp:265
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:407
satipchannel.h
RecorderBase::kTimeOfLatestDataIntervalTarget
static const uint kTimeOfLatestDataIntervalTarget
timeOfLatest update interval target in milliseconds.
Definition: recorderbase.h:383
RecorderBase::m_timeOfLatestDataPacketInterval
QAtomicInt m_timeOfLatestDataPacketInterval
Definition: recorderbase.h:378
RecorderBase::WaitForPause
virtual bool WaitForPause(int timeout=1000)
WaitForPause blocks until recorder is actually paused, or timeout milliseconds elapse.
Definition: recorderbase.cpp:300
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:21
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:56
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:13
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:2947
MythMediaBuffer::GetRealFileSize
long long GetRealFileSize(void) const
Definition: mythmediabuffer.cpp:485
RecorderBase::m_durationMapDelta
frm_pos_map_t m_durationMapDelta
Definition: recorderbase.h:361
mythdate.h
CetonRecorder
Definition: cetonrecorder.h:21
RecorderBase::m_paused
bool m_paused
Definition: recorderbase.h:339
ProgramInfo::SaveVideoProperties
void SaveVideoProperties(uint mask, uint video_property_flags)
Definition: programinfo.cpp:4655
ProgramInfo::SaveResolution
void SaveResolution(uint64_t frame, uint width, uint height)
Store the Resolution at frame in the recordedmarkup table.
Definition: programinfo.cpp:4201
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:211
RecordingInfo::GetRecordingFile
RecordingFile * GetRecordingFile() const
Definition: recordinginfo.h:271
cetonchannel.h
programinfo.h
ProgramInfo::GetScheduledStartTime
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
Definition: programinfo.h:385
mythlogging.h
ProgramInfo::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: programinfo.h:442
RecordingFile::m_videoResolution
QSize m_videoResolution
Definition: recordingfile.h:50
ProgramInfo::QueryAverageAspectRatio
MarkTypes QueryAverageAspectRatio(void) const
Definition: programinfo.cpp:4298
ChannelBase
Abstract class providing a generic interface to tuning hardware.
Definition: channelbase.h:32
RecorderBase::SetRingBuffer
void SetRingBuffer(MythMediaBuffer *Buffer)
Tells recorder to use an externally created ringbuffer.
Definition: recorderbase.cpp:77
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:4284
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:1651
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:4057
FirewireChannel
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
Definition: firewirechannel.h:15
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:20
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: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:236
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:16
recorder
RemoteEncoder * recorder
Definition: mythtv/programs/mythcommflag/main.cpp:81
FrameRate
Definition: recorderbase.h:37
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:252
v4l2encrecorder.h
clear
static void clear(SettingsMap &cache, SettingsMap &overrides, const QString &myKey)
Definition: mythdb.cpp:846
RecorderBase::m_lastSavedKeyframe
long long m_lastSavedKeyframe
Definition: recorderbase.h:366
IPTVChannel
Definition: iptvchannel.h:25
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:245
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:51
VID_AVC
@ VID_AVC
Definition: programtypes.h:190
RecorderBase::m_nextRingBufferLock
QMutex m_nextRingBufferLock
Definition: recorderbase.h:350
RecordingQuality
Definition: recordingquality.h:35
IPTVRecorder
Definition: iptvrecorder.h:19
uint
unsigned int uint
Definition: compat.h:140
ExternalChannel
Definition: ExternalChannel.h:19
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:57
RecorderBase::m_containerFormat
AVContainer m_containerFormat
Definition: recorderbase.h:318
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:22
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: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:4087
RecorderBase::StopRecording
virtual void StopRecording(void)
StopRecording() signals to the recorder that it should stop recording and exit cleanly.
Definition: recorderbase.cpp:226
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:458
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:29
MythTimer::elapsed
int elapsed(void)
Returns milliseconds elapsed since last start() or restart()
Definition: mythtimer.cpp:90
MythMediaBuffer::WriterFlush
void WriterFlush(void)
Calls ThreadedFileWriter::Flush(void)
Definition: mythmediabuffer.cpp:1706
RecorderBase::m_ringBuffer
MythMediaBuffer * m_ringBuffer
Definition: recorderbase.h:315
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:30
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:367
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:65
Buffer
Definition: MythExternControl.h:37
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
VERBOSE_LEVEL_CHECK
#define VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_)
Definition: mythlogging.h:14
SCAN_t::INTERLACED
@ INTERLACED
RecorderBase::PauseAndWait
virtual bool PauseAndWait(int timeout=100)
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
Definition: recorderbase.cpp:328
ASIChannel
Definition: asichannel.h:16
ProgramInfo::SaveTotalDuration
void SaveTotalDuration(int64_t duration)
Store the Total Duration at frame 0 in the recordedmarkup table.
Definition: programinfo.cpp:4135
VID_HEVC
@ VID_HEVC
Definition: programtypes.h:191
RecorderBase::SetRecordingStatus
virtual void SetRecordingStatus(RecStatus::Type status, const QString &file, int line)
Definition: recorderbase.cpp:397
RecorderBase::m_timeOfFirstData
QDateTime m_timeOfFirstData
Definition: recorderbase.h:376
cardutil.h
RecordingFile::m_videoCodec
QString m_videoCodec
Definition: recordingfile.h:49
TVRec::RingBufferChanged
void RingBufferChanged(MythMediaBuffer *Buffer, RecordingInfo *pginfo, RecordingQuality *recq)
Definition: tv_rec.cpp:3388
RecorderBase::StartNewFile
virtual void StartNewFile(void)
Definition: recorderbase.h:274
ProgramInfo::QueryAverageHeight
uint QueryAverageHeight(void) const
If present in recording this loads average height of the main video stream from database's stream mar...
Definition: programinfo.cpp:4275
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:126
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:14
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:22
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
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: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:24
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:155
RecorderBase::m_primaryVideoCodec
AVCodecID m_primaryVideoCodec
Definition: recorderbase.h:319
HDHRRecorder
Definition: hdhrrecorder.h:20
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:4112
RecordingFile::m_videoAspectRatio
double m_videoAspectRatio
Definition: recordingfile.h:51
StandardSetting
Definition: standardsettings.h:30
SendMythSystemRecEvent
void SendMythSystemRecEvent(const QString &msg, const RecordingInfo *pginfo)
Definition: mythsystemevent.cpp:338
recordingprofile.h
V4L2encRecorder
This is a specialization of DTVRecorder used to handle streams from V4L2 recorders.
Definition: v4l2encrecorder.h:30
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:239
RecordingProfile
Definition: recordingprofile.h:40
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
RecorderBase::SetDuration
void SetDuration(uint64_t duration)
Note the total duration in the recordedmark table.
Definition: recorderbase.cpp:838
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:353
V4LChannel
Implements tuning for TV cards using the V4L driver API, both versions 1 and 2.
Definition: v4lchannel.h:37
RecorderBase::ASPECT_1_1
@ ASPECT_1_1
Definition: recorderbase.h:245
GeneralDBOptions::m_waitForSeqstart
bool m_waitForSeqstart
Definition: tv_rec.h:78
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1733
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:284
RecorderBase::SetRecording
void SetRecording(const RecordingInfo *pginfo)
Changes the Recording from the one set initially with SetOptionsFromProfile().
Definition: recorderbase.cpp:91
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
MythTimer::restart
int restart(void)
Returns milliseconds elapsed since last start() or restart() and resets the count.
Definition: mythtimer.cpp:62
VID_MPEG2
@ VID_MPEG2
Definition: programtypes.h:189
RecordingInfo::SetDesiredEndTime
void SetDesiredEndTime(const QDateTime &dt)
Definition: recordinginfo.h:237
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:73
RecorderBase::SetIntOption
void SetIntOption(RecordingProfile *profile, const QString &name)
Convenience function used to set integer options from a profile.
Definition: recorderbase.cpp:201