Avoid extra managed clone before camera upload
This commit is contained in:
parent
58e7af8a76
commit
85e04cf687
2 changed files with 6 additions and 2 deletions
|
|
@ -102,7 +102,9 @@ public sealed unsafe class MimirKsVideoCaptureDriver : IMimirVideoCaptureDriver,
|
|||
timestampNs,
|
||||
ResourceKey: resourceKey,
|
||||
ProducerFenceValue: sequence);
|
||||
data = scratch.AsMemory(0, byteLength).ToArray();
|
||||
data = string.IsNullOrWhiteSpace(resourceKey)
|
||||
? scratch.AsMemory(0, byteLength).ToArray()
|
||||
: scratch.AsMemory(0, byteLength);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,9 @@ public sealed unsafe class MimirPs3EyeVideoCaptureDriver : IMimirVideoCaptureDri
|
|||
timestampNs,
|
||||
ResourceKey: resourceKey,
|
||||
ProducerFenceValue: sequence);
|
||||
data = scratch.AsMemory(0, byteLength).ToArray();
|
||||
data = string.IsNullOrWhiteSpace(resourceKey)
|
||||
? scratch.AsMemory(0, byteLength).ToArray()
|
||||
: scratch.AsMemory(0, byteLength);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue