Go to the documentation of this file.
3 #ifndef EXTERNAL_STREAMHANDLER_H
4 #define EXTERNAL_STREAMHANDLER_H
18 #include <QStringList>
19 #include <QTextStream>
36 bool Ready(
int fd, std::chrono::milliseconds
timeout,
const QString & what);
37 int Read(QByteArray & buffer,
int maxlen, std::chrono::milliseconds
timeout = 2500ms);
39 int Write(
const QByteArray & buffer);
77 int inputid,
int majorid);
85 void run(
void)
override;
109 std::chrono::milliseconds
timeout = 4s,
111 bool ProcessVer1(
const QString & cmd, QString & result,
112 std::chrono::milliseconds
timeout,
uint retry_cnt);
113 bool ProcessVer2(
const QString & command, QString & result,
114 std::chrono::milliseconds
timeout,
uint retry_cnt);
152 #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.
QString GetStatus(std::chrono::milliseconds timeout=2500ms)
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)
QByteArray m_replayBuffer
bool Ready(int fd, std::chrono::milliseconds timeout, const QString &what)
QString ErrorString(void) const
static ExternalStreamHandler * Get(const QString &devname, int inputid, int majorid)
static QMutex s_handlersLock
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)
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)