MythTV  master
spdifencoder.h
Go to the documentation of this file.
1 #ifndef SPDIFENCODER_H_
2 #define SPDIFENCODER_H_
3 
4 #include <QString>
5 
6 #include "output.h"
7 #include "audiooutput.h"
8 
9 extern "C" {
10 #include "libavcodec/avcodec.h"
11 #include "libavformat/avformat.h"
12 }
13 
15 {
16  public:
17  SPDIFEncoder(const QString& muxer, AVCodecID codec_id);
18  ~SPDIFEncoder();
19  void WriteFrame(unsigned char *data, int size);
20  int GetData(unsigned char *buffer, int &dest_size);
21  int GetProcessedSize() { return m_size; };
22  unsigned char *GetProcessedBuffer() { return m_buffer; };
23  void Reset();
24  bool Succeeded() { return m_complete; };
25  bool SetMaxHDRate(int rate);
26 
27  private:
28  static int funcIO(void *opaque, unsigned char *buf, int size);
29  void Destroy();
30 
31  private:
32  bool m_complete {false};
33  AVFormatContext *m_oc {nullptr};
34  unsigned char m_buffer[AudioOutput::MAX_SIZE_BUFFER];
35  long m_size {0};
36 };
37 
38 #endif
#define MPUBLIC
Definition: mythexp.h:10
#define Destroy(a)
bool Succeeded()
Definition: spdifencoder.h:24
static const int MAX_SIZE_BUFFER
MAX_SIZE_BUFFER is the maximum size of a buffer to be used with DecodeAudio.
Definition: audiooutput.h:192
int GetProcessedSize()
Definition: spdifencoder.h:21
unsigned char * GetProcessedBuffer()
Definition: spdifencoder.h:22