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