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