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