-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathQMDKPlayer.h
52 lines (43 loc) · 1.29 KB
/
QMDKPlayer.h
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
45
46
47
48
49
50
51
52
/*
* Copyright (c) 2018-2025 WangBin <wbsecg1 at gmail.com>
* MDK SDK with QOpenGLWidget example
*/
#ifndef QMDKPlayer_H
#define QMDKPlayer_H
#include <QObject>
#include <memory>
namespace mdk {
class Player;
struct RenderAPI;
}
#ifndef Q_MDK_API
#define Q_MDK_API Q_DECL_IMPORT
#endif
class Q_MDK_API QMDKPlayer : public QObject
{
Q_OBJECT
public:
QMDKPlayer(QObject *parent = nullptr);
~QMDKPlayer();
// decoders: "VideoToolbox", "VAAPI", "VDPAU", "D3D11", "DXVA", "NVDEC", "CUDA", "CedarX"(sunxi), "AMediaCodec", "FFmpeg"
void setDecoders(const QStringList& dec);
void setMedia(const QString& url);
bool isPaused() const;
void seek(qint64 ms);
qint64 position() const;
void addRenderer(QObject* vo = nullptr, int w = -1, int h = -1);
void updateRenderer(QObject* vo = nullptr, int w = -1, int h = -1);
void setRenderAPI(mdk::RenderAPI* ra, QObject* vo = nullptr);
void renderVideo(QObject* vo = nullptr);
void destroyGLContext(QObject* vo);
void setROI(QObject* vo, const float* videoRoi, const float* viewportRoi = nullptr);
Q_SIGNALS:
void videoSizeChanged(const QSize& size);
public slots:
void play();
void pause(bool value = true);
void stop();
private:
std::unique_ptr<mdk::Player> player_;
};
#endif // QMDKPlayer_H