Skip to content

Commit

Permalink
🚨 Try fix macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Oct 19, 2024
1 parent 99fd477 commit 0c2bd61
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/internal/wcam_macos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,10 @@ class CaptureImpl : public ICaptureImpl {
public:
CaptureImpl(DeviceId const& id, Resolution const& resolution);
~CaptureImpl() override;

auto image() -> MaybeImage override
{
std::lock_guard lock{_mutex};

auto res = std::move(_image);
if (std::holds_alternative<img::Image>(_image))
_image = NoNewImageAvailableYet{}; // Make sure we know that the current image has been consumed

return res; // We don't use std::move here because it would prevent copy elision
}

private:
auto is_disconnected() -> bool;

private:
MaybeImage _image{NoNewImageAvailableYet{}};
Resolution _resolution;
std::mutex _mutex{};
CaptureImpl(CaptureImpl const&) = delete;
auto operator=(CaptureImpl const&) -> CaptureImpl& = delete;
CaptureImpl(CaptureImpl&&) noexcept = delete;
auto operator=(CaptureImpl&&) noexcept -> CaptureImpl& = delete;
};

} // namespace wcam::internal
Expand Down

0 comments on commit 0c2bd61

Please sign in to comment.