Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

487 B
Raw Blame
#pragma once

#include <windows.h>
#include <winrt/base.h>

#include <memory>
#include <utility>

namespace piik::capture {

// Revocation does not join an in-flight WinRT callback. Let the delegate retain
// its signal until the final callback returns, without retaining the capture.
inline auto CaptureEventHandler(std::shared_ptr<winrt::handle> event) {
  return [event = std::move(event)](const auto&, const auto&) {
    SetEvent(event->get());
  };
}

}  // namespace piik::capture