Front-end
Mac
Mac
  • README
  • ScreenCaptureKit
    • API
      • SCShareableContent
        • [检索共享内容]Retrieving shareable content
        • [共享内容对象]Inspecting shareable content
        • [类型方法]Type Methods
      • Content capture[内容捕获]
        • SCStream[流]
        • SCStreamConfiguration
        • SCContentFilter
        • CSStreamDeleagate
        • SCScreenshotmanger
      • output processing [输出程序]
        • SCStreamOutput
        • SCStreamOutputType
        • SCStreamFrameInfo
        • SCFrameStatus
      • system content-sharing picker[系统内容共享选择器]
        • SCContentSharingPicker
        • SCContentSharingPickerConfiguration
        • SCContentSharingPickerMode
        • SCContentSharingPickerObserver
      • Stream errors
        • SCStreamError
  • Project
    • cut studio
  • issue
    • issue
  • 额外工具
    • Create-dmg
Powered by GitBook
On this page
  1. ScreenCaptureKit
  2. API
  3. Content capture[内容捕获]

SCStream[流]

流对象: 初始化、更新配置(contentfilter/config)、开始/结束

@available(macOS 12.3, *)
open class SCStream : NSObject {

    //   始终同步媒体捕获 —— 同步作用
    @available(macOS 13.0, *)
    open var synchronizationClock: CMClock? { get }

    
    //   初始化,创建一个stream对象
    //  contentFilter 内容过滤器
    //  streamConfig 流配置
    //  delegate 代理
    //  创建一个stream对象并且有指定的内容输出设置
    public init(filter contentFilter: SCContentFilter, configuration streamConfig: SCStreamConfiguration, delegate: (any SCStreamDelegate)?)

    //  给当前的session添加/删除 输出配置
    open func addStreamOutput(_ output: any SCStreamOutput, type: SCStreamOutputType, sampleHandlerQueue: dispatch_queue_t?) throws
    open func removeStreamOutput(_ output: any SCStreamOutput, type: SCStreamOutputType) throws

    
    //  更新shareablecontent的过滤器
    open func updateContentFilter(_ contentFilter: SCContentFilter, completionHandler: (((any Error)?) -> Void)? = nil)
    open func updateContentFilter(_ contentFilter: SCContentFilter) async throws

    
    //  更新配置
    // streamConfig 
    open func updateConfiguration(_ streamConfig: SCStreamConfiguration, completionHandler: (((any Error)?) -> Void)? = nil)
    open func updateConfiguration(_ streamConfig: SCStreamConfiguration) async throws

//  这两个都是更新: 
// updateContentFilter 针对的是shareContent
// updateConfiguration 针对大的是stream
    


    //  开始或者停止捕获
    open func startCapture(completionHandler: (((any Error)?) -> Void)? = nil)
    open func startCapture() async throws
    open func stopCapture(completionHandler: (((any Error)?) -> Void)? = nil)
    open func stopCapture() async throws
}

PreviousContent capture[内容捕获]NextSCStreamConfiguration

Last updated 1 year ago