-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideodecoder.h
More file actions
44 lines (31 loc) · 761 Bytes
/
videodecoder.h
File metadata and controls
44 lines (31 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef VIDEODECODER_H
#define VIDEODECODER_H
#include <QObject>
#include <QMutex>
#include <QThread>
#include <atomic>
extern "C" {
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/imgutils.h>
#include <libavdevice/avdevice.h>
}
class VideoDecoder : public QThread
{
Q_OBJECT
public:
explicit VideoDecoder(QObject* parent = nullptr);
~VideoDecoder();
void startDecoding(const QString& url);
void stopDecoding();
bool isDecoding() const;
signals:
void frameReady(QByteArray frameData, int width, int height, int stride);
protected:
void run() override;
private:
QString m_url;
std::atomic<bool> m_running = false;
QMutex m_mutex;
};
#endif