pullChunkPointerSync method

LSLChunkPointer pullChunkPointerSync({
  1. int maxSamples = 512,
  2. double timeout = 0.0,
})

Pulls a chunk and returns raw pointers into the reusable buffer (zero-copy escape hatch).

Direct mode only. The pointers are valid until the next chunk pull on this inlet or its destruction. For string streams the data buffer holds char* entries owned by liblsl — the caller must release each with lsl_destroy_string.

Implementation

LSLChunkPointer pullChunkPointerSync({
  int maxSamples = 512,
  double timeout = 0.0,
}) => requireDirect(() {
  final pullFn = _ensurePullChunkFn();
  final buf = _ensureChunkBuffer(maxSamples);
  final channels = streamInfo.channelCount;
  final elements = pullFn.pullInto(
    _inletBang,
    buf.data,
    buf.timestamps,
    maxSamples,
    channels,
    timeout,
    buf.ec,
  );
  return LSLChunkPointer(
    buf.data.address,
    buf.timestamps.address,
    elements ~/ channels,
    channels,
    buf.ec.value,
  );
});