MythTV  master
remoteencoder.h
Go to the documentation of this file.
1 #ifndef REMOTEENCODER_H_
2 #define REMOTEENCODER_H_
3 
4 #include <cstdint>
5 
6 #include <QString>
7 #include <QMutex>
8 #include <QHash>
9 #include <QMap>
10 
11 #include "mythtvexp.h"
12 #include "videoouttypes.h"
13 #include "tv.h"
14 #include "mythtypes.h"
15 #include "programtypes.h"
16 #include "mythtimer.h"
17 
18 class QStringList;
19 class ProgramInfo;
20 class MythSocket;
21 
23 {
24  public:
25  RemoteEncoder(int num, const QString &host, short port)
26  : m_recordernum(num), m_remotehost(host), m_remoteport(port) {}
27  ~RemoteEncoder(void);
28 
29  bool Setup(void);
30  bool IsValidRecorder(void) const;
31  int GetRecorderNumber(void) const;
32 
33  ProgramInfo *GetRecording(void);
34  bool IsRecording(bool *ok = nullptr);
35  float GetFrameRate(void);
36  long long GetFramesWritten(void);
38  long long GetCachedFramesWritten(void) const { return m_cachedFramesWritten; }
39  long long GetFilePosition(void);
40  long long GetFreeDiskSpace();
41  long long GetMaxBitrate();
42  int64_t GetKeyframePosition(uint64_t desired);
43  void FillPositionMap(int64_t start, int64_t end,
44  frm_pos_map_t &positionMap);
45  void FillDurationMap(int64_t start, int64_t end,
46  frm_pos_map_t &durationMap);
47  void StopPlaying(void);
48  void SpawnLiveTV(const QString& chainid, bool pip, const QString& startchan);
49  void StopLiveTV(void);
50  void PauseRecorder(void);
51  void FinishRecording(void);
52  void FrontendReady(void);
53  void CancelNextRecording(bool cancel);
54 
55  void SetLiveRecording(bool recording);
56  QString GetInput(void);
57  QString SetInput(const QString&);
58  int GetPictureAttribute(PictureAttribute attr);
59  int ChangePictureAttribute(
60  PictureAdjustType type, PictureAttribute attr, bool up);
61  void ChangeChannel(int channeldirection);
62  void ChangeDeinterlacer(int deint_mode);
63  void ToggleChannelFavorite(const QString&);
64  void SetChannel(const QString& channel);
65  int SetSignalMonitoringRate(int rate, bool notifyFrontend = true);
66  uint GetSignalLockTimeout(const QString& input);
67  bool CheckChannel(const QString& channel);
68  bool ShouldSwitchToAnotherCard(const QString& channelid);
69  bool CheckChannelPrefix(const QString&,uint&,bool&,QString&);
70  void GetNextProgram(int direction,
71  QString &title, QString &subtitle, QString &desc,
72  QString &category, QString &starttime, QString &endtime,
73  QString &callsign, QString &iconpath,
74  QString &channelname, QString &chanid,
75  QString &seriesid, QString &programid);
76  void GetChannelInfo(InfoMap &infoMap, uint chanid = 0);
77  bool SetChannelInfo(const InfoMap &infoMap);
78  bool GetErrorStatus(void) { bool v = m_backendError; m_backendError = false;
79  return v; }
80 
81  private:
82  bool SendReceiveStringList(QStringList &strlist, uint min_reply_length = 0);
83 
85 
86  MythSocket *m_controlSock {nullptr};
87  QMutex m_lock;
88 
89  QString m_remotehost;
90  short m_remoteport;
91 
92  QString m_lastchannel;
93  QString m_lastinput;
94 
95  bool m_backendError {false};
96  long long m_cachedFramesWritten {0};
97  QMap<QString,uint> m_cachedTimeout;
99 };
100 
101 #endif
102 
A QElapsedTimer based timer to replace use of QTime as a timer.
Definition: mythtimer.h:13
short m_remoteport
Definition: remoteencoder.h:90
unsigned int uint
Definition: compat.h:140
QString m_remotehost
Definition: remoteencoder.h:89
QString m_lastchannel
Definition: remoteencoder.h:92
QString m_lastinput
Definition: remoteencoder.h:93
Holds information on recordings and videos.
Definition: programinfo.h:66
#define MTV_PUBLIC
Definition: mythtvexp.h:15
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
RemoteEncoder(int num, const QString &host, short port)
Definition: remoteencoder.h:25
PictureAttribute
Definition: videoouttypes.h:89
bool GetErrorStatus(void)
Definition: remoteencoder.h:78
PictureAdjustType
Definition: tv.h:120
QMap< QString, uint > m_cachedTimeout
Definition: remoteencoder.h:97
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:26
QMap< long long, long long > frm_pos_map_t
Frame # -> File offset map.
Definition: programtypes.h:46
long long GetCachedFramesWritten(void) const
Return value last returned by GetFramesWritten().
Definition: remoteencoder.h:38
MythTimer m_lastTimeCheck
Definition: remoteencoder.h:98