[fix] fix compile error on MacOSx

This commit is contained in:
dijunkun
2025-05-15 19:54:17 +08:00
parent eca4f614c8
commit 6ebf583a13
5 changed files with 32 additions and 15 deletions

View File

@@ -42,9 +42,9 @@ int ScreenCapturerSck::Start() {
int ScreenCapturerSck::Stop() { return 0; }
int ScreenCapturerSck::Pause() { return 0; }
int ScreenCapturerSck::Pause(int monitor_index) { return 0; }
int ScreenCapturerSck::Resume() { return 0; }
int ScreenCapturerSck::Resume(int monitor_index) { return 0; }
void ScreenCapturerSck::OnFrame() {}

View File

@@ -27,9 +27,13 @@ class ScreenCapturerSck : public ScreenCapturer {
virtual int Start() override;
virtual int Stop() override;
int Pause();
int Pause(int monitor_index) override;
int Resume();
int Resume(int monitor_index) override;
int SwitchTo(int monitor_index) override { return 0; }
std::vector<DisplayInfo> GetDisplayInfoList() override { return {}; }
void OnFrame();

View File

@@ -56,6 +56,14 @@ public:
virtual int Stop() { return 0; }
virtual int Pause(int monitor_index) { return 0; }
virtual int Resume(int monitor_index) { return 0; }
virtual int SwitchTo(int monitor_index) { return 0; }
virtual std::vector<DisplayInfo> GetDisplayInfoList() { return {}; }
private:
SckHelper *__strong helper_;
SCStream *__strong stream_;
@@ -246,7 +254,7 @@ void ScreenCapturerSckImpl::OnNewIOSurface(IOSurfaceRef io_surface,
nv12_frame_ =
static_cast<unsigned char *>(IOSurfaceGetBaseAddress(io_surface));
_on_data(nv12_frame_, width * height * 3 / 2, width, height);
_on_data(nv12_frame_, width * height * 3 / 2, width, height, 0);
IOSurfaceUnlock(io_surface, kIOSurfaceLockReadOnly, &aseed);
}