IVSImageDevice
This represents an IVSDevice that provides video samples.
- 
                  
                  
Sets the current rotation of the video device. This will be used to transform the output stream
This is handled automatically when attaching a camera via an
IVSDeviceDescriptor.Declaration
Objective-C
- (void)setHandsetRotation:(float)rotation;Swift
func setHandsetRotation(_ rotation: Float)Parameters
rotationThe rotation in radians
 - 
                  
                  
Gets a view that will render a preview image of this device.
Note
this must be called on the main thread
Declaration
Objective-C
- (nullable IVSImagePreviewView *)previewViewWithError: (NSError *_Nullable *_Nullable)outError;Swift
func previewView() throws -> IVSImagePreviewViewParameters
outErrorOn input, a pointer to an error object. If an error occurs, the pointer is an NSError object that describes the error. If you don’t want error information, pass in nil.
 - 
                  
                  
Gets a view that will render a preview image of this device with the provided aspect ratio.
Note
this must be called on the main thread
Declaration
Objective-C
- (nullable IVSImagePreviewView *) previewViewWithAspectMode:(IVSAspectMode)aspectMode error:(NSError *_Nullable *_Nullable)outError;Swift
func previewView(with aspectMode: IVSBroadcastConfiguration.AspectMode) throws -> IVSImagePreviewViewParameters
aspectModethe aspect mode to apply to the image stream rendering on the view.
outErrorOn input, a pointer to an error object. If an error occurs, the pointer is an NSError object that describes the error. If you don’t want error information, pass in nil.
 - 
                  
                  
Set a callback to receive information about image frames as they move through this device. This will always be invoked on the main queue. The
pixelBufferproperty onIVSImageDeviceFramewill benil. Use theincludePixelBuffer:YESAPI to get thepixelBufferas well.Declaration
Objective-C
- (void)setOnFrameCallback: (nullable void (^)(IVSImageDeviceFrame *_Nonnull))callback;Swift
func setOnFrameCallback(_ callback: ((IVSImageDeviceFrame) -> Void)?)Parameters
callbackthat takes a
IVSImageDeviceFrame - 
                  
                  
Set a callback to receive information about image frames as they move through this device.
Declaration
Objective-C
- (void)setOnFrameCallbackQueue:(nonnull dispatch_queue_t)delegateQueue includePixelBuffer:(BOOL)includePixelBuffer frameCallback: (nullable void (^)(IVSImageDeviceFrame *_Nonnull)) frameCallback;Swift
func setOnFrameCallbackQueue(_ delegateQueue: dispatch_queue_t, includePixelBuffer: Bool, frameCallback: ((IVSImageDeviceFrame) -> Void)? = nil)Parameters
delegateQueuethe queue to invoke the callback on.
includePixelBufferoptionally populate the
pixelBufferproperty onIVSImageDeviceFrame. The host application is responsible for all memory management of the buffer.frameCallbackthat takes a
IVSImageDeviceFrame - 
                  
                  
Create an
AVSampleBufferDisplayLayerthat will have sample buffers rendered to. The SDK handles all rendering and flushing and the host application should avoid calling anything that directly deals with rendering media samples.Note
this does not respect thesetHandsetRotationAPI. Any rotation will need to be applied manually to the layer, including the automatic front facing camera mirroring.Declaration
Objective-C
- (nonnull AVSampleBufferDisplayLayer *)createSampleBufferDisplayLayer;Swift
func createSampleBufferDisplayLayer() -> AVSampleBufferDisplayLayer - 
                  
                  
Embeds a metadata message into the video stream.
Note
This feature is only supported when using the Real-Time Stages SDK and will not work with the Broadcast SDK alone.Declaration
Objective-C
- (BOOL)embedMessage:(nonnull NSData *)message withRepeatCount:(NSUInteger)repeatCount error:(NSError *_Nullable *_Nullable)outError;Swift
func embedMessage(_ message: Data, withRepeatCount repeatCount: UInt) throwsParameters
messageThe message payload as NSData.
repeatCountNumber of additional video frames the message should appear in (0 = appears in one frame only, 1 = appears in two frames total, etc.). Use values greater than 0 to increase delivery reliability by embedding the message in multiple frames, helping to mitigate packet loss.
errorIf an error occurs, this pointer is set to an error object containing the error information.
Return Value
YES if the message was successfully embedded, NO if an error occurred.