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