Fix MacOSX compile error

This commit is contained in:
dijunkun
2023-10-10 10:59:36 +08:00
parent 610f89a828
commit 0bfe3bdfd0
12 changed files with 176 additions and 176 deletions

View File

@@ -0,0 +1,26 @@
#include "screen_capture_wgc.h"
#include <iostream>
ScreenCaptureWgc::ScreenCaptureWgc() {}
ScreenCaptureWgc::~ScreenCaptureWgc() {}
bool ScreenCaptureWgc::IsWgcSupported() { return false; }
int ScreenCaptureWgc::Init(const RECORD_DESKTOP_RECT &rect, const int fps,
cb_desktop_data cb) {
return 0;
}
int ScreenCaptureWgc::Start() { return 0; }
int ScreenCaptureWgc::Pause() { return 0; }
int ScreenCaptureWgc::Resume() { return 0; }
int ScreenCaptureWgc::Stop() { return 0; }
void ScreenCaptureWgc::OnFrame() {}
void ScreenCaptureWgc::CleanUp() {}

View File

@@ -0,0 +1,56 @@
#ifndef _SCREEN_CAPTURE_WGC_H_
#define _SCREEN_CAPTURE_WGC_H_
#include <atomic>
#include <functional>
#include <string>
#include <thread>
typedef struct {
int left;
int top;
int right;
int bottom;
} RECORD_DESKTOP_RECT;
typedef std::function<void(unsigned char *, int, int, int)> cb_desktop_data;
typedef std::function<void(int)> cb_desktop_error;
class ScreenCaptureWgc {
public:
ScreenCaptureWgc();
~ScreenCaptureWgc();
public:
bool IsWgcSupported();
int Init(const RECORD_DESKTOP_RECT &rect, const int fps, cb_desktop_data cb);
int Start();
int Pause();
int Resume();
int Stop();
void OnFrame();
protected:
void CleanUp();
private:
std::atomic_bool _running;
std::atomic_bool _paused;
std::atomic_bool _inited;
std::thread _thread;
std::string _device_name;
RECORD_DESKTOP_RECT _rect;
int _fps;
cb_desktop_data _on_data;
cb_desktop_error _on_error;
};
#endif