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