sck_picker_handle.h (1726B)
1 /* 2 * Copyright (c) 2024 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_DESKTOP_CAPTURE_MAC_SCK_PICKER_HANDLE_H_ 12 #define MODULES_DESKTOP_CAPTURE_MAC_SCK_PICKER_HANDLE_H_ 13 14 #include <os/availability.h> 15 #include <cstddef> 16 #include <memory> 17 #include "modules/desktop_capture/desktop_capturer.h" 18 19 @class SCContentSharingPicker; 20 @class SCStream; 21 22 namespace webrtc { 23 24 // Helper class to manage multiple users of SCContentSharingPicker. 25 // 26 // The `active` and `maximumStreamCount` properties are automatically managed on 27 // `SCContentSharingPicker.sharedPicker`, which is what is returned from 28 // GetPicker(). 29 // 30 // When using this class, for stream limits to work, only create one stream per 31 // handle. 32 // 33 // Designed for single thread use. 34 class API_AVAILABLE(macos(14.0)) SckPickerHandleInterface { 35 public: 36 virtual ~SckPickerHandleInterface() = default; 37 // Effectively identical to `SCContentSharingPicker.sharedPicker`. 38 virtual SCContentSharingPicker* GetPicker() const = 0; 39 // A SourceId unique to this handle. 40 virtual DesktopCapturer::SourceId Source() const = 0; 41 }; 42 43 // Returns a newly created picker handle if the stream count limit has not been 44 // reached, null otherwise. 45 std::unique_ptr<SckPickerHandleInterface> API_AVAILABLE(macos(14.0)) 46 CreateSckPickerHandle(); 47 48 } // namespace webrtc 49 50 #endif // MODULES_DESKTOP_CAPTURE_MAC_SCK_PICKER_HANDLE_H_