MythTV  master
mythfifowriter.h
Go to the documentation of this file.
1 #ifndef FIFOWRITER
2 #define FIFOWRITER
3 
4 // Qt
5 #include <QWaitCondition>
6 #include <QString>
7 #include <QMutex>
8 
9 // MythTV
10 #include "mythtvexp.h"
11 #include "mthread.h"
12 
13 using namespace std;
14 
15 class MythFIFOWriter;
16 
17 class MythFIFOThread : public MThread
18 {
19  public:
21  ~MythFIFOThread() override;
22 
23  void SetId(int Id);
24  void SetParent(MythFIFOWriter *Parent);
25 
26  void run(void) override;
27 
28  private:
29  MythFIFOWriter *m_parent { nullptr };
30  int m_id { -1 };
31 };
32 
34 {
35  friend class MythFIFOThread;
36 
37  public:
38  MythFIFOWriter(uint Count, bool Sync);
39  ~MythFIFOWriter(void);
40 
41  bool FIFOInit (uint Id, const QString& Desc, const QString& Name, long Size, int NumBufs);
42  void FIFOWrite(uint Id, void *Buffer, long Size);
43  void FIFODrain(void);
44 
45  private:
46  Q_DISABLE_COPY(MythFIFOWriter)
47  void FIFOWriteThread(int Id);
48 
50  {
52  unsigned char *m_data;
54  };
55 
56  MythFifoBuffer **m_fifoBuf { nullptr };
57  MythFifoBuffer **m_fbInptr { nullptr };
58  MythFifoBuffer **m_fbOutptr { nullptr };
59 
60  MythFIFOThread *m_fifoThrds { nullptr };
61  QMutex *m_fifoLock { nullptr };
62  QWaitCondition *m_fullCond { nullptr };
63  QWaitCondition *m_emptyCond { nullptr };
64 
65  QString *m_filename { nullptr };
66  QString *m_fbDesc { nullptr };
67 
68  long *m_maxBlkSize { nullptr };
69  int *m_killWr { nullptr };
70  int *m_fbCount { nullptr };
71  int *m_fbMaxCount { nullptr };
72  uint m_numFifos { 0 };
73  bool m_useSync;
74 };
75 
76 #endif
77 
mythtvexp.h
MythFIFOThread
Definition: mythfifowriter.h:18
MythFIFOWriter::m_useSync
bool m_useSync
Definition: mythfifowriter.h:73
MythFIFOWriter
Definition: mythfifowriter.h:34
MythFIFOWriter::MythFifoBuffer
Definition: mythfifowriter.h:50
MythFIFOWriter::MythFifoBuffer::m_blockSize
long m_blockSize
Definition: mythfifowriter.h:53
uint
unsigned int uint
Definition: compat.h:140
MythFIFOWriter::MythFifoBuffer::m_next
struct MythFifoBuffer * m_next
Definition: mythfifowriter.h:51
MTV_PUBLIC
#define MTV_PUBLIC
Definition: mythtvexp.h:15
MythFIFOWriter::MythFifoBuffer::m_data
unsigned char * m_data
Definition: mythfifowriter.h:52
Buffer
Definition: MythExternControl.h:37
Name
Definition: channelsettings.cpp:47
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
mthread.h