Skip to main content
Version: 20 Mar 2024

AppDefinedVideoSource

Class that represents an app defined video source that can be used by the MLWebRTC API. More...

Inherits from:
AppDefinedSource,
Track

Inherited by:
UnityEngine.XR.MagicLeap.MLWebRTC.MLCameraVideoSource

Detailed Description

public class AppDefinedVideoSource : AppDefinedSource 

Details*

Class that represents a source used by the MLWebRTC API.


Public Methods

override MLResult DestroyLocal

Destroys the Track and its associated media source.

public virtual override MLResult DestroyLocal()

Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent.

Reimplements: DestroyLocal


MLResult InitializeLocal

Initializes the given AppDefinedVideoSource object.

public static MLResult InitializeLocal(
AppDefinedVideoSource appDefinedVideoSource
)

Parameters

TypeNameDescription
AppDefinedVideoSourceappDefinedVideoSourceThe AppDefinedVideoSource object to initialize.
resultThe MLResult object of the inner platform call(s).

Returns: An AppDefinedVideoSource object with the given handle.


Protected Methods

PushFrame

Pushes a frame into the defined video source.

protected MLResult PushFrame(
VideoSink.Frame frame
)

Parameters

TypeNameDescription
VideoSink.FrameframeThe frame to push to the video source.

Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.InvalidParam if an invalid parameter was passed. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent. MLResult.Result will be MLResult.Code.WebRTCResultInvalidFrameFormat if an invalid frame format was specified. MLResult.Result will be MLResult.Code.WebRTCResultInvalidFramePlaneCount if an invalid plane count was specified for the given frame format. MLResult.Result will be MLResult.Code.WebRTCSendNativeFrameError pushing a native format frame fails.