Go to the documentation of this file.
3 #ifndef EXTERNAL_STREAMHANDLER_H
4 #define EXTERNAL_STREAMHANDLER_H
18 #include <QVariantMap>
19 #include <QStringList>
20 #include <QTextStream>
37 bool Ready(
int fd, std::chrono::milliseconds
timeout,
const QString & what);
38 int Read(QByteArray & buffer,
int maxlen, std::chrono::milliseconds
timeout = 2500ms);
40 int Write(
const QByteArray & buffer);
78 int inputid,
int majorid);
86 void run(
void)
override;
112 std::chrono::milliseconds
timeout = 4s,
114 bool ProcessVer1(
const QString & cmd, QString & result,
115 std::chrono::milliseconds
timeout,
uint retry_cnt);
116 bool ProcessVer2(
const QString & command, QString & result,
117 std::chrono::milliseconds
timeout,
uint retry_cnt);
119 QVariantMap & elements,
120 QByteArray & response,
121 std::chrono::milliseconds
timeout = 4s,
162 #endif // EXTERNAL_STREAMHANDLER_H
bool ProcessVer1(const QString &cmd, QString &result, std::chrono::milliseconds timeout, uint retry_cnt)
ExternalStreamHandler(const QString &path, int inputid, int majorid)
void PriorityEvent(int fd) override
bool m_hasPictureAttributes
int StreamingCount(void) const
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
bool IsDamaged(void) const
bool HasTuner(void) const
ExternIO(const QString &app, const QStringList &args)
static QMap< int, ExternalStreamHandler * > s_handlers
static QMap< int, uint > s_handlersRefCnt
~ExternalStreamHandler(void) override
static bool KillIfRunning(const QString &cmd)
static constexpr uint8_t kMaxErrorCnt
QByteArray m_replayBuffer
bool Ready(int fd, std::chrono::milliseconds timeout, const QString &what)
QString ErrorString(void) const
int APIVersion(void) const
static ExternalStreamHandler * Get(const QString &devname, int inputid, int majorid)
static QMutex s_handlersLock
bool ProcessJson(const QVariantMap &vmsg, QVariantMap &elements, QByteArray &response, std::chrono::milliseconds timeout=4s, uint retry_cnt=3)
bool StartStreaming(void)
QString UpdateDescription(void)
bool ProcessVer2(const QString &command, QString &result, std::chrono::milliseconds timeout, uint retry_cnt)
bool HasPictureAttributes(void) const
int Write(const QByteArray &buffer)
QByteArray GetStatus(std::chrono::milliseconds timeout=2500ms)
bool ProcessCommand(const QString &cmd, QString &result, std::chrono::milliseconds timeout=4s, uint retry_cnt=3)
This class is intended to detect the presence of needed tables.
void UnlockReplay(bool enable_replay=false)
QAtomicInt m_streamingCnt
int Read(QByteArray &buffer, int maxlen, std::chrono::milliseconds timeout=2500ms)
static void Return(ExternalStreamHandler *&ref, int inputid)
QString GetDescription(void)