forked from AgoraIO/API-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensionVideoFilter.hpp
More file actions
50 lines (41 loc) · 1.82 KB
/
ExtensionVideoFilter.hpp
File metadata and controls
50 lines (41 loc) · 1.82 KB
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
//
// Created by 张涛 on 2020/4/26.
//
#ifndef AGORA_EXTENSIONVIDEOFILTER_H
#define AGORA_EXTENSIONVIDEOFILTER_H
#include "AgoraRtcKit/NGIAgoraMediaNode.h"
#include <AgoraRtcKit/AgoraRefCountedObject.h>
#include "AgoraRtcKit/AgoraRefPtr.h"
#include "VideoProcessor.hpp"
#include "external_thread_pool.h"
namespace agora {
namespace extension {
class ExtensionVideoFilter : public agora::rtc::IExtensionVideoFilter {
public:
ExtensionVideoFilter(agora_refptr<YUVImageProcessor> processor);
~ExtensionVideoFilter();
void getProcessMode(ProcessMode& mode, bool& isolated) override;
int start(agora::agora_refptr<Control> control) override;
int stop() override;
void getVideoFormatWanted(rtc::VideoFrameData::Type& type, rtc::RawPixelBuffer::Format& format) override;
IExtensionVideoFilter::ProcessResult pendVideoFrame(
agora::agora_refptr<rtc::IVideoFrame> frame) override;
IExtensionVideoFilter::ProcessResult adaptVideoFrame(
agora::agora_refptr<rtc::IVideoFrame> src, agora::agora_refptr<rtc::IVideoFrame>& dst) override;
void setEnabled(bool enable) override;
bool isEnabled() override;
int setProperty(const char* key, const void* buf, size_t buf_size) override;
int getProperty(const char* key, void* buf, size_t buf_size) override;
private:
agora::agora_refptr<Control> control_;
agora::agora_refptr<YUVImageProcessor> YUVProcessor;
bool isInitOpenGL = false;
ProcessMode mode_;
agora::extension::ThreadPool threadPool_;
int invoker_id = -1;
protected:
ExtensionVideoFilter() = delete;
};
}
}
#endif //AGORA_EXTENSIONVIDEOFILTER_H