MythTV  master
encoderlink.cpp
Go to the documentation of this file.
1 // ANSI C++ headers
2 #include <chrono> // for milliseconds
3 #include <thread> // for sleep_for
4 #include <utility>
5 
6 // QT headers
7 #include <QMap> // for QMap
8 
9 // MythTV headers
10 #include "libmythbase/compat.h"
12 #include "libmythbase/mythdate.h"
13 #include "libmythbase/mythlogging.h" // for LOG
14 #include "libmythbase/programinfo.h" // for ProgramInfo
17 #include "libmythtv/inputinfo.h" // for InputInfo
18 #include "libmythtv/tv_rec.h"
19 
20 // MythBackend
21 #include "encoderlink.h"
22 #include "playbacksock.h"
23 
24 #define LOC QString("EncoderLink(%1): ").arg(m_inputid)
25 #define LOC_ERR QString("EncoderLink(%1) Error: ").arg(m_inputid)
26 
46  QString lhostname)
47  : m_inputid(inputid), m_sock(lsock), m_hostname(std::move(lhostname)),
48  m_sleepStatusTime(MythDate::current()),
49  m_lastSleepTime(MythDate::current()),
50  m_lastWakeTime(MythDate::current()),
51  m_endRecordingTime(MythDate::current().addDays(-2)),
52  m_startRecordingTime(m_endRecordingTime)
53 {
55 }
56 
60 EncoderLink::EncoderLink(int inputid, TVRec *ltv)
61  : m_inputid(inputid), m_tv(ltv), m_local(true),
62  m_sleepStatusTime(MythDate::current()),
63  m_lastSleepTime(MythDate::current()),
64  m_lastWakeTime(MythDate::current()),
65  m_endRecordingTime(MythDate::current().addDays(-2)),
66  m_startRecordingTime(m_endRecordingTime)
67 {
68 }
69 
75 {
76  if (m_tv)
77  {
78  delete m_tv;
79  m_tv = nullptr;
80  }
81  SetSocket(nullptr);
82 }
83 
88 {
89  QMutexLocker locker(&m_sockLock);
90  if (m_sock)
91  {
92  m_sock->IncrRef();
93  return true;
94  }
95  return false;
96 }
97 
102 {
103  QMutexLocker locker(&m_sockLock);
104  if (m_sock)
105  {
106  m_sock->DecrRef();
107  return true;
108  }
109  return false;
110 }
111 
118 {
119  if (lsock)
120  {
121  lsock->IncrRef();
122 
123  if (gCoreContext->GetSettingOnHost("SleepCommand", m_hostname).isEmpty())
125  else
127  }
128  else
129  {
130  if (IsFallingAsleep())
132  else
134  }
135 
137  m_sock = lsock;
138 }
139 
144 {
145  m_sleepStatus = newStatus;
147 }
148 
154 bool EncoderLink::IsBusy(InputInfo *busy_input, std::chrono::seconds time_buffer)
155 {
156  if (m_local)
157  return m_tv->IsBusy(busy_input, time_buffer);
158 
159  if (HasSockAndIncrRef())
160  {
161  ReferenceLocker rlocker(m_sock);
162  return m_sock->IsBusy(m_inputid, busy_input, time_buffer);
163  }
164 
165  return false;
166 }
167 
177 {
178  bool retval = false;
179 
180  TVState state = GetState();
181 
182  if (state == kState_RecordingOnly || state == kState_WatchingRecording ||
183  state == kState_WatchingLiveTV)
184  {
185  retval = true;
186  }
187 
188  return retval;
189 }
190 
196 {
197  TVState retval = kState_Error;
198 
199  if (!IsConnected())
200  return retval;
201 
202  if (m_local)
203  retval = m_tv->GetState();
204  else if (HasSockAndIncrRef())
205  {
206  ReferenceLocker rlocker(m_sock);
208  }
209  else
210  LOG(VB_GENERAL, LOG_ERR, QString("Broken for input: %1")
211  .arg(m_inputid));
212 
213  return retval;
214 }
215 
221 {
222  uint retval = 0;
223 
224  if (!IsConnected())
225  return retval;
226 
227  if (m_local)
228  retval = m_tv->GetFlags();
229  else if (HasSockAndIncrRef())
230  {
231  ReferenceLocker rlocker(m_sock);
232  retval = m_sock->GetEncoderState(m_inputid);
233  }
234  else
235  LOG(VB_GENERAL, LOG_ERR, LOC + "GetFlags failed");
236 
237  return retval;
238 }
239 
246 {
247  return (rec->GetChanID() == m_chanid &&
249 }
250 
260 {
261  bool retval = false;
262  ProgramInfo *tvrec = nullptr;
263 
264  if (m_local)
265  {
266  while (kState_ChangingState == GetState())
267  std::this_thread::sleep_for(100us);
268 
269  if (IsBusyRecording())
270  tvrec = m_tv->GetRecording();
271 
272  if (tvrec)
273  {
274  retval = tvrec->IsSameRecording(*rec);
275  delete tvrec;
276  }
277  }
278  else
279  {
280  if (HasSockAndIncrRef())
281  {
282  ReferenceLocker rlocker(m_sock);
283  retval = m_sock->EncoderIsRecording(m_inputid, rec);
284  }
285  }
286 
287  return retval;
288 }
289 
299  std::chrono::seconds secsleft,
300  bool hasLater)
301 {
302  if (m_local)
303  m_tv->RecordPending(rec, secsleft, hasLater);
304  else if (HasSockAndIncrRef())
305  {
306  ReferenceLocker rlocker(m_sock);
307  m_sock->RecordPending(m_inputid, rec, secsleft, hasLater);
308  }
309 }
310 
317 {
318  if (!IsConnected())
319  return true;
320 
322  return true;
323 
324  return false;
325 }
326 
329 {
330  if (HasSockAndIncrRef())
331  {
332  ReferenceLocker rlocker(m_sock);
333  return m_sock->CheckFile(pginfo);
334  }
335  pginfo->SetPathname(GetPlaybackURL(pginfo));
336  return pginfo->IsLocal();
337 }
338 
344 void EncoderLink::GetDiskSpace(QStringList &o_strlist)
345 {
346  if (HasSockAndIncrRef())
347  {
348  ReferenceLocker rlocker(m_sock);
349  m_sock->GetDiskSpace(o_strlist);
350  }
351 }
352 
360 {
361  if (m_local)
362  return m_tv->GetMaxBitrate();
363  if (HasSockAndIncrRef())
364  {
365  ReferenceLocker rlocker(m_sock);
366  return m_sock->GetMaxBitrate(m_inputid);
367  }
368 
369  return -1;
370 }
371 
386 std::chrono::milliseconds EncoderLink::SetSignalMonitoringRate(std::chrono::milliseconds rate, int notifyFrontend)
387 {
388  if (m_local)
389  return m_tv->SetSignalMonitoringRate(rate, notifyFrontend);
390  if (HasSockAndIncrRef())
391  {
392  ReferenceLocker rlocker(m_sock);
394  notifyFrontend);
395  }
396  return -1ms;
397 }
398 
402 {
403  if (IsLocal() || !HasSockAndIncrRef())
404  return false;
405  ReferenceLocker rlocker(m_sock);
406 
408 
409  return m_sock->GoToSleep();
410 }
411 
417 {
418  if (m_locked)
419  return -2;
420 
421  m_locked = true;
422  return m_inputid;
423 }
424 
432 {
434 
437  m_chanid = rec->GetChanID();
438 
439  if (m_local)
440  retval = m_tv->StartRecording(rec);
441  else if (HasSockAndIncrRef())
442  {
443  ReferenceLocker rlocker(m_sock);
444  retval = m_sock->StartRecording(m_inputid, rec);
445  }
446  else
447  {
448  LOG(VB_GENERAL, LOG_ERR,
449  QString("Wanted to start recording on recorder %1,\n\t\t\t"
450  "but the backend is not there anymore\n")
451  .arg(m_inputid));
452  }
453 
454  if (retval != RecStatus::Recording &&
455  retval != RecStatus::Tuning &&
456  retval != RecStatus::Failing)
457  {
458  m_endRecordingTime = MythDate::current().addDays(-2);
460  m_chanid = 0;
461  }
462 
463  return retval;
464 }
465 
467 {
469 
470  if (m_local)
471  retval = m_tv->GetRecordingStatus();
472  else if (HasSockAndIncrRef())
473  {
474  ReferenceLocker rlocker(m_sock);
476  }
477  else
478  {
479  LOG(VB_GENERAL, LOG_ERR,
480  QString("Wanted to get status on recorder %1,\n\t\t\t"
481  "but the backend is not there anymore\n")
482  .arg(m_inputid));
483  }
484 
485  if (retval != RecStatus::Recording &&
486  retval != RecStatus::Tuning &&
487  retval != RecStatus::Failing)
488  {
489  m_endRecordingTime = MythDate::current().addDays(-2);
491  m_chanid = 0;
492  }
493 
494  return retval;
495 }
496 
504 {
505  ProgramInfo *info = nullptr;
506 
507  if (m_local)
508  info = m_tv->GetRecording();
509  else if (HasSockAndIncrRef())
510  {
511  ReferenceLocker rlocker(m_sock);
512  info = m_sock->GetRecording(m_inputid);
513  }
514 
515  return info;
516 }
517 
523 void EncoderLink::StopRecording(bool killFile)
524 {
525  m_endRecordingTime = MythDate::current().addDays(-2);
527  m_chanid = 0;
528 
529  if (m_local)
530  {
531  m_tv->StopRecording(killFile);
532  return;
533  }
534 }
535 
542 {
543  if (m_local)
544  {
546  return;
547  }
548  m_endRecordingTime = MythDate::current().addDays(-2);
549 }
550 
557 {
558  if (m_local)
559  return m_tv->IsReallyRecording();
560 
561  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
562  return false;
563 }
564 
573 {
574  if (m_local)
575  return m_tv->GetFramerate();
576 
577  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
578  return -1;
579 }
580 
589 {
590  if (m_local)
591  return m_tv->GetFramesWritten();
592 
593  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
594  return -1;
595 }
596 
604 {
605  if (m_local)
606  return m_tv->GetFilePosition();
607 
608  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
609  return -1;
610 }
611 
618 int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
619 {
620  if (m_local)
621  return m_tv->GetKeyframePosition(desired);
622 
623  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
624  return -1;
625 }
626 
628  int64_t start, int64_t end, frm_pos_map_t &map)
629 {
630  if (!m_local)
631  {
632  LOG(VB_GENERAL, LOG_ERR,
633  "Should be local only query: GetKeyframePositions");
634  return false;
635  }
636 
637  return m_tv->GetKeyframePositions(start, end, map);
638 }
639 
641  int64_t start, int64_t end, frm_pos_map_t &map)
642 {
643  if (!m_local)
644  {
645  LOG(VB_GENERAL, LOG_ERR,
646  "Should be local only query: GetKeyframeDurations");
647  return false;
648  }
649 
650  return m_tv->GetKeyframeDurations(start, end, map);
651 }
652 
659 {
660  if (m_local)
661  m_tv->FrontendReady();
662  else
663  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
664 }
665 
675 {
676  if (m_local)
677  m_tv->CancelNextRecording(cancel);
678  else if (HasSockAndIncrRef())
679  {
680  ReferenceLocker rlocker(m_sock);
682  }
683 }
684 
696 void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
697 {
698  if (m_local)
699  m_tv->SpawnLiveTV(chain, pip, std::move(startchan));
700  else
701  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
702 }
703 
708 {
709  if (m_local)
710  return m_tv->GetChainID();
711 
712  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
713  return "";
714 }
715 
722 {
723  if (m_local)
724  m_tv->StopLiveTV();
725  else
726  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
727 }
728 
736 {
737  if (m_local)
738  m_tv->PauseRecorder();
739  else
740  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
741 }
742 
748 void EncoderLink::SetLiveRecording(int recording)
749 {
750  if (m_local)
751  m_tv->SetLiveRecording(recording);
752  else
753  LOG(VB_GENERAL, LOG_ERR,
754  "Should be local only query: SetLiveRecording");
755 }
756 
760 void EncoderLink::SetNextLiveTVDir(const QString& dir)
761 {
762  if (m_local)
763  m_tv->SetNextLiveTVDir(dir);
764  else if (HasSockAndIncrRef())
765  {
766  ReferenceLocker rlocker(m_sock);
768  }
769 }
770 
777 QString EncoderLink::GetInput(void) const
778 {
779  if (m_local)
780  return m_tv->GetInput();
781 
782  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
783  return {};
784 }
785 
796 QString EncoderLink::SetInput(QString input)
797 {
798  if (m_local)
799  return m_tv->SetInput(std::move(input));
800 
801  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
802  return {};
803 }
804 
810 void EncoderLink::ToggleChannelFavorite(const QString& changroup)
811 {
812  if (m_local)
813  m_tv->ToggleChannelFavorite(changroup);
814  else
815  LOG(VB_GENERAL, LOG_ERR,
816  "Should be local only query: ToggleChannelFavorite");
817 }
818 
826 {
827  if (m_local)
828  m_tv->ChangeChannel(channeldirection);
829  else
830  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
831 }
832 
840 void EncoderLink::SetChannel(const QString &name)
841 {
842  if (m_local)
843  m_tv->SetChannel(name);
844  else
845  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
846 }
847 
857 {
858  if (!m_local)
859  {
860  LOG(VB_GENERAL, LOG_ERR,
861  "Should be local only query: GetPictureAttribute");
862  return -1;
863  }
864 
865  return m_tv->GetPictureAttribute(attr);
866 }
867 
877  PictureAttribute attr,
878  bool direction)
879 {
880  if (!m_local)
881  {
882  LOG(VB_GENERAL, LOG_ERR,
883  "Should be local only query: ChangePictureAttribute");
884  return -1;
885  }
886 
887  return m_tv->ChangePictureAttribute(type, attr, direction);
888 }
889 
899 bool EncoderLink::CheckChannel(const QString &name)
900 {
901  if (m_local)
902  return m_tv->CheckChannel(name);
903 
904  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
905  return false;
906 }
907 
917 bool EncoderLink::ShouldSwitchToAnotherInput(const QString &channelid)
918 {
919  if (m_local)
920  return m_tv->ShouldSwitchToAnotherInput(channelid);
921 
922  LOG(VB_GENERAL, LOG_ERR,
923  "Should be local only query: ShouldSwitchToAnotherInput");
924  return false;
925 }
926 
935  const QString &prefix,
936  uint &complete_valid_channel_on_rec,
937  bool &is_extra_char_useful,
938  QString &needed_spacer)
939 {
940  if (m_local)
941  {
942  return m_tv->CheckChannelPrefix(
943  prefix, complete_valid_channel_on_rec,
944  is_extra_char_useful, needed_spacer);
945  }
946 
947  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
948  complete_valid_channel_on_rec = 0;
949  is_extra_char_useful = false;
950  needed_spacer = "";
951  return false;
952 }
953 
960  QString &title, QString &subtitle,
961  QString &desc, QString &category,
962  QString &starttime, QString &endtime,
963  QString &callsign, QString &iconpath,
964  QString &channelname, uint &_chanid,
965  QString &seriesid, QString &programid)
966 {
967  if (m_local)
968  {
969  m_tv->GetNextProgram(direction,
970  title, subtitle, desc, category, starttime,
971  endtime, callsign, iconpath, channelname,
972  _chanid, seriesid, programid);
973  }
974  else
975  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
976 }
977 
978 bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
979  QString &callsign, QString &channum,
980  QString &channame, QString &xmltv) const
981 {
982  if (!m_local)
983  {
984  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
985  return false;
986  }
987 
988  return m_tv->GetChannelInfo(chanid, sourceid,
989  callsign, channum, channame, xmltv);
990 }
991 
992 bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
993  const QString& oldchannum,
994  const QString& callsign, const QString& channum,
995  const QString& channame, const QString& xmltv)
996 {
997  if (!m_local)
998  {
999  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
1000  return false;
1001  }
1002 
1003  return m_tv->SetChannelInfo(chanid, sourceid, oldchannum,
1004  callsign, channum,
1005  channame, xmltv);
1006 }
1007 
1009 {
1010  if (m_local)
1011  {
1012  LOG(VB_GENERAL, LOG_ERR, LOC + "Called on local recorder");
1013  return false;
1014  }
1015 
1016  bool retval = m_sock->AddChildInput(childid);
1017  return retval;
1018 }
1019 
1020 /* vim: set expandtab tabstop=4 shiftwidth=4: */
ReferenceLocker
This decrements the reference on destruction.
Definition: referencecounter.h:66
RecStatus::Type
Type
Definition: recordingstatus.h:15
TVRec::GetKeyframeDurations
bool GetKeyframeDurations(int64_t start, int64_t end, frm_pos_map_t &map) const
Definition: tv_rec.cpp:2667
TVRec::IsReallyRecording
bool IsReallyRecording(void)
Returns true if frontend can consider the recorder started.
Definition: tv_rec.cpp:2514
TVRec::RecordPending
void RecordPending(const ProgramInfo *rcinfo, std::chrono::seconds secsleft, bool hasLater)
Tells TVRec "rcinfo" is the next pending recording.
Definition: tv_rec.cpp:310
PlaybackSock::GetDiskSpace
void GetDiskSpace(QStringList &o_strlist)
Appends host's dir's total and used space in kilobytes.
Definition: playbacksock.cpp:145
PlaybackSock::RecordPending
void RecordPending(int capturecardnum, const ProgramInfo *pginfo, std::chrono::seconds secsleft, bool hasLater)
Definition: playbacksock.cpp:490
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
PlaybackSock::EncoderIsRecording
bool EncoderIsRecording(int capturecardnum, const ProgramInfo *pginfo)
Definition: playbacksock.cpp:442
ChannelChangeDirection
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
Definition: tv.h:28
TVRec::ShouldSwitchToAnotherInput
bool ShouldSwitchToAnotherInput(const QString &chanid) const
Checks if named channel exists on current tuner, or another tuner.
Definition: tv_rec.cpp:2223
SleepStatus
SleepStatus
SleepStatus is an enumeration of the awake/sleep status of a slave.
Definition: tv.h:97
PictureAdjustType
PictureAdjustType
Definition: tv.h:120
RecStatus::Tuning
@ Tuning
Definition: recordingstatus.h:21
TVRec::IsBusy
bool IsBusy(InputInfo *busy_input=nullptr, std::chrono::seconds time_buffer=5s) const
Returns true if the recorder is busy, or will be within the next time_buffer seconds.
Definition: tv_rec.cpp:2525
TVRec::ToggleChannelFavorite
void ToggleChannelFavorite(const QString &changroupname)
Toggles whether the current channel should be on our favorites list.
Definition: tv_rec.cpp:2993
TVRec::SetInput
QString SetInput(QString input)
Changes to the specified input.
Definition: tv_rec.cpp:3101
TVRec::ChangeChannel
void ChangeChannel(ChannelChangeDirection dir)
Changes to a channel in the 'dir' channel change direction.
Definition: tv_rec.h:206
playbacksock.h
TVRec::FrontendReady
void FrontendReady(void)
Tells TVRec that the frontend's TV class is ready for messages.
Definition: tv_rec.h:164
TVRec::StopRecording
void StopRecording(bool killFile=false)
Changes from a recording state to kState_None.
Definition: tv_rec.cpp:746
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
TVRec::GetFramesWritten
long long GetFramesWritten(void)
Returns number of frames written to disk by recorder.
Definition: tv_rec.cpp:2608
TVRec::GetInput
QString GetInput(void) const
Returns current input.
Definition: tv_rec.cpp:3076
ProgramInfo::IsSameRecording
bool IsSameRecording(const ProgramInfo &other) const
Definition: programinfo.h:332
TVRec::CheckChannelPrefix
bool CheckChannelPrefix(const QString &prefix, uint &complete_valid_channel_on_rec, bool &is_extra_char_useful, QString &needed_spacer) const
Checks a prefix against the channels in the DB.
Definition: tv_rec.cpp:2359
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:412
TVRec::GetChainID
QString GetChainID(void)
Get the chainid of the livetv instance.
Definition: tv_rec.cpp:2741
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:14
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95
kState_Error
@ kState_Error
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:54
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:404
TVRec::GetFilePosition
long long GetFilePosition(void)
Returns total number of bytes written by RingBuffer.
Definition: tv_rec.cpp:2623
kState_ChangingState
@ kState_ChangingState
This is a placeholder state which we never actually enter, but is returned by GetState() when we are ...
Definition: tv.h:89
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
fileserverutil.h
mythdate.h
ProgramInfo::SetPathname
void SetPathname(const QString &pn)
Definition: programinfo.cpp:2438
TVRec::PauseRecorder
void PauseRecorder(void)
Tells "recorder" to pause, used for channel and input changes.
Definition: tv_rec.cpp:2965
programinfo.h
mythlogging.h
TVRec::GetMaxBitrate
long long GetMaxBitrate(void) const
Returns the maximum bits per second this recorder can produce.
Definition: tv_rec.cpp:2683
PlaybackSock::AddChildInput
bool AddChildInput(uint childid)
Tells a slave to add a child input.
Definition: playbacksock.cpp:548
compat.h
PlaybackSock::GetRecordingStatus
RecStatus::Type GetRecordingStatus(int capturecardnum)
Definition: playbacksock.cpp:473
TVRec::FinishRecording
void FinishRecording(void)
Tells TVRec to finish the current recording as soon as possible.
Definition: tv_rec.h:161
TVRec::CheckChannel
bool CheckChannel(const QString &name) const
Checks if named channel exists on current tuner.
Definition: tv_rec.cpp:2313
PlaybackSock::CancelNextRecording
void CancelNextRecording(int capturecardnum, bool cancel)
Definition: playbacksock.cpp:525
RecStatus::Failing
@ Failing
Definition: recordingstatus.h:17
GetPlaybackURL
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath)
Definition: fileserverutil.cpp:46
PlaybackSock::CheckFile
bool CheckFile(ProgramInfo *pginfo)
Definition: playbacksock.cpp:334
RecStatus::Aborted
@ Aborted
Definition: recordingstatus.h:27
sStatus_Asleep
@ sStatus_Asleep
A slave is considered asleep when it is not awake and not undefined.
Definition: tv.h:104
TVRec::GetPictureAttribute
int GetPictureAttribute(PictureAttribute attr)
Definition: tv_rec.cpp:3042
PlaybackSock::SetNextLiveTVDir
void SetNextLiveTVDir(int capturecardnum, const QString &dir)
Definition: playbacksock.cpp:516
TVRec::GetKeyframePositions
bool GetKeyframePositions(int64_t start, int64_t end, frm_pos_map_t &map) const
Returns byte position in RingBuffer of a keyframes according to recorder.
Definition: tv_rec.cpp:2656
uint
unsigned int uint
Definition: compat.h:81
PlaybackSock::GetEncoderState
int GetEncoderState(int capturecardnum)
Definition: playbacksock.cpp:392
TVRec::SetNextLiveTVDir
void SetNextLiveTVDir(QString dir)
Definition: tv_rec.cpp:4583
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
TVRec::GetFramerate
float GetFramerate(void)
Returns recordering frame rate from the recorder.
Definition: tv_rec.cpp:2593
PlaybackSock::SetSignalMonitoringRate
std::chrono::milliseconds SetSignalMonitoringRate(int capturecardnum, std::chrono::milliseconds rate, int notifyFrontend)
Definition: playbacksock.cpp:502
TVRec::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: tv_rec.cpp:710
PlaybackSock::StartRecording
RecStatus::Type StartRecording(int capturecardnum, ProgramInfo *pginfo)
Definition: playbacksock.cpp:455
PlaybackSock::GoToSleep
bool GoToSleep(void)
Tells a slave to go to sleep.
Definition: playbacksock.cpp:135
PlaybackSock
Definition: playbacksock.h:27
referencecounter.h
TVRec::GetRecording
ProgramInfo * GetRecording(void)
Allocates and returns a ProgramInfo for the current recording.
Definition: tv_rec.cpp:278
TVRec::SpawnLiveTV
void SpawnLiveTV(LiveTVChain *newchain, bool pip, QString startchan)
Tells TVRec to spawn a "Live TV" recorder.
Definition: tv_rec.cpp:2711
TVRec::CancelNextRecording
void CancelNextRecording(bool cancel)
Tells TVRec to cancel the upcoming recording.
Definition: tv_rec.cpp:386
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:45
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
TVRec::GetNextProgram
void GetNextProgram(BrowseDirection direction, QString &title, QString &subtitle, QString &desc, QString &category, QString &starttime, QString &endtime, QString &callsign, QString &iconpath, QString &channum, uint &chanid, QString &seriesid, QString &programid)
Definition: tv_rec.cpp:3203
PlaybackSock::GetRecording
ProgramInfo * GetRecording(uint cardid)
Returns the ProgramInfo being used by any current recording.
Definition: playbacksock.cpp:424
TVRec::GetKeyframePosition
int64_t GetKeyframePosition(uint64_t desired) const
Returns byte position in RingBuffer of a keyframe according to recorder.
Definition: tv_rec.cpp:2639
sStatus_Undefined
@ sStatus_Undefined
A slave's sleep status is undefined when it has never connected to the master backend or is not able ...
Definition: tv.h:117
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:372
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
RecStatus::Recording
@ Recording
Definition: recordingstatus.h:29
TVRec::GetChannelInfo
bool GetChannelInfo(uint &chanid, uint &sourceid, QString &callsign, QString &channum, QString &channame, QString &xmltvid) const
Definition: tv_rec.cpp:3329
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:50
mythcorecontext.h
ProgramInfo::IsLocal
bool IsLocal(void) const
Definition: programinfo.h:351
MythDate
Definition: mythdate.cpp:11
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:926
TVRec::SetSignalMonitoringRate
std::chrono::milliseconds SetSignalMonitoringRate(std::chrono::milliseconds rate, int notifyFrontend=1)
Sets the signal monitoring rate.
Definition: tv_rec.cpp:2169
std
Definition: mythchrono.h:23
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
TVRec::GetState
TVState GetState(void) const
Returns the TVState of the recorder.
Definition: tv_rec.cpp:264
tv_rec.h
kState_WatchingLiveTV
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
inputinfo.h
InputInfo
Definition: inputinfo.h:14
BrowseDirection
BrowseDirection
Used to request ProgramInfo for channel browsing.
Definition: tv.h:37
TVRec::GetFlags
uint GetFlags(void) const
Definition: tv_rec.h:245
TVRec::StartRecording
RecStatus::Type StartRecording(ProgramInfo *pginfo)
Tells TVRec to Start recording the program "rcinfo" as soon as possible.
Definition: tv_rec.cpp:436
TVRec::SetChannelInfo
bool SetChannelInfo(uint chanid, uint sourceid, const QString &oldchannum, const QString &callsign, const QString &channum, const QString &channame, const QString &xmltvid)
Definition: tv_rec.cpp:3370
TVRec::SetLiveRecording
void SetLiveRecording(int recording)
Tells the Scheduler about changes to the recording status of the LiveTV recording.
Definition: tv_rec.cpp:2872
TVRec::SetChannel
void SetChannel(const QString &name, uint requestType=kFlagDetect)
Changes to a named channel on the current tuner.
Definition: tv_rec.cpp:3127
TVRec::StopLiveTV
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: tv_rec.cpp:2918
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
TVRec::ChangePictureAttribute
int ChangePictureAttribute(PictureAdjustType type, PictureAttribute attr, bool direction)
Returns current value [0,100] if it succeeds, -1 otherwise.
Definition: tv_rec.cpp:3060
sStatus_Awake
@ sStatus_Awake
A slave is awake when it is connected to the master.
Definition: tv.h:100
PlaybackSock::IsBusy
bool IsBusy(int capturecardnum, InputInfo *busy_input=nullptr, std::chrono::seconds time_buffer=5s)
Definition: playbacksock.cpp:349
kState_RecordingOnly
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
Definition: tv.h:84
PlaybackSock::GetMaxBitrate
long long GetMaxBitrate(int capturecardnum)
Definition: playbacksock.cpp:409
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32