MythTV  master
avfdecoder.h
Go to the documentation of this file.
1 #ifndef AVFECODER_H_
2 #define AVFECODER_H_
3 
4 #include <cstdint>
5 
6 #include <QObject>
7 
8 #include "decoder.h"
9 
10 #include <audiooutputsettings.h>
11 #include "remoteavformatcontext.h"
12 
13 class QTimer;
14 
15 class avfDecoder : public QObject, public Decoder
16 {
17  Q_OBJECT
18 
19  public:
20  avfDecoder(const QString &file, DecoderFactory *, AudioOutput *);
21  virtual ~avfDecoder(void);
22 
23  bool initialize() override; // Decoder
24  double lengthInSeconds();
25  void seek(double) override; // Decoder
26  void stop() override; // Decoder
27 
28  protected slots:
29  void checkMetatdata(void);
30 
31  private:
32  void run() override; // MThread
33 
34  void deinit();
35 
36  bool m_inited {false};
37  bool m_userStop {false};
38  int m_stat {0};
39  uint8_t *m_outputBuffer {nullptr};
40 
41  bool m_finish {false};
42  long m_freq {0};
43  long m_bitrate {0};
44  int m_channels {0};
45  double m_seekTime {-1.0};
46 
47  QString m_devicename;
48 
49  AVInputFormat *m_inputFormat {nullptr};
51  AVCodecContext *m_audioDec {nullptr};
52 
53  bool m_inputIsFile {false};
54 
55  QTimer *m_mdataTimer {nullptr};
56  QString m_lastMetadata;
57 
58  int m_errCode {0};
59 };
60 
61 #endif
62 
void deinit()
Definition: avfdecoder.cpp:410
long m_freq
Definition: avfdecoder.h:42
unsigned int slots[4]
Definition: element.c:38
QString m_devicename
Definition: avfdecoder.h:47
virtual ~avfDecoder(void)
Definition: avfdecoder.cpp:251
AVCodecContext * m_audioDec
Definition: avfdecoder.h:51
avfDecoder(const QString &file, DecoderFactory *, AudioOutput *)
Definition: avfdecoder.cpp:237
int m_stat
Definition: avfdecoder.h:38
QString m_lastMetadata
Definition: avfdecoder.h:56
long m_bitrate
Definition: avfdecoder.h:43
int m_channels
Definition: avfdecoder.h:44
void checkMetatdata(void)
Definition: avfdecoder.cpp:549
bool m_inited
Definition: avfdecoder.h:36
int m_errCode
Definition: avfdecoder.h:58
double lengthInSeconds()
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: avfdecoder.cpp:431
AVInputFormat * m_inputFormat
Definition: avfdecoder.h:49
uint8_t * m_outputBuffer
Definition: avfdecoder.h:39
bool m_userStop
Definition: avfdecoder.h:37
double m_seekTime
Definition: avfdecoder.h:45
void stop() override
Definition: avfdecoder.cpp:264
bool initialize() override
Definition: avfdecoder.cpp:269
QTimer * m_mdataTimer
Definition: avfdecoder.h:55
RemoteAVFormatContext * m_inputContext
Definition: avfdecoder.h:50
bool m_finish
Definition: avfdecoder.h:41
void seek(double) override
Definition: avfdecoder.cpp:401
bool m_inputIsFile
Definition: avfdecoder.h:53