IOStream

open class IOStream : NSObject
extension IOStream: IOScreenCaptureUnitDelegate
extension IOStream: SCStreamOutput

The IOStream class is the foundation of a RTMPStream.

  • The enumeration defines the state a ReadyState NetStream is in.

    See more

    Declaration

    Swift

    public enum ReadyState : Equatable
  • The lockQueue.

    Declaration

    Swift

    public let lockQueue: DispatchQueue
  • Specifies the adaptibe bitrate strategy.

    Declaration

    Swift

    public var bitrateStrategy: any IOStreamBitRateStrategyConvertible { get set }
  • Specifies the audio monitoring enabled or not.

    Declaration

    Swift

    public var isMonitoringEnabled: Bool { get set }
  • Specifies the context object.

    Declaration

    Swift

    public var context: CIContext { get set }
  • Specifiet the device torch indicating wheter the turn on(TRUE) or not(FALSE).

    Declaration

    Swift

    public var torch: Bool { get set }
  • Specifies the frame rate of a device capture.

    Declaration

    Swift

    public var frameRate: Float64 { get set }
  • Specifies the sessionPreset for the AVCaptureSession.

    Declaration

    Swift

    @available(tvOS 17.0, *)
    public var sessionPreset: AVCaptureSession.Preset { get set }
  • Specifies the video orientation for stream.

    Declaration

    Swift

    public var videoOrientation: AVCaptureVideoOrientation { get set }
  • Specifies the multi camera capture properties.

    Declaration

    Swift

    @available(*, deprecated, renamed: "videoMixerSettings")
    public var multiCamCaptureSettings: IOVideoMixerSettings { get set }
  • Specifies the video mixer settings..

    Declaration

    Swift

    public var videoMixerSettings: IOVideoMixerSettings { get set }
  • Specifies the hasAudio indicies whether no signal audio or not.

    Declaration

    Swift

    public var hasAudio: Bool { get set }
  • Specifies the hasVideo indicies whether freeze video signal or not.

    Declaration

    Swift

    public var hasVideo: Bool { get set }
  • Specifies the audio compression properties.

    Declaration

    Swift

    public var audioSettings: AudioCodecSettings { get set }
  • Specifies the video compression properties.

    Declaration

    Swift

    public var videoSettings: VideoCodecSettings { get set }
  • The video input format.

    Declaration

    Swift

    public var videoInputFormat: CMVideoFormatDescription? { get }
  • The audio input format.

    Declaration

    Swift

    public var audioInputFormat: AVAudioFormat? { get }
  • The isRecording value that indicates whether the recorder is recording.

    Declaration

    Swift

    public var isRecording: Bool { get }
  • Specifies the controls sound.

    Declaration

    Swift

    public var soundTransform: SoundTransform { get set }
  • The number of frames per second being displayed.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var currentFPS: UInt16 { get }
  • Specifies the delegate.

    Declaration

    Swift

    public weak var delegate: (any IOStreamDelegate)?
  • Specifies the drawable.

    Declaration

    Swift

    public var drawable: (any IOStreamDrawable)? { get set }
  • The current state of the stream.

    Declaration

    Swift

    public var readyState: ReadyState { get set }
  • Creates a NetStream object.

    Declaration

    Swift

    override public init()
  • Attaches the primary camera object.

    Warning

    This method can’t use appendSampleBuffer at the same time.

    Declaration

    Swift

    @available(tvOS 17.0, *)
    @available(*, deprecated, renamed: "attachCamera(_:channel:configuration:﹚")
    public func attachCamera(_ device: AVCaptureDevice?, onError: ((_ error: any Error) -> Void)? = nil)
  • Attaches the 2ndary camera object for picture in picture.

    Warning

    This method can’t use appendSampleBuffer at the same time.

    Declaration

    Swift

    @available(iOS 13.0, tvOS 17.0, *)
    @available(*, deprecated, renamed: "attachCamera(_:channel:configuration:﹚")
    public func attachMultiCamera(_ device: AVCaptureDevice?, onError: ((_ error: any Error) -> Void)? = nil)
  • Attaches the camera object.

    Declaration

    Swift

    @available(tvOS 17.0, *)
    public func attachCamera(_ device: AVCaptureDevice?, channel: UInt8 = 0, configuration: IOVideoCaptureConfigurationBlock? = nil)
  • Returns the IOVideoCaptureUnit by channel.

    Declaration

    Swift

    @available(tvOS 17.0, *)
    public func videoCapture(for channel: UInt8) -> IOVideoCaptureUnit?
  • Attaches the audio capture object.

    Warning

    This method can’t use appendSampleBuffer at the same time.

    Declaration

    Swift

    @available(tvOS 17.0, *)
    public func attachAudio(_ device: AVCaptureDevice?, automaticallyConfiguresApplicationAudioSession: Bool = false, onError: ((_ error: any Error) -> Void)? = nil)
  • Attaches the screen input object.

    Declaration

    Swift

    public func attachScreen(_ input: AVCaptureScreenInput?, channel: UInt8 = 0)
  • Append a CMSampleBuffer.

    Warning

    This method can’t use attachCamera or attachAudio method at the same time.

    Declaration

    Swift

    public func append(_ sampleBuffer: CMSampleBuffer)
  • Append an AVAudioBuffer.

    Warning

    This method can’t use attachAudio method at the same time.

    Declaration

    Swift

    public func append(_ audioBuffer: AVAudioBuffer, when: AVAudioTime)
  • Register a video effect.

    Declaration

    Swift

    public func registerVideoEffect(_ effect: VideoEffect) -> Bool
  • Unregister a video effect.

    Declaration

    Swift

    public func unregisterVideoEffect(_ effect: VideoEffect) -> Bool
  • Starts recording.

    Declaration

    Swift

    public func startRecording(_ delegate: any IORecorderDelegate, settings: [AVMediaType : [String : Any]] = IORecorder.defaultOutputSettings)
  • Stop recording.

    Declaration

    Swift

    public func stopRecording()
  • A handler that receives stream readyState will update.

    Warning

    Please do not call this method yourself.

    Declaration

    Swift

    open func readyStateWillChange(to readyState: ReadyState)
  • A handler that receives stream readyState updated.

    Warning

    Please do not call this method yourself.

    Declaration

    Swift

    open func readyStateDidChange(to readyState: ReadyState)

IOScreenCaptureUnitDelegate