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  {
211  LOG(VB_GENERAL, LOG_ERR, QString("Broken for input: %1")
212  .arg(m_inputid));
213  }
214 
215  return retval;
216 }
217 
223 {
224  uint retval = 0;
225 
226  if (!IsConnected())
227  return retval;
228 
229  if (m_local)
230  retval = m_tv->GetFlags();
231  else if (HasSockAndIncrRef())
232  {
233  ReferenceLocker rlocker(m_sock);
234  retval = m_sock->GetEncoderState(m_inputid);
235  }
236  else
237  {
238  LOG(VB_GENERAL, LOG_ERR, LOC + "GetFlags failed");
239  }
240 
241  return retval;
242 }
243 
250 {
251  return (rec->GetChanID() == m_chanid &&
253 }
254 
264 {
265  bool retval = false;
266  ProgramInfo *tvrec = nullptr;
267 
268  if (m_local)
269  {
270  while (kState_ChangingState == GetState())
271  std::this_thread::sleep_for(100us);
272 
273  if (IsBusyRecording())
274  tvrec = m_tv->GetRecording();
275 
276  if (tvrec)
277  {
278  retval = tvrec->IsSameRecording(*rec);
279  delete tvrec;
280  }
281  }
282  else
283  {
284  if (HasSockAndIncrRef())
285  {
286  ReferenceLocker rlocker(m_sock);
287  retval = m_sock->EncoderIsRecording(m_inputid, rec);
288  }
289  }
290 
291  return retval;
292 }
293 
303  std::chrono::seconds secsleft,
304  bool hasLater)
305 {
306  if (m_local)
307  m_tv->RecordPending(rec, secsleft, hasLater);
308  else if (HasSockAndIncrRef())
309  {
310  ReferenceLocker rlocker(m_sock);
311  m_sock->RecordPending(m_inputid, rec, secsleft, hasLater);
312  }
313 }
314 
321 {
322  if (!IsConnected())
323  return true;
324 
326  return true;
327 
328  return false;
329 }
330 
333 {
334  if (HasSockAndIncrRef())
335  {
336  ReferenceLocker rlocker(m_sock);
337  return m_sock->CheckFile(pginfo);
338  }
339  pginfo->SetPathname(GetPlaybackURL(pginfo));
340  return pginfo->IsLocal();
341 }
342 
348 void EncoderLink::GetDiskSpace(QStringList &o_strlist)
349 {
350  if (HasSockAndIncrRef())
351  {
352  ReferenceLocker rlocker(m_sock);
353  m_sock->GetDiskSpace(o_strlist);
354  }
355 }
356 
364 {
365  if (m_local)
366  return m_tv->GetMaxBitrate();
367  if (HasSockAndIncrRef())
368  {
369  ReferenceLocker rlocker(m_sock);
370  return m_sock->GetMaxBitrate(m_inputid);
371  }
372 
373  return -1;
374 }
375 
390 std::chrono::milliseconds EncoderLink::SetSignalMonitoringRate(std::chrono::milliseconds rate, int notifyFrontend)
391 {
392  if (m_local)
393  return m_tv->SetSignalMonitoringRate(rate, notifyFrontend);
394  if (HasSockAndIncrRef())
395  {
396  ReferenceLocker rlocker(m_sock);
398  notifyFrontend);
399  }
400  return -1ms;
401 }
402 
406 {
407  if (IsLocal() || !HasSockAndIncrRef())
408  return false;
409  ReferenceLocker rlocker(m_sock);
410 
412 
413  return m_sock->GoToSleep();
414 }
415 
421 {
422  if (m_locked)
423  return -2;
424 
425  m_locked = true;
426  return m_inputid;
427 }
428 
436 {
438 
441  m_chanid = rec->GetChanID();
442 
443  if (m_local)
444  retval = m_tv->StartRecording(rec);
445  else if (HasSockAndIncrRef())
446  {
447  ReferenceLocker rlocker(m_sock);
448  retval = m_sock->StartRecording(m_inputid, rec);
449  }
450  else
451  {
452  LOG(VB_GENERAL, LOG_ERR,
453  QString("Wanted to start recording on recorder %1,\n\t\t\t"
454  "but the backend is not there anymore\n")
455  .arg(m_inputid));
456  }
457 
458  if (retval != RecStatus::Recording &&
459  retval != RecStatus::Tuning &&
460  retval != RecStatus::Failing)
461  {
462  m_endRecordingTime = MythDate::current().addDays(-2);
464  m_chanid = 0;
465  }
466 
467  return retval;
468 }
469 
471 {
473 
474  if (m_local)
475  retval = m_tv->GetRecordingStatus();
476  else if (HasSockAndIncrRef())
477  {
478  ReferenceLocker rlocker(m_sock);
480  }
481  else
482  {
483  LOG(VB_GENERAL, LOG_ERR,
484  QString("Wanted to get status on recorder %1,\n\t\t\t"
485  "but the backend is not there anymore\n")
486  .arg(m_inputid));
487  }
488 
489  if (retval != RecStatus::Recording &&
490  retval != RecStatus::Tuning &&
491  retval != RecStatus::Failing)
492  {
493  m_endRecordingTime = MythDate::current().addDays(-2);
495  m_chanid = 0;
496  }
497 
498  return retval;
499 }
500 
508 {
509  ProgramInfo *info = nullptr;
510 
511  if (m_local)
512  info = m_tv->GetRecording();
513  else if (HasSockAndIncrRef())
514  {
515  ReferenceLocker rlocker(m_sock);
517  }
518 
519  return info;
520 }
521 
527 void EncoderLink::StopRecording(bool killFile)
528 {
529  m_endRecordingTime = MythDate::current().addDays(-2);
531  m_chanid = 0;
532 
533  if (m_local)
534  {
535  m_tv->StopRecording(killFile);
536  return;
537  }
538 }
539 
546 {
547  if (m_local)
548  {
550  return;
551  }
552  m_endRecordingTime = MythDate::current().addDays(-2);
553 }
554 
561 {
562  if (m_local)
563  return m_tv->IsReallyRecording();
564 
565  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
566  return false;
567 }
568 
577 {
578  if (m_local)
579  return m_tv->GetFramerate();
580 
581  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
582  return -1;
583 }
584 
593 {
594  if (m_local)
595  return m_tv->GetFramesWritten();
596 
597  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
598  return -1;
599 }
600 
608 {
609  if (m_local)
610  return m_tv->GetFilePosition();
611 
612  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
613  return -1;
614 }
615 
622 int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
623 {
624  if (m_local)
625  return m_tv->GetKeyframePosition(desired);
626 
627  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
628  return -1;
629 }
630 
632  int64_t start, int64_t end, frm_pos_map_t &map)
633 {
634  if (!m_local)
635  {
636  LOG(VB_GENERAL, LOG_ERR,
637  "Should be local only query: GetKeyframePositions");
638  return false;
639  }
640 
641  return m_tv->GetKeyframePositions(start, end, map);
642 }
643 
645  int64_t start, int64_t end, frm_pos_map_t &map)
646 {
647  if (!m_local)
648  {
649  LOG(VB_GENERAL, LOG_ERR,
650  "Should be local only query: GetKeyframeDurations");
651  return false;
652  }
653 
654  return m_tv->GetKeyframeDurations(start, end, map);
655 }
656 
663 {
664  if (m_local)
665  m_tv->FrontendReady();
666  else
667  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
668 }
669 
679 {
680  if (m_local)
681  m_tv->CancelNextRecording(cancel);
682  else if (HasSockAndIncrRef())
683  {
684  ReferenceLocker rlocker(m_sock);
686  }
687 }
688 
700 void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
701 {
702  if (m_local)
703  m_tv->SpawnLiveTV(chain, pip, std::move(startchan));
704  else
705  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
706 }
707 
712 {
713  if (m_local)
714  return m_tv->GetChainID();
715 
716  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
717  return "";
718 }
719 
726 {
727  if (m_local)
728  m_tv->StopLiveTV();
729  else
730  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
731 }
732 
740 {
741  if (m_local)
742  m_tv->PauseRecorder();
743  else
744  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
745 }
746 
752 void EncoderLink::SetLiveRecording(int recording)
753 {
754  if (m_local)
755  m_tv->SetLiveRecording(recording);
756  else
757  LOG(VB_GENERAL, LOG_ERR,
758  "Should be local only query: SetLiveRecording");
759 }
760 
764 void EncoderLink::SetNextLiveTVDir(const QString& dir)
765 {
766  if (m_local)
767  m_tv->SetNextLiveTVDir(dir);
768  else if (HasSockAndIncrRef())
769  {
770  ReferenceLocker rlocker(m_sock);
772  }
773 }
774 
781 QString EncoderLink::GetInput(void) const
782 {
783  if (m_local)
784  return m_tv->GetInput();
785 
786  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
787  return {};
788 }
789 
800 QString EncoderLink::SetInput(QString input)
801 {
802  if (m_local)
803  return m_tv->SetInput(std::move(input));
804 
805  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
806  return {};
807 }
808 
814 void EncoderLink::ToggleChannelFavorite(const QString& changroup)
815 {
816  if (m_local)
817  m_tv->ToggleChannelFavorite(changroup);
818  else
819  LOG(VB_GENERAL, LOG_ERR,
820  "Should be local only query: ToggleChannelFavorite");
821 }
822 
830 {
831  if (m_local)
832  m_tv->ChangeChannel(channeldirection);
833  else
834  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
835 }
836 
844 void EncoderLink::SetChannel(const QString &name)
845 {
846  if (m_local)
847  m_tv->SetChannel(name);
848  else
849  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
850 }
851 
861 {
862  if (!m_local)
863  {
864  LOG(VB_GENERAL, LOG_ERR,
865  "Should be local only query: GetPictureAttribute");
866  return -1;
867  }
868 
869  return m_tv->GetPictureAttribute(attr);
870 }
871 
881  PictureAttribute attr,
882  bool direction)
883 {
884  if (!m_local)
885  {
886  LOG(VB_GENERAL, LOG_ERR,
887  "Should be local only query: ChangePictureAttribute");
888  return -1;
889  }
890 
891  return m_tv->ChangePictureAttribute(type, attr, direction);
892 }
893 
903 bool EncoderLink::CheckChannel(const QString &name)
904 {
905  if (m_local)
906  return m_tv->CheckChannel(name);
907 
908  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
909  return false;
910 }
911 
921 bool EncoderLink::ShouldSwitchToAnotherInput(const QString &channelid)
922 {
923  if (m_local)
924  return m_tv->ShouldSwitchToAnotherInput(channelid);
925 
926  LOG(VB_GENERAL, LOG_ERR,
927  "Should be local only query: ShouldSwitchToAnotherInput");
928  return false;
929 }
930 
939  const QString &prefix,
940  uint &complete_valid_channel_on_rec,
941  bool &is_extra_char_useful,
942  QString &needed_spacer)
943 {
944  if (m_local)
945  {
946  return m_tv->CheckChannelPrefix(
947  prefix, complete_valid_channel_on_rec,
948  is_extra_char_useful, needed_spacer);
949  }
950 
951  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
952  complete_valid_channel_on_rec = 0;
953  is_extra_char_useful = false;
954  needed_spacer = "";
955  return false;
956 }
957 
964  QString &title, QString &subtitle,
965  QString &desc, QString &category,
966  QString &starttime, QString &endtime,
967  QString &callsign, QString &iconpath,
968  QString &channelname, uint &_chanid,
969  QString &seriesid, QString &programid)
970 {
971  if (m_local)
972  {
973  m_tv->GetNextProgram(direction,
974  title, subtitle, desc, category, starttime,
975  endtime, callsign, iconpath, channelname,
976  _chanid, seriesid, programid);
977  }
978  else
979  {
980  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
981  }
982 }
983 
984 bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
985  QString &callsign, QString &channum,
986  QString &channame, QString &xmltv) const
987 {
988  if (!m_local)
989  {
990  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
991  return false;
992  }
993 
994  return m_tv->GetChannelInfo(chanid, sourceid,
995  callsign, channum, channame, xmltv);
996 }
997 
998 bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
999  const QString& oldchannum,
1000  const QString& callsign, const QString& channum,
1001  const QString& channame, const QString& xmltv)
1002 {
1003  if (!m_local)
1004  {
1005  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
1006  return false;
1007  }
1008 
1009  return m_tv->SetChannelInfo(chanid, sourceid, oldchannum,
1010  callsign, channum,
1011  channame, xmltv);
1012 }
1013 
1015 {
1016  if (m_local)
1017  {
1018  LOG(VB_GENERAL, LOG_ERR, LOC + "Called on local recorder");
1019  return false;
1020  }
1021 
1022  bool retval = m_sock->AddChildInput(childid);
1023  return retval;
1024 }
1025 
1026 /* vim: set expandtab tabstop=4 shiftwidth=4: */
ReferenceLocker
This decrements the reference on destruction.
Definition: referencecounter.h:66
BrowseDirection
BrowseDirection
Used to request ProgramInfo for channel browsing.
Definition: tv.h:40
RecStatus::Type
Type
Definition: recordingstatus.h:16
TVRec::GetKeyframeDurations
bool GetKeyframeDurations(int64_t start, int64_t end, frm_pos_map_t &map) const
Definition: tv_rec.cpp:2682
TVRec::IsReallyRecording
bool IsReallyRecording(void)
Returns true if frontend can consider the recorder started.
Definition: tv_rec.cpp:2529
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:312
PlaybackSock::GetDiskSpace
void GetDiskSpace(QStringList &o_strlist)
Appends host's dir's total and used space in kilobytes.
Definition: playbacksock.cpp:143
PlaybackSock::RecordPending
void RecordPending(int capturecardnum, const ProgramInfo *pginfo, std::chrono::seconds secsleft, bool hasLater)
Definition: playbacksock.cpp:488
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
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:440
TVRec::ShouldSwitchToAnotherInput
bool ShouldSwitchToAnotherInput(const QString &chanid) const
Checks if named channel exists on current tuner, or another tuner.
Definition: tv_rec.cpp:2238
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:120
ChannelChangeDirection
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
Definition: tv.h:31
RecStatus::Tuning
@ Tuning
Definition: recordingstatus.h:22
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:2540
TVRec::ToggleChannelFavorite
void ToggleChannelFavorite(const QString &changroupname)
Toggles whether the current channel should be on our favorites list.
Definition: tv_rec.cpp:3008
TVRec::SetInput
QString SetInput(QString input)
Changes to the specified input.
Definition: tv_rec.cpp:3116
SleepStatus
SleepStatus
SleepStatus is an enumeration of the awake/sleep status of a slave.
Definition: tv.h:100
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:748
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:2623
TVRec::GetInput
QString GetInput(void) const
Returns current input.
Definition: tv_rec.cpp:3091
ProgramInfo::IsSameRecording
bool IsSameRecording(const ProgramInfo &other) const
Definition: programinfo.h:333
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:2374
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:413
TVRec::GetChainID
QString GetChainID(void)
Get the chainid of the livetv instance.
Definition: tv_rec.cpp:2756
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
ProgramInfo::GetRecordingStartTime
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
Definition: programinfo.h:405
TVRec::GetFilePosition
long long GetFilePosition(void)
Returns total number of bytes written by RingBuffer.
Definition: tv_rec.cpp:2638
sStatus_Awake
@ sStatus_Awake
A slave is awake when it is connected to the master.
Definition: tv.h:103
fileserverutil.h
mythdate.h
ProgramInfo::SetPathname
void SetPathname(const QString &pn)
Definition: programinfo.cpp:2443
TVRec::PauseRecorder
void PauseRecorder(void)
Tells "recorder" to pause, used for channel and input changes.
Definition: tv_rec.cpp:2980
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:2698
PlaybackSock::AddChildInput
bool AddChildInput(uint childid)
Tells a slave to add a child input.
Definition: playbacksock.cpp:546
compat.h
PlaybackSock::GetRecordingStatus
RecStatus::Type GetRecordingStatus(int capturecardnum)
Definition: playbacksock.cpp:471
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:2328
PlaybackSock::CancelNextRecording
void CancelNextRecording(int capturecardnum, bool cancel)
Definition: playbacksock.cpp:523
RecStatus::Failing
@ Failing
Definition: recordingstatus.h:18
GetPlaybackURL
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath)
Definition: fileserverutil.cpp:46
PlaybackSock::CheckFile
bool CheckFile(ProgramInfo *pginfo)
Definition: playbacksock.cpp:332
RecStatus::Aborted
@ Aborted
Definition: recordingstatus.h:28
sStatus_Asleep
@ sStatus_Asleep
A slave is considered asleep when it is not awake and not undefined.
Definition: tv.h:107
kState_Error
@ kState_Error
Error State, if we ever try to enter this state errored is set.
Definition: tv.h:57
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:66
TVRec::GetPictureAttribute
int GetPictureAttribute(PictureAttribute attr)
Definition: tv_rec.cpp:3057
PlaybackSock::SetNextLiveTVDir
void SetNextLiveTVDir(int capturecardnum, const QString &dir)
Definition: playbacksock.cpp:514
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:2671
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:92
uint
unsigned int uint
Definition: compat.h:81
PlaybackSock::GetEncoderState
int GetEncoderState(int capturecardnum)
Definition: playbacksock.cpp:390
TVRec::SetNextLiveTVDir
void SetNextLiveTVDir(QString dir)
Definition: tv_rec.cpp:4600
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:2608
PlaybackSock::SetSignalMonitoringRate
std::chrono::milliseconds SetSignalMonitoringRate(int capturecardnum, std::chrono::milliseconds rate, int notifyFrontend)
Definition: playbacksock.cpp:500
TVRec::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: tv_rec.cpp:712
PlaybackSock::StartRecording
RecStatus::Type StartRecording(int capturecardnum, ProgramInfo *pginfo)
Definition: playbacksock.cpp:453
PlaybackSock::GoToSleep
bool GoToSleep(void)
Tells a slave to go to sleep.
Definition: playbacksock.cpp:133
PlaybackSock
Definition: playbacksock.h:27
referencecounter.h
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:83
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:2726
TVRec::CancelNextRecording
void CancelNextRecording(bool cancel)
Tells TVRec to cancel the upcoming recording.
Definition: tv_rec.cpp:388
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:45
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:3218
PlaybackSock::GetRecording
ProgramInfo * GetRecording(uint cardid)
Returns the ProgramInfo being used by any current recording.
Definition: playbacksock.cpp:422
TVRec::GetKeyframePosition
int64_t GetKeyframePosition(uint64_t desired) const
Returns byte position in RingBuffer of a keyframe according to recorder.
Definition: tv_rec.cpp:2654
ProgramInfo::GetChanID
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Definition: programinfo.h:373
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
RecStatus::Recording
@ Recording
Definition: recordingstatus.h:30
TVRec::GetChannelInfo
bool GetChannelInfo(uint &chanid, uint &sourceid, QString &callsign, QString &channum, QString &channame, QString &xmltvid) const
Definition: tv_rec.cpp:3344
mythcorecontext.h
ProgramInfo::IsLocal
bool IsLocal(void) const
Definition: programinfo.h:352
MythDate
Definition: mythdate.cpp:11
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:930
TVRec::SetSignalMonitoringRate
std::chrono::milliseconds SetSignalMonitoringRate(std::chrono::milliseconds rate, int notifyFrontend=1)
Sets the signal monitoring rate.
Definition: tv_rec.cpp:2184
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:142
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:53
TVRec::GetState
TVState GetState(void) const
Returns the TVState of the recorder.
Definition: tv_rec.cpp:264
tv_rec.h
inputinfo.h
InputInfo
Definition: inputinfo.h:14
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:87
TVRec::GetFlags
uint GetFlags(void) const
Definition: tv_rec.h:245
azlyrics.info
dictionary info
Definition: azlyrics.py:7
TVRec::StartRecording
RecStatus::Type StartRecording(ProgramInfo *pginfo)
Tells TVRec to Start recording the program "rcinfo" as soon as possible.
Definition: tv_rec.cpp:438
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:3385
TVRec::SetLiveRecording
void SetLiveRecording(int recording)
Tells the Scheduler about changes to the recording status of the LiveTV recording.
Definition: tv_rec.cpp:2887
TVRec::SetChannel
void SetChannel(const QString &name, uint requestType=kFlagDetect)
Changes to a named channel on the current tuner.
Definition: tv_rec.cpp:3142
TVRec::StopLiveTV
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: tv_rec.cpp:2933
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:3075
PlaybackSock::IsBusy
bool IsBusy(int capturecardnum, InputInfo *busy_input=nullptr, std::chrono::seconds time_buffer=5s)
Definition: playbacksock.cpp:347
PlaybackSock::GetMaxBitrate
long long GetMaxBitrate(int capturecardnum)
Definition: playbacksock.cpp:407
PictureAdjustType
PictureAdjustType
Definition: tv.h:123
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32