forked from AgoraIO/Agora-with-QT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo_render_impl.h
executable file
·31 lines (27 loc) · 1.03 KB
/
video_render_impl.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
#ifndef VIDEORENDERER_IMPL_H
#define VIDEORENDERER_IMPL_H
#include <IAgoraMediaEngine.h>
#include <QObject>
#include <mutex>
class AVideoWidget;
//Instances of VideoRenderImpl is created and destroyed by Agora Media Engine.
//AVideoWidget is created and destroyed by the APP
//VideoRenderImpl must check if the video widget is alive whenever access to the view.
class VideoRenderImpl : public QObject, public agora::media::IExternalVideoRender
{
Q_OBJECT
public:
VideoRenderImpl(const agora::media::ExternalVideoRenerContext& context);
~VideoRenderImpl();
virtual void release() override {delete this;}
virtual int initialize() override {return 0;}
virtual int deliverFrame(const agora::media::IVideoFrame& videoFrame, int rotation, bool mirrored) override;
public slots:
void handleWidgetInvalidated();
void handleViewSizeChanged(int width, int height);
private:
AVideoWidget* m_view;
agora::media::IExternalVideoRenderCallback* m_renderCallback;
std::mutex m_mutex;
};
#endif // VIDEORENDERER_IMPL_H