Go to the documentation of this file.
4 #ifndef DEVICEREADBUFFER_H
5 #define DEVICEREADBUFFER_H
10 #include <QWaitCondition>
40 bool error_exit_on_poll_timeout =
true);
43 bool Setup(
const QString &streamName,
46 uint deviceBufferSize = 0,
47 uint deviceBufferCount = 1);
50 void Reset(
const QString &streamName,
int streamfd);
59 bool IsEOF(
void)
const;
66 void run(
void)
override;
73 bool Poll(
void)
const;
130 #endif // DEVICEREADBUFFER_H
unsigned char * m_readPtr
QWaitCondition m_pauseWait
void WakePoll(void) const
bool Setup(const QString &streamName, int streamfd, uint readQuanta=sizeof(TSPacket), uint deviceBufferSize=0, uint deviceBufferCount=1)
virtual ~DeviceReaderCB()=default
pipe_flag_array m_wakePipeFlags
A QElapsedTimer based timer to replace use of QTime as a timer.
bool IsPaused(void) const
bool WaitForPaused(unsigned long timeout)
uint WaitForUsed(uint needed, std::chrono::milliseconds max_wait) const
uint Read(unsigned char *buf, uint count)
Try to Read count bytes from into buffer.
bool IsPauseRequested(void) const
Buffers reads from device files.
bool WaitForUnpause(unsigned long timeout)
uint GetContiguousUnused(void) const
virtual void ReaderPaused(int fd)=0
uint WaitForUnused(uint needed) const
bool CheckForErrors(ssize_t read_len, size_t requested_len, uint &errcnt)
bool m_pollTimeoutIsError
DeviceReaderCB * m_readerCB
Used to access the data of a Transport Stream packet.
bool IsRunning(void) const
QWaitCondition m_unpauseWait
std::array< long, 2 > pipe_flag_array
void ClosePipes(void) const
virtual void PriorityEvent(int fd)=0
uint GetUnused(void) const
~DeviceReadBuffer() override
std::chrono::milliseconds m_maxPollWait
unsigned char * m_writePtr
DeviceReadBuffer(DeviceReaderCB *cb, bool use_poll=true, bool error_exit_on_poll_timeout=true)
This is a wrapper around QThread that does several additional things.
bool IsErrored(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.
void IncrWritePointer(uint len)
void SetRequestPause(bool request)
QWaitCondition m_dataWait
std::array< int, 2 > pipe_fd_array
void IncrReadPointer(uint len)
void Reset(const QString &streamName, int streamfd)