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 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};
67
68 int m_errCode {0};
69};
70
71#endif
72
void checkMetatdata(void)
Definition: avfdecoder.cpp:549
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
QString m_devicename
Definition: avfdecoder.h:55
bool initialize() override
Definition: avfdecoder.cpp:260
void stop() override
Definition: avfdecoder.cpp:255
QTimer * m_mdataTimer
Definition: avfdecoder.h:64
class RemoteAVFormatContext * m_inputContext
Definition: avfdecoder.h:58
int m_stat
Definition: avfdecoder.h:46
void seek(double pos) override
Definition: avfdecoder.cpp:392
double m_seekTime
Definition: avfdecoder.h:53
MythCodecMap m_codecMap
Definition: avfdecoder.h:60
double lengthInSeconds()
long m_bitrate
Definition: avfdecoder.h:51
void deinit()
Definition: avfdecoder.cpp:401
~avfDecoder(void) override
Definition: avfdecoder.cpp:242
uint8_t * m_outputBuffer
Definition: avfdecoder.h:47
AVCodecContext * m_audioDec
Definition: avfdecoder.h:59
bool m_inputIsFile
Definition: avfdecoder.h:62
QString m_lastMetadataParsed
Definition: avfdecoder.h:66
int m_errCode
Definition: avfdecoder.h:68
const AVInputFormat * m_inputFormat
Definition: avfdecoder.h:57
QString m_lastMetadata
Definition: avfdecoder.h:65
bool m_finish
Definition: avfdecoder.h:49
long m_freq
Definition: avfdecoder.h:50
bool m_inited
Definition: avfdecoder.h:44
avfDecoder(const QString &file, DecoderFactory *d, AudioOutput *o)
Definition: avfdecoder.cpp:230
bool m_userStop
Definition: avfdecoder.h:45
int m_channels
Definition: avfdecoder.h:52
static const iso6937table * d