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 
5 // QT headers
6 #include <QMap> // for QMap
7 #include <utility>
8 
9 // MythTV headers
10 #include "mythcorecontext.h"
11 #include "encoderlink.h"
12 #include "playbacksock.h"
13 #include "tv_rec.h"
14 #include "mythdate.h"
16 #include "compat.h"
17 #include "referencecounter.h"
18 #include "inputinfo.h" // for InputInfo
19 #include "mythlogging.h" // for LOG
20 #include "programinfo.h" // for ProgramInfo
21 
22 #define LOC QString("EncoderLink(%1): ").arg(m_inputid)
23 #define LOC_ERR QString("EncoderLink(%1) Error: ").arg(m_inputid)
24 
44  QString lhostname)
45  : m_inputid(inputid), m_sock(lsock), m_hostname(std::move(lhostname)),
46  m_sleepStatusTime(MythDate::current()),
47  m_lastSleepTime(MythDate::current()),
48  m_lastWakeTime(MythDate::current()),
49  m_endRecordingTime(MythDate::current().addDays(-2)),
50  m_startRecordingTime(m_endRecordingTime)
51 {
53 }
54 
58 EncoderLink::EncoderLink(int inputid, TVRec *ltv)
59  : m_inputid(inputid), m_tv(ltv), m_local(true),
60  m_sleepStatusTime(MythDate::current()),
61  m_lastSleepTime(MythDate::current()),
62  m_lastWakeTime(MythDate::current()),
63  m_endRecordingTime(MythDate::current().addDays(-2)),
64  m_startRecordingTime(m_endRecordingTime)
65 {
66 }
67 
73 {
74  if (m_tv)
75  {
76  delete m_tv;
77  m_tv = nullptr;
78  }
79  SetSocket(nullptr);
80 }
81 
86 {
87  QMutexLocker locker(&m_sockLock);
88  if (m_sock)
89  {
90  m_sock->IncrRef();
91  return true;
92  }
93  return false;
94 }
95 
100 {
101  QMutexLocker locker(&m_sockLock);
102  if (m_sock)
103  {
104  m_sock->DecrRef();
105  return true;
106  }
107  return false;
108 }
109 
116 {
117  if (lsock)
118  {
119  lsock->IncrRef();
120 
121  if (gCoreContext->GetSettingOnHost("SleepCommand", m_hostname).isEmpty())
123  else
125  }
126  else
127  {
128  if (IsFallingAsleep())
130  else
132  }
133 
135  m_sock = lsock;
136 }
137 
142 {
143  m_sleepStatus = newStatus;
145 }
146 
152 bool EncoderLink::IsBusy(InputInfo *busy_input, int time_buffer)
153 {
154  if (m_local)
155  return m_tv->IsBusy(busy_input, time_buffer);
156 
157  if (HasSockAndIncrRef())
158  {
159  ReferenceLocker rlocker(m_sock);
160  return m_sock->IsBusy(m_inputid, busy_input, time_buffer);
161  }
162 
163  return false;
164 }
165 
175 {
176  bool retval = false;
177 
178  TVState state = GetState();
179 
180  if (state == kState_RecordingOnly || state == kState_WatchingRecording ||
181  state == kState_WatchingLiveTV)
182  {
183  retval = true;
184  }
185 
186  return retval;
187 }
188 
194 {
195  TVState retval = kState_Error;
196 
197  if (!IsConnected())
198  return retval;
199 
200  if (m_local)
201  retval = m_tv->GetState();
202  else if (HasSockAndIncrRef())
203  {
204  ReferenceLocker rlocker(m_sock);
206  }
207  else
208  LOG(VB_GENERAL, LOG_ERR, QString("Broken for input: %1")
209  .arg(m_inputid));
210 
211  return retval;
212 }
213 
219 {
220  uint retval = 0;
221 
222  if (!IsConnected())
223  return retval;
224 
225  if (m_local)
226  retval = m_tv->GetFlags();
227  else if (HasSockAndIncrRef())
228  {
229  ReferenceLocker rlocker(m_sock);
230  retval = m_sock->GetEncoderState(m_inputid);
231  }
232  else
233  LOG(VB_GENERAL, LOG_ERR, LOC + "GetFlags failed");
234 
235  return retval;
236 }
237 
244 {
245  return (rec->GetChanID() == m_chanid &&
247 }
248 
258 {
259  bool retval = false;
260  ProgramInfo *tvrec = nullptr;
261 
262  if (m_local)
263  {
264  while (kState_ChangingState == GetState())
265  std::this_thread::sleep_for(std::chrono::microseconds(100));
266 
267  if (IsBusyRecording())
268  tvrec = m_tv->GetRecording();
269 
270  if (tvrec)
271  {
272  retval = tvrec->IsSameRecording(*rec);
273  delete tvrec;
274  }
275  }
276  else
277  {
278  if (HasSockAndIncrRef())
279  {
280  ReferenceLocker rlocker(m_sock);
281  retval = m_sock->EncoderIsRecording(m_inputid, rec);
282  }
283  }
284 
285  return retval;
286 }
287 
296 void EncoderLink::RecordPending(const ProgramInfo *rec, int secsleft,
297  bool hasLater)
298 {
299  if (m_local)
300  m_tv->RecordPending(rec, secsleft, hasLater);
301  else if (HasSockAndIncrRef())
302  {
303  ReferenceLocker rlocker(m_sock);
304  m_sock->RecordPending(m_inputid, rec, secsleft, hasLater);
305  }
306 }
307 
314 {
315  if (!IsConnected())
316  return true;
317 
319  return true;
320 
321  return false;
322 }
323 
326 {
327  if (HasSockAndIncrRef())
328  {
329  ReferenceLocker rlocker(m_sock);
330  return m_sock->CheckFile(pginfo);
331  }
332 
333  pginfo->SetPathname(GetPlaybackURL(pginfo));
334  return pginfo->IsLocal();
335 }
336 
342 void EncoderLink::GetDiskSpace(QStringList &o_strlist)
343 {
344  if (HasSockAndIncrRef())
345  {
346  ReferenceLocker rlocker(m_sock);
347  m_sock->GetDiskSpace(o_strlist);
348  }
349 }
350 
358 {
359  if (m_local)
360  return m_tv->GetMaxBitrate();
361  if (HasSockAndIncrRef())
362  {
363  ReferenceLocker rlocker(m_sock);
364  return m_sock->GetMaxBitrate(m_inputid);
365  }
366 
367  return -1;
368 }
369 
384 int EncoderLink::SetSignalMonitoringRate(int rate, int notifyFrontend)
385 {
386  if (m_local)
387  return m_tv->SetSignalMonitoringRate(rate, notifyFrontend);
388  if (HasSockAndIncrRef())
389  {
390  ReferenceLocker rlocker(m_sock);
392  notifyFrontend);
393  }
394  return -1;
395 }
396 
400 {
401  if (IsLocal() || !HasSockAndIncrRef())
402  return false;
403  ReferenceLocker rlocker(m_sock);
404 
406 
407  return m_sock->GoToSleep();
408 }
409 
415 {
416  if (m_locked)
417  return -2;
418 
419  m_locked = true;
420  return m_inputid;
421 }
422 
430 {
432 
435  m_chanid = rec->GetChanID();
436 
437  if (m_local)
438  retval = m_tv->StartRecording(rec);
439  else if (HasSockAndIncrRef())
440  {
441  ReferenceLocker rlocker(m_sock);
442  retval = m_sock->StartRecording(m_inputid, rec);
443  }
444  else
445  {
446  LOG(VB_GENERAL, LOG_ERR,
447  QString("Wanted to start recording on recorder %1,\n\t\t\t"
448  "but the backend is not there anymore\n")
449  .arg(m_inputid));
450  }
451 
452  if (retval != RecStatus::Recording &&
453  retval != RecStatus::Tuning &&
454  retval != RecStatus::Failing)
455  {
456  m_endRecordingTime = MythDate::current().addDays(-2);
458  m_chanid = 0;
459  }
460 
461  return retval;
462 }
463 
465 {
467 
468  if (m_local)
469  retval = m_tv->GetRecordingStatus();
470  else if (HasSockAndIncrRef())
471  {
472  ReferenceLocker rlocker(m_sock);
474  }
475  else
476  {
477  LOG(VB_GENERAL, LOG_ERR,
478  QString("Wanted to get status on recorder %1,\n\t\t\t"
479  "but the backend is not there anymore\n")
480  .arg(m_inputid));
481  }
482 
483  if (retval != RecStatus::Recording &&
484  retval != RecStatus::Tuning &&
485  retval != RecStatus::Failing)
486  {
487  m_endRecordingTime = MythDate::current().addDays(-2);
489  m_chanid = 0;
490  }
491 
492  return retval;
493 }
494 
502 {
503  ProgramInfo *info = nullptr;
504 
505  if (m_local)
506  info = m_tv->GetRecording();
507  else if (HasSockAndIncrRef())
508  {
509  ReferenceLocker rlocker(m_sock);
510  info = m_sock->GetRecording(m_inputid);
511  }
512 
513  return info;
514 }
515 
521 void EncoderLink::StopRecording(bool killFile)
522 {
523  m_endRecordingTime = MythDate::current().addDays(-2);
525  m_chanid = 0;
526 
527  if (m_local)
528  {
529  m_tv->StopRecording(killFile);
530  return;
531  }
532 }
533 
540 {
541  if (m_local)
542  {
544  return;
545  }
546  m_endRecordingTime = MythDate::current().addDays(-2);
547 }
548 
555 {
556  if (m_local)
557  return m_tv->IsReallyRecording();
558 
559  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: IsReallyRecording");
560  return false;
561 }
562 
571 {
572  if (m_local)
573  return m_tv->GetFramerate();
574 
575  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramerate");
576  return -1;
577 }
578 
587 {
588  if (m_local)
589  return m_tv->GetFramesWritten();
590 
591  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFramesWritten");
592  return -1;
593 }
594 
602 {
603  if (m_local)
604  return m_tv->GetFilePosition();
605 
606  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetFilePosition");
607  return -1;
608 }
609 
616 int64_t EncoderLink::GetKeyframePosition(uint64_t desired)
617 {
618  if (m_local)
619  return m_tv->GetKeyframePosition(desired);
620 
621  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetKeyframePosition");
622  return -1;
623 }
624 
626  int64_t start, int64_t end, frm_pos_map_t &map)
627 {
628  if (!m_local)
629  {
630  LOG(VB_GENERAL, LOG_ERR,
631  "Should be local only query: GetKeyframePositions");
632  return false;
633  }
634 
635  return m_tv->GetKeyframePositions(start, end, map);
636 }
637 
639  int64_t start, int64_t end, frm_pos_map_t &map)
640 {
641  if (!m_local)
642  {
643  LOG(VB_GENERAL, LOG_ERR,
644  "Should be local only query: GetKeyframeDurations");
645  return false;
646  }
647 
648  return m_tv->GetKeyframeDurations(start, end, map);
649 }
650 
657 {
658  if (m_local)
659  m_tv->FrontendReady();
660  else
661  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: FrontendReady");
662 }
663 
673 {
674  if (m_local)
675  m_tv->CancelNextRecording(cancel);
676  else if (HasSockAndIncrRef())
677  {
678  ReferenceLocker rlocker(m_sock);
680  }
681 }
682 
694 void EncoderLink::SpawnLiveTV(LiveTVChain *chain, bool pip, QString startchan)
695 {
696  if (m_local)
697  m_tv->SpawnLiveTV(chain, pip, std::move(startchan));
698  else
699  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
700 }
701 
706 {
707  if (m_local)
708  return m_tv->GetChainID();
709 
710  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SpawnLiveTV");
711  return "";
712 }
713 
720 {
721  if (m_local)
722  m_tv->StopLiveTV();
723  else
724  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: StopLiveTV");
725 }
726 
734 {
735  if (m_local)
736  m_tv->PauseRecorder();
737  else
738  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: PauseRecorder");
739 }
740 
746 void EncoderLink::SetLiveRecording(int recording)
747 {
748  if (m_local)
749  m_tv->SetLiveRecording(recording);
750  else
751  LOG(VB_GENERAL, LOG_ERR,
752  "Should be local only query: SetLiveRecording");
753 }
754 
758 void EncoderLink::SetNextLiveTVDir(const QString& dir)
759 {
760  if (m_local)
762  else if (HasSockAndIncrRef())
763  {
764  ReferenceLocker rlocker(m_sock);
766  }
767 }
768 
775 QString EncoderLink::GetInput(void) const
776 {
777  if (m_local)
778  return m_tv->GetInput();
779 
780  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetInput");
781  return QString();
782 }
783 
794 QString EncoderLink::SetInput(QString input)
795 {
796  if (m_local)
797  return m_tv->SetInput(std::move(input));
798 
799  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetInput");
800  return QString();
801 }
802 
808 void EncoderLink::ToggleChannelFavorite(const QString& changroup)
809 {
810  if (m_local)
811  m_tv->ToggleChannelFavorite(changroup);
812  else
813  LOG(VB_GENERAL, LOG_ERR,
814  "Should be local only query: ToggleChannelFavorite");
815 }
816 
824 {
825  if (m_local)
826  m_tv->ChangeChannel(channeldirection);
827  else
828  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: ChangeChannel");
829 }
830 
838 void EncoderLink::SetChannel(const QString &name)
839 {
840  if (m_local)
841  m_tv->SetChannel(name);
842  else
843  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannel");
844 }
845 
855 {
856  if (!m_local)
857  {
858  LOG(VB_GENERAL, LOG_ERR,
859  "Should be local only query: GetPictureAttribute");
860  return -1;
861  }
862 
863  return m_tv->GetPictureAttribute(attr);
864 }
865 
875  PictureAttribute attr,
876  bool direction)
877 {
878  if (!m_local)
879  {
880  LOG(VB_GENERAL, LOG_ERR,
881  "Should be local only query: ChangePictureAttribute");
882  return -1;
883  }
884 
885  return m_tv->ChangePictureAttribute(type, attr, direction);
886 }
887 
897 bool EncoderLink::CheckChannel(const QString &name)
898 {
899  if (m_local)
900  return m_tv->CheckChannel(name);
901 
902  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannel");
903  return false;
904 }
905 
915 bool EncoderLink::ShouldSwitchToAnotherInput(const QString &channelid)
916 {
917  if (m_local)
918  return m_tv->ShouldSwitchToAnotherInput(channelid);
919 
920  LOG(VB_GENERAL, LOG_ERR,
921  "Should be local only query: ShouldSwitchToAnotherInput");
922  return false;
923 }
924 
933  const QString &prefix,
934  uint &complete_valid_channel_on_rec,
935  bool &is_extra_char_useful,
936  QString &needed_spacer)
937 {
938  if (m_local)
939  {
940  return m_tv->CheckChannelPrefix(
941  prefix, complete_valid_channel_on_rec,
942  is_extra_char_useful, needed_spacer);
943  }
944 
945  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: CheckChannelPrefix");
946  complete_valid_channel_on_rec = 0;
947  is_extra_char_useful = false;
948  needed_spacer = "";
949  return false;
950 }
951 
958  QString &title, QString &subtitle,
959  QString &desc, QString &category,
960  QString &starttime, QString &endtime,
961  QString &callsign, QString &iconpath,
962  QString &channelname, uint &_chanid,
963  QString &seriesid, QString &programid)
964 {
965  if (m_local)
966  {
967  m_tv->GetNextProgram(direction,
968  title, subtitle, desc, category, starttime,
969  endtime, callsign, iconpath, channelname,
970  _chanid, seriesid, programid);
971  }
972  else
973  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetNextProgram");
974 }
975 
976 bool EncoderLink::GetChannelInfo(uint &chanid, uint &sourceid,
977  QString &callsign, QString &channum,
978  QString &channame, QString &xmltv) const
979 {
980  if (!m_local)
981  {
982  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: GetChannelInfo");
983  return false;
984  }
985 
986  return m_tv->GetChannelInfo(chanid, sourceid,
987  callsign, channum, channame, xmltv);
988 }
989 
990 bool EncoderLink::SetChannelInfo(uint chanid, uint sourceid,
991  const QString& oldchannum,
992  const QString& callsign, const QString& channum,
993  const QString& channame, const QString& xmltv)
994 {
995  if (!m_local)
996  {
997  LOG(VB_GENERAL, LOG_ERR, "Should be local only query: SetChannelInfo");
998  return false;
999  }
1000 
1001  return m_tv->SetChannelInfo(chanid, sourceid, oldchannum,
1002  callsign, channum,
1003  channame, xmltv);
1004 }
1005 
1007 {
1008  if (m_local)
1009  {
1010  LOG(VB_GENERAL, LOG_ERR, LOC + "Called on local recorder");
1011  return false;
1012  }
1013 
1014  bool retval = m_sock->AddChildInput(childid);
1015  return retval;
1016 }
1017 
1018 /* vim: set expandtab tabstop=4 shiftwidth=4: */
ReferenceLocker
This decrements the reference on destruction.
Definition: referencecounter.h:67
RecStatus::Type
Type
Definition: recStatus.h:16
TVRec::GetKeyframeDurations
bool GetKeyframeDurations(int64_t start, int64_t end, frm_pos_map_t &map) const
Definition: tv_rec.cpp:2626
TVRec::IsReallyRecording
bool IsReallyRecording(void)
Returns true if frontend can consider the recorder started.
Definition: tv_rec.cpp:2472
PlaybackSock::GetDiskSpace
void GetDiskSpace(QStringList &o_strlist)
Appends host's dir's total and used space in kilobytes.
Definition: playbacksock.cpp:140
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:429
ChannelChangeDirection
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
Definition: tv.h:29
TVRec::ShouldSwitchToAnotherInput
bool ShouldSwitchToAnotherInput(const QString &chanid) const
Checks if named channel exists on current tuner, or another tuner.
Definition: tv_rec.cpp:2181
SleepStatus
SleepStatus
SleepStatus is an enumeration of the awake/sleep status of a slave.
Definition: tv.h:97
PictureAdjustType
PictureAdjustType
Definition: tv.h:121
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
RecStatus::Tuning
@ Tuning
Definition: recStatus.h:22
TVRec::ToggleChannelFavorite
void ToggleChannelFavorite(const QString &changroupname)
Toggles whether the current channel should be on our favorites list.
Definition: tv_rec.cpp:2954
TVRec::SetInput
QString SetInput(QString input)
Changes to the specified input.
Definition: tv_rec.cpp:3062
arg
arg(title).arg(filename).arg(doDelete))
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:704
category
QString category
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1422
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
TVRec::GetFramesWritten
long long GetFramesWritten(void)
Returns number of frames written to disk by recorder.
Definition: tv_rec.cpp:2567
TVRec::GetInput
QString GetInput(void) const
Returns current input.
Definition: tv_rec.cpp:3037
ProgramInfo::IsSameRecording
bool IsSameRecording(const ProgramInfo &other) const
Definition: programinfo.h:330
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:2317
TVRec::IsBusy
bool IsBusy(InputInfo *busy_input=nullptr, int time_buffer=5) const
Returns true if the recorder is busy, or will be within the next time_buffer seconds.
Definition: tv_rec.cpp:2483
ProgramInfo::GetRecordingEndTime
QDateTime GetRecordingEndTime(void) const
Approximate time the recording should have ended, did end, or is intended to end.
Definition: programinfo.h:410
TVRec::GetChainID
QString GetChainID(void)
Get the chainid of the livetv instance.
Definition: tv_rec.cpp:2700
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:10
true
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:91
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:402
TVRec::GetFilePosition
long long GetFilePosition(void)
Returns total number of bytes written by RingBuffer.
Definition: tv_rec.cpp:2582
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:2335
TVRec::PauseRecorder
void PauseRecorder(void)
Tells "recorder" to pause, used for channel and input changes.
Definition: tv_rec.cpp:2926
programinfo.h
PlaybackSock::IsBusy
bool IsBusy(int capturecardnum, InputInfo *busy_input=nullptr, int time_buffer=5)
Definition: playbacksock.cpp:336
mythlogging.h
TVRec::GetMaxBitrate
long long GetMaxBitrate(void) const
Returns the maximum bits per second this recorder can produce.
Definition: tv_rec.cpp:2642
PlaybackSock::AddChildInput
bool AddChildInput(uint childid)
Tells a slave to add a child input.
Definition: playbacksock.cpp:535
compat.h
PlaybackSock::GetRecordingStatus
RecStatus::Type GetRecordingStatus(int capturecardnum)
Definition: playbacksock.cpp:460
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:2271
PlaybackSock::CancelNextRecording
void CancelNextRecording(int capturecardnum, bool cancel)
Definition: playbacksock.cpp:512
RecStatus::Failing
@ Failing
Definition: recStatus.h:18
GetPlaybackURL
QString GetPlaybackURL(ProgramInfo *pginfo, bool storePath)
Definition: fileserverutil.cpp:45
PlaybackSock::CheckFile
bool CheckFile(ProgramInfo *pginfo)
Definition: playbacksock.cpp:321
RecStatus::Aborted
@ Aborted
Definition: recStatus.h:28
PlaybackSock::SetSignalMonitoringRate
int SetSignalMonitoringRate(int capturecardnum, int rate, int notifyFrontend)
Definition: playbacksock.cpp:489
sStatus_Asleep
@ sStatus_Asleep
A slave is considered asleep when it is not awake and not undefined.
Definition: tv.h:104
TVRec::SetSignalMonitoringRate
int SetSignalMonitoringRate(int rate, int notifyFrontend=1)
Sets the signal monitoring rate.
Definition: tv_rec.cpp:2127
PlaybackSock::RecordPending
void RecordPending(int capturecardnum, const ProgramInfo *pginfo, int secsleft, bool hasLater)
Definition: playbacksock.cpp:477
TVRec::GetPictureAttribute
int GetPictureAttribute(PictureAttribute attr)
Definition: tv_rec.cpp:3003
PlaybackSock::SetNextLiveTVDir
void SetNextLiveTVDir(int capturecardnum, const QString &dir)
Definition: playbacksock.cpp:503
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:2615
uint
unsigned int uint
Definition: compat.h:141
PlaybackSock::GetEncoderState
int GetEncoderState(int capturecardnum)
Returns the maximum bits per second the recorder can produce.
Definition: playbacksock.cpp:379
TVRec::SetNextLiveTVDir
void SetNextLiveTVDir(QString dir)
Definition: tv_rec.cpp:4531
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
TVRec::GetFramerate
float GetFramerate(void)
Returns recordering frame rate from the recorder.
Definition: tv_rec.cpp:2552
TVRec::GetRecordingStatus
RecStatus::Type GetRecordingStatus(void) const
Definition: tv_rec.cpp:668
PlaybackSock::StartRecording
RecStatus::Type StartRecording(int capturecardnum, ProgramInfo *pginfo)
Definition: playbacksock.cpp:442
PlaybackSock::GoToSleep
bool GoToSleep(void)
Tells a slave to go to sleep.
Definition: playbacksock.cpp:130
PlaybackSock
Definition: playbacksock.h:28
referencecounter.h
TVRec::GetRecording
ProgramInfo * GetRecording(void)
Allocates and returns a ProgramInfo for the current recording.
Definition: tv_rec.cpp:239
TVRec::SpawnLiveTV
void SpawnLiveTV(LiveTVChain *newchain, bool pip, QString startchan)
Tells TVRec to spawn a "Live TV" recorder.
Definition: tv_rec.cpp:2670
TVRec::CancelNextRecording
void CancelNextRecording(bool cancel)
Tells TVRec to cancel the upcoming recording.
Definition: tv_rec.cpp:347
frm_pos_map_t
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:104
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:3163
PlaybackSock::GetRecording
ProgramInfo * GetRecording(uint cardid)
Returns the ProgramInfo being used by any current recording.
Definition: playbacksock.cpp:411
TVRec::GetKeyframePosition
int64_t GetKeyframePosition(uint64_t desired) const
Returns byte position in RingBuffer of a keyframe according to recorder.
Definition: tv_rec.cpp:2598
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:370
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
RecStatus::Recording
@ Recording
Definition: recStatus.h:30
TVRec::GetChannelInfo
bool GetChannelInfo(uint &chanid, uint &sourceid, QString &callsign, QString &channum, QString &channame, QString &xmltvid) const
Definition: tv_rec.cpp:3289
TVState
TVState
TVState is an enumeration of the states used by TV and TVRec.
Definition: tv.h:51
mythcorecontext.h
ProgramInfo::IsLocal
bool IsLocal(void) const
Definition: programinfo.h:349
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
MythDate
Definition: mythdate.cpp:8
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:947
TVRec
This is the coordinating class of the Recorder Subsystem.
Definition: tv_rec.h:143
TVRec::GetState
TVState GetState(void) const
Returns the TVState of the recorder.
Definition: tv_rec.cpp:225
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:15
BrowseDirection
BrowseDirection
Used to request ProgramInfo for channel browsing.
Definition: tv.h:38
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:397
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:3330
TVRec::SetLiveRecording
void SetLiveRecording(int recording)
Tells the Scheduler about changes to the recording status of the LiveTV recording.
Definition: tv_rec.cpp:2831
TVRec::SetChannel
void SetChannel(const QString &name, uint requestType=kFlagDetect)
Changes to a named channel on the current tuner.
Definition: tv_rec.cpp:3088
TVRec::StopLiveTV
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
Definition: tv_rec.cpp:2879
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:3021
sStatus_Awake
@ sStatus_Awake
A slave is awake when it is connected to the master.
Definition: tv.h:100
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:396
TVRec::RecordPending
void RecordPending(const ProgramInfo *rcinfo, int secsleft, bool hasLater)
Tells TVRec "rcinfo" is the next pending recording.
Definition: tv_rec.cpp:271
LiveTVChain
Keeps track of recordings in a current LiveTV instance.
Definition: livetvchain.h:32