SyncedFrameProxy constructor

SyncedFrameProxy(
  1. Pointer<SyncedFrameFfi> _native
)

Takes ownership of native. Super fields are zeroed and never read; all getters below are overridden to read from native memory instead. Do NOT call malloc.free on the struct shell after passing it here, and do not free zero-copy field buffers while the proxy may be read.

Implementation

SyncedFrameProxy(this._native)
  : super(
      pixels: Uint8List(0),
      size: 0,
      width: 0,
      height: 0,
      bytesPerRow: 0,
      pixelFormat: 0,
      isMirrored: 0,
      depth: Uint8List(0),
      depthSize: 0,
      depthWidth: 0,
      depthHeight: 0,
      depthBytesPerRow: 0,
      timestamp: 0,
      textureId: 0,
    ) {
  assert(
    _finalizer != null,
    'SyncedFrameProxy._init() was not called. Ensure the Nitro impl class constructor ran before creating proxies.',
  );
  _finalizer!.attach(
    this,
    _native.cast(),
    detach: this,
    externalSize: sizeOf<SyncedFrameFfi>(),
  );
}