|
|
|
|
|
|
public unsafe struct NativeFrameStream : IDisposable |
|
|
|
{ |
|
|
|
public string filename; |
|
|
|
public int frameOffset; |
|
|
|
public long frameOffset; |
|
|
|
public int frameCount; |
|
|
|
public int frameSize; |
|
|
|
|
|
|
|
|
|
|
public NativeArray<ReadHandle> ringDataHnd; |
|
|
|
public NativeArray<int> ringDataTag; |
|
|
|
|
|
|
|
public NativeFrameStream(string filename, int frameOffset, int frameCount, int frameSize, int seekRadius, int ringCapacity = -1) |
|
|
|
public NativeFrameStream(string filename, long frameOffset, int frameCount, int frameSize, int seekRadius, int ringCapacity = -1) |
|
|
|
{ |
|
|
|
this.filename = filename; |
|
|
|
this.frameOffset = frameOffset; |
|
|
|
|
|
|
// schedule the read
|
|
|
|
ReadCommand cmd; |
|
|
|
cmd.Buffer = frameSize * ringIndex + ringDataPtr; |
|
|
|
cmd.Offset = frameSize * readIndex + frameOffset; |
|
|
|
cmd.Offset = frameSize * (long)readIndex + frameOffset; |
|
|
|
cmd.Size = frameSize; |
|
|
|
ringDataHnd[ringIndex] = AsyncReadManager.Read(filename, &cmd, 1); |
|
|
|
|
|
|
|