Make DesktopFrameCGImage::CreateFromCGImage() public

CreateFromCGImage() is needed to be called directly when we move away
from using the deprecated API that is used in CreateForWindow().

Bug: chromium:1471931
Change-Id: I28a2972a2a995103829fd9aff4bc1137a8b424b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315324
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#40563}
This commit is contained in:
Johannes Kron 2023-08-10 11:47:15 +00:00 committed by WebRTC LUCI CQ
parent a39d7643ef
commit e5af52e1f2

View File

@ -20,7 +20,7 @@
namespace webrtc {
class DesktopFrameCGImage final : public DesktopFrame {
class RTC_EXPORT DesktopFrameCGImage final : public DesktopFrame {
public:
// Create an image containing a snapshot of the display at the time this is
// being called.
@ -33,15 +33,15 @@ class DesktopFrameCGImage final : public DesktopFrame {
static std::unique_ptr<DesktopFrameCGImage> CreateForWindow(
CGWindowID window_id);
static std::unique_ptr<DesktopFrameCGImage> CreateFromCGImage(
rtc::ScopedCFTypeRef<CGImageRef> cg_image);
~DesktopFrameCGImage() override;
DesktopFrameCGImage(const DesktopFrameCGImage&) = delete;
DesktopFrameCGImage& operator=(const DesktopFrameCGImage&) = delete;
private:
static std::unique_ptr<DesktopFrameCGImage> CreateFromCGImage(
rtc::ScopedCFTypeRef<CGImageRef> cg_image);
// This constructor expects `cg_image` to hold a non-null CGImageRef.
DesktopFrameCGImage(DesktopSize size,
int stride,