public static MLWebRTCFrame Create() { MLWebRTCFrame frameNative = new MLWebRTCFrame(); frameNative.Version = 1; frameNative.PlaneCount = ImagePlane.MaxImagePlanes; frameNative.Format = OutputFormat.YUV_420_888; return(frameNative); }
/// <summary> /// Creates and returns an initialized version of this struct from a MLWebRTC.VideoSink.Frame object. /// </summary> /// <param name="frame">The frame object to use for initializing.</param> /// <returns>An initialized version of this struct.</returns> public static MLWebRTCFrame Create(MLWebRTC.VideoSink.Frame frame) { MLWebRTCFrame frameNative = new MLWebRTCFrame(); frameNative.Version = 1; frameNative.PlaneCount = (ushort)frame.ImagePlanes.Length; frameNative.ImagePlanes = nativeImagePlanesBuffer.Get(); for (int i = 0; i < frame.ImagePlanes.Length; ++i) { frameNative.ImagePlanes[i].Data = frame.ImagePlanes[i]; } frameNative.TimeStamp = frame.TimeStampUs; frameNative.Format = frame.Format; return(frameNative); }
public static extern MLResult.Code MLWebRTCFrameGetData(ulong frameHandle, ref MLWebRTCFrame frame);