This sample is for consumers who want to store frame-shaped data while keeping application-specific frame parsing outside the core package. It puts frame metadata in descriptor bytes and frame payload bytes in the value span.
- Consumer-owned descriptor layout through
FrameDescriptor. - Opaque payload bytes.
- Two simultaneous
ValueLeasereaders. RemovePendingwhile readers protect a slot.- Slot reuse after readers release.
- Frame-neutral behavior: the core store treats the frame and non-frame value the same way.
- .NET SDK compatible with
net10.0. - Linux or Windows for ordinary runtime validation.
- Repository checkout from the repository root.
dotnet run --project samples/FrameValue/FrameValue.csproj -c ReleaseExpected success shape:
Success
Success
Success
frame 1280x720, bytes 1300000, readers equal True
RemovePending
Success
Success
non-frame bytes: 3
RemovePending is expected because two active readers still protect the frame
value when removal is requested. After both leases are disposed, the sample
publishes a non-frame value to show storage reuse and frame neutrality.
UnsupportedPlatform: the current platform does not support the required named memory-mapped-file behavior.ValueTooLargeorDescriptorTooLarge: the sample frame or descriptor no longer fits the configured capacities.LeaseTableFull: the lease record capacity is too small for the reader count.
If open fails, the program prints open failed: <status> and exits with a
nonzero code.
The sample uses a unique store name for each run, disposes reader leases, and disposes the store handle before exiting. It does not require manual file cleanup.
The descriptor format is a sample convention, not a package schema. The core package does not parse frames, validate pixel formats, or persist frame data. C++ and Python can exchange the same opaque bytes through SMS2; this sample keeps its application-specific frame adapter in C#.