Protocols

The following protocols are available globally.

  • This represents an IVSDevice that provides audio samples.

    See more

    Declaration

    Objective-C

    @protocol IVSAudioDevice <IVSDevice>

    Swift

    protocol IVSAudioDevice : IVSDevice
  • An extention of IVSAudioDevice that allows for submitting CMSampleBuffers manually. This can be used to submit PCM audio directly to the SDK.

    Note

    Make sure you have an IVSMixerSlotConfiguration that requests the preferredAudioInput value of IVSDeviceTypeUserAudio.
    See more

    Declaration

    Objective-C

    @protocol IVSCustomAudioSource <IVSAudioDevice>

    Swift

    protocol IVSCustomAudioSource : IVSAudioDevice
  • An extension of IVSAudioDevice that represents a physical microphone accessible by the host device.

    See more

    Declaration

    Objective-C

    @protocol IVSMicrophone <IVSAudioDevice>

    Swift

    protocol IVSMicrophone : IVSAudioDevice
  • A delegate that provides updates about the attached microphone.

    See more

    Declaration

    Objective-C

    @protocol IVSMicrophoneDelegate

    Swift

    protocol IVSMicrophoneDelegate
  • Provide a delegate to receive status updates and errors from the SDK. Updates may be run on arbitrary threads and not the main thread.

    See more

    Declaration

    Objective-C

    @protocol IVSBroadcastSessionDelegate <NSObject>

    Swift

    protocol Delegate : NSObjectProtocol
  • Represents an input device such as a camera or microphone.

    See more

    Declaration

    Objective-C

    @protocol IVSDevice <NSObject>

    Swift

    protocol IVSDevice : NSObjectProtocol
  • This represents an IVSDevice that provides video samples.

    See more

    Declaration

    Objective-C

    @protocol IVSImageDevice <IVSDevice>

    Swift

    protocol IVSImageDevice : IVSDevice
  • An extention of IVSImageDevice that allows for submitting CMSampleBuffers manually. The currently supported pixel formats are: kCVPixelFormatType_32BGRA kCVPixelFormatType_420YpCbCr8BiPlanarFullRange kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange On devices that support it, the Lossless and Lossy equivalents of these formats are also supported.

    Note

    Make sure you have an IVSMixerSlotConfiguration that requests the preferredVideoInput value of IVSDeviceTypeUserVideo.
    See more

    Declaration

    Objective-C

    @protocol IVSCustomImageSource <IVSImageDevice>

    Swift

    protocol IVSCustomImageSource : IVSImageDevice
  • An extention of IVSCustomImageSource that is used to pre-encode an image or video to be rendered when the application goes into the background.

    The timing information on the samples provided via onSampleBuffer is ignored on this image source, every image submitted will be encoded as the next frame based on the targetFramerate on the provided IVSVideoConfiguration.

    Note

    samples submitted will be processed on the invoking thread. For large amounts samples, submit them on a background queue.

    Generating large numbers of samples from MP4 files is fairly straight forward using AVFoundation. There are multiple ways to do it in fact You can use AVAssetImageGenerator and generateCGImagesAsynchronously to generate an image at every 1 / FPS increment. Be certain to set requestedTimeToleranceAfter and requestedTimeToleranceBefore to .zero, otherwise it will batch the same frame multiple times.

    You can also use an AVPlayer instance with AVPlayerItemVideoOutput and a DisplayLink, using the copyPixelBuffer API from the video output.

    Both can provide a series of CVPixelBuffers to submit to this API in order to broadcast a looping clip while in the background.

    See more

    Declaration

    Objective-C

    @protocol IVSBackgroundImageSource <IVSCustomImageSource>

    Swift

    protocol IVSBackgroundImageSource : IVSCustomImageSource