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 #include "mythavutil.h"
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 *d, AudioOutput *o);
21  ~avfDecoder(void) override;
22 
23  bool initialize() override; // Decoder
24  double lengthInSeconds();
25  void seek(double pos) 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};
53 
54  bool m_inputIsFile {false};
55 
56  QTimer *m_mdataTimer {nullptr};
57  QString m_lastMetadata;
58 
59  int m_errCode {0};
60 };
61 
62 #endif
63 
avfDecoder::m_inited
bool m_inited
Definition: avfdecoder.h:36
avfDecoder::lengthInSeconds
double lengthInSeconds()
avfDecoder::m_codecMap
MythCodecMap m_codecMap
Definition: avfdecoder.h:52
slots
std::array< unsigned int, 4 > slots
Definition: element.cpp:38
avfDecoder::run
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:422
remoteavformatcontext.h
avfDecoder::m_userStop
bool m_userStop
Definition: avfdecoder.h:37
avfDecoder::m_seekTime
double m_seekTime
Definition: avfdecoder.h:45
DecoderFactory
Definition: decoder.h:113
avfDecoder::m_inputFormat
AVInputFormat * m_inputFormat
Definition: avfdecoder.h:49
avfDecoder::stop
void stop() override
Definition: avfdecoder.cpp:255
build_compdb.file
file
Definition: build_compdb.py:55
avfDecoder::initialize
bool initialize() override
Definition: avfdecoder.cpp:260
avfDecoder::m_mdataTimer
QTimer * m_mdataTimer
Definition: avfdecoder.h:56
avfDecoder::m_inputContext
RemoteAVFormatContext * m_inputContext
Definition: avfdecoder.h:50
avfDecoder::m_outputBuffer
uint8_t * m_outputBuffer
Definition: avfdecoder.h:39
AudioOutput
Definition: audiooutput.h:26
Decoder
Definition: decoder.h:66
RemoteAVFormatContext
Definition: mytharchive/mytharchive/remoteavformatcontext.h:17
avfDecoder
Definition: avfdecoder.h:16
avfDecoder::m_inputIsFile
bool m_inputIsFile
Definition: avfdecoder.h:54
avfDecoder::m_finish
bool m_finish
Definition: avfdecoder.h:41
avfDecoder::deinit
void deinit()
Definition: avfdecoder.cpp:401
avfDecoder::m_freq
long m_freq
Definition: avfdecoder.h:42
avfDecoder::avfDecoder
avfDecoder(const QString &file, DecoderFactory *d, AudioOutput *o)
Definition: avfdecoder.cpp:228
MythCodecMap
MythCodecMap Utility class that keeps pointers to an AVStream and its AVCodecContext.
Definition: mythavutil.h:87
avfDecoder::m_devicename
QString m_devicename
Definition: avfdecoder.h:47
avfDecoder::m_audioDec
AVCodecContext * m_audioDec
Definition: avfdecoder.h:51
avfDecoder::m_stat
int m_stat
Definition: avfdecoder.h:38
mythavutil.h
avfDecoder::m_channels
int m_channels
Definition: avfdecoder.h:44
avfDecoder::seek
void seek(double pos) override
Definition: avfdecoder.cpp:392
avfDecoder::m_lastMetadata
QString m_lastMetadata
Definition: avfdecoder.h:57
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
avfDecoder::m_bitrate
long m_bitrate
Definition: avfdecoder.h:43
audiooutputsettings.h
avfDecoder::m_errCode
int m_errCode
Definition: avfdecoder.h:59
avfDecoder::~avfDecoder
~avfDecoder(void) override
Definition: avfdecoder.cpp:242
decoder.h
avfDecoder::checkMetatdata
void checkMetatdata(void)
Definition: avfdecoder.cpp:541