Go to the documentation of this file.
19 #include <sys/types.h>
110 long Size,
int NumBufs)
115 QByteArray fname =
Name.toLatin1();
116 const char *aname = fname.constData();
119 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't create fifo for file: '%1'").arg(
Name) +
ENO);
123 LOG(VB_GENERAL, LOG_INFO, QString(
"Created %1 fifo: %2").arg(Desc,
Name));
144 fifoptr = fifoptr->
m_next;
174 fd = open(fname.constData(), O_WRONLY|
O_SYNC);
182 static_cast<size_t>(
m_fbOutptr[Id]->m_blockSize-written)));
185 LOG(VB_GENERAL, LOG_ERR, QString(
"FIFOW: write failed with %1")
186 .arg(strerror(errno)));
201 unlink(
m_filename[Id].toLocal8Bit().constData());
219 bool blocking =
false;
237 QString msg = QString(
"allocating additonal buffer for : %1(%2)")
239 LOG(VB_FILE, LOG_INFO, msg);
250 m_fbInptr[Id]->
m_data =
new unsigned char[
static_cast<unsigned long>(Size)];
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
#define ENO
This can be appended to the LOG args with "+".
MythFifoBuffer ** m_fbOutptr
QWaitCondition * m_emptyCond
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
~MythFIFOThread() override
def write(text, progress=True)
QWaitCondition * m_fullCond
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
MythFifoBuffer ** m_fbInptr
void SetParent(MythFIFOWriter *Parent)
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
bool FIFOInit(uint Id, const QString &Desc, const QString &Name, long Size, int NumBufs)
static bool isRunning(const char *program)
Returns true if a program containing the specified string is running on this machine.
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
struct MythFifoBuffer * m_next
void FIFOWrite(uint Id, void *Buffer, long Size)
void FIFOWriteThread(int Id)
This is a wrapper around QThread that does several additional things.
bool isRunning(void) const
MythFIFOWriter * m_parent
MythFIFOWriter(uint Count, bool Sync)
MythFIFOThread * m_fifoThrds
MythFifoBuffer ** m_fifoBuf
#define mkfifo(path, mode)