webrtc-sdk / libwebrtc

A C++ wrapper for binary release, mainly used for flutter-webrtc desktop (windows, linux, embedded).
MIT License
382 stars 78 forks source link

使用work_thread进行屏幕捕获 #16

Closed zjzhang-cn closed 2 years ago

cloudwebrtc commented 2 years ago

等我空一点了会尝试编译运行.

zjzhang-cn commented 2 years ago

flutter部分也要修改

cloudwebrtc commented 2 years ago

需要和flutter 层面和 native sdk 层面一起考虑,导出一个合适的API 给 native 和flutter 使用 https://github.com/flutter-webrtc/flutter-webrtc/issues/799

zjzhang-cn commented 2 years ago

可以,我修改后在提交

cloudwebrtc commented 2 years ago

@zjzhang-cn 我们可以一起讨论桌面共享接口实现方式,最终在flutter desktop 上实现出类似 chrome 窗口选择框的效果,可以捕获所有显示器,或某一个显示器里面的特定窗口,并带有预览

类似下面的伪代码

enum SourceType {
     kWindow,
     kEntireScreen,
}

class Source {
   string id;
   string window_title;
   JPEG getThumbnails();
   SourceType type;
}

class RTCDesktopCapturer {
 public:
  virtual RTCVideoCapturer<RTCVideoCapturer> CreateScreenCapturer(string index_of_screen) = 0;
  virtual RTCVideoCapturer<RTCVideoCapturer> CreateWindowCapturer(Source source) = 0;
  virtual List<Source> EnumerateWindow() = 0;
};
zjzhang-cn commented 2 years ago

重新规划一下,在提交