MythTV  master
avfdecoder.h
Go to the documentation of this file.
1 #ifndef AVFECODER_H_
2 #define AVFECODER_H_
3 
4 // C++ headers
5 #include <cstdint>
6 
7 // QT headers
8 #include <QObject>
9 
10 // MythTV headers
12 #include <libmythtv/mythavutil.h>
13 
14 // Mythmusic Headers
15 #include "decoder.h"
16 #include "remoteavformatcontext.h"
17 
18 class QTimer;
19 
20 class avfDecoder : public QObject, public Decoder
21 {
22  Q_OBJECT
23 
24  public:
25  avfDecoder(const QString &file, DecoderFactory *d, AudioOutput *o);
26  ~avfDecoder(void) override;
27 
28  bool initialize() override; // Decoder
29  double lengthInSeconds();
30  void seek(double pos) override; // Decoder
31  void stop() override; // Decoder
32 
33  protected slots:
34  void checkMetatdata(void);
35 
36  private:
37  void run() override; // MThread
38 
39  void deinit();
40 
41  bool m_inited {false};
42  bool m_userStop {false};
43  int m_stat {0};
44  uint8_t *m_outputBuffer {nullptr};
45 
46  bool m_finish {false};
47  long m_freq {0};
48  long m_bitrate {0};
49  int m_channels {0};
50  double m_seekTime {-1.0};
51 
52  QString m_devicename;
53 
54  const AVInputFormat *m_inputFormat {nullptr};
56  AVCodecContext *m_audioDec {nullptr};
58 
59  bool m_inputIsFile {false};
60 
61  QTimer *m_mdataTimer {nullptr};
62  QString m_lastMetadata;
64 
65  int m_errCode {0};
66 };
67 
68 #endif
69 
avfDecoder::m_inited
bool m_inited
Definition: avfdecoder.h:41
avfDecoder::lengthInSeconds
double lengthInSeconds()
avfDecoder::m_codecMap
MythCodecMap m_codecMap
Definition: avfdecoder.h:57
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:424
remoteavformatcontext.h
avfDecoder::m_userStop
bool m_userStop
Definition: avfdecoder.h:42
avfDecoder::m_seekTime
double m_seekTime
Definition: avfdecoder.h:50
DecoderFactory
Definition: decoder.h:117
avfDecoder::stop
void stop() override
Definition: avfdecoder.cpp:257
build_compdb.file
file
Definition: build_compdb.py:55
avfDecoder::initialize
bool initialize() override
Definition: avfdecoder.cpp:262
avfDecoder::m_mdataTimer
QTimer * m_mdataTimer
Definition: avfdecoder.h:61
avfDecoder::m_inputContext
RemoteAVFormatContext * m_inputContext
Definition: avfdecoder.h:55
avfDecoder::m_outputBuffer
uint8_t * m_outputBuffer
Definition: avfdecoder.h:44
AudioOutput
Definition: audiooutput.h:26
Decoder
Definition: decoder.h:70
RemoteAVFormatContext
Definition: mythmusic/mythmusic/remoteavformatcontext.h:22
avfDecoder
Definition: avfdecoder.h:20
avfDecoder::m_inputIsFile
bool m_inputIsFile
Definition: avfdecoder.h:59
avfDecoder::m_finish
bool m_finish
Definition: avfdecoder.h:46
avfDecoder::deinit
void deinit()
Definition: avfdecoder.cpp:403
avfDecoder::m_freq
long m_freq
Definition: avfdecoder.h:47
avfDecoder::avfDecoder
avfDecoder(const QString &file, DecoderFactory *d, AudioOutput *o)
Definition: avfdecoder.cpp:230
avfDecoder::m_inputFormat
const AVInputFormat * m_inputFormat
Definition: avfdecoder.h:54
MythCodecMap
Definition: mythavutil.h:25
avfDecoder::m_devicename
QString m_devicename
Definition: avfdecoder.h:52
avfDecoder::m_audioDec
AVCodecContext * m_audioDec
Definition: avfdecoder.h:56
avfDecoder::m_stat
int m_stat
Definition: avfdecoder.h:43
mythavutil.h
avfDecoder::m_lastMetadataParsed
QString m_lastMetadataParsed
Definition: avfdecoder.h:63
avfDecoder::m_channels
int m_channels
Definition: avfdecoder.h:49
avfDecoder::seek
void seek(double pos) override
Definition: avfdecoder.cpp:394
avfDecoder::m_lastMetadata
QString m_lastMetadata
Definition: avfdecoder.h:62
d
static const iso6937table * d
Definition: iso6937tables.cpp:1025
avfDecoder::m_bitrate
long m_bitrate
Definition: avfdecoder.h:48
audiooutputsettings.h
avfDecoder::m_errCode
int m_errCode
Definition: avfdecoder.h:65
avfDecoder::~avfDecoder
~avfDecoder(void) override
Definition: avfdecoder.cpp:244
decoder.h
avfDecoder::checkMetatdata
void checkMetatdata(void)
Definition: avfdecoder.cpp:551