Skip to content

Moving from 1.6.0 APIs to 1.7.x

shogo4405 edited this page Oct 28, 2023 · 7 revisions

NetStream

1.6.1

open class NetStream: NSObject {
    public func appendSampleBuffer(_ sampleBuffer: CMSampleBuffer)
}

1.7.0

open class NetStream: NSObject {
   public func append(_ sampleBuffer: CMSampleBuffer)
}

NetStreamDelegate

1.6.1

/// The interface a NetStream uses to inform its delegate.
public protocol NetStreamDelegate: AnyObject {
    /// Tells the receiver to video error occured.
    func stream(_ stream: NetStream, videoErrorOccurred error: AudioCodec.Error)
    /// Tells the receiver to audio error occured.
    func stream(_ stream: NetStream, audioErrorOccurred error: VideoCodec.Error)
}

1.7.0

/// The interface a NetStream uses to inform its delegate.
public protocol NetStreamDelegate: AnyObject {
    /// Tells the receiver to video error occured.
    func stream(_ stream: NetStream, videoErrorOccurred error: IOVideoUnitError)
    /// Tells the receiver to audio error occured.
    func stream(_ stream: NetStream, audioErrorOccurred error: IOAudioUnitError)
}

AudioEffect

1.6.1

/// An object that apply an audio effect.
open class AudioEffect: NSObject {
    /// Executes to apply an audio effect.
    open func execute(_ buffer: UnsafeMutableAudioBufferListPointer?, format: AudioStreamBasicDescription?) {
    }
}

1.7.0

You can get PCM data, so please process it in this delegate.

/// The interface a NetStream uses to inform its delegate.
public protocol NetStreamDelegate: AnyObject {
    /// Tells the receiver an audio packet incoming.
    func stream(_ stream: NetStream, didOutput audio: AVAudioBuffer, when: AVAudioTime)
}