Added option to flush manually
This commit is contained in:
@@ -83,11 +83,11 @@ namespace GhostSystem
|
||||
RecordSample();
|
||||
}
|
||||
|
||||
if (_frameBuffer.Count >= BatchSize || _flushTimer >= FlushInterval)
|
||||
/*if (_frameBuffer.Count >= BatchSize || _flushTimer >= FlushInterval)
|
||||
{
|
||||
_flushTimer = 0f;
|
||||
_ = FlushBatchAsync(); // Fire and forget
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
private void RecordSample()
|
||||
@@ -105,6 +105,8 @@ namespace GhostSystem
|
||||
|
||||
var batch = new List<FrameModel>(_frameBuffer);
|
||||
_frameBuffer.Clear();
|
||||
Debug.Log("Flush Frame Buffer");
|
||||
Debug.Log("Buffer: " + batch.Count);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -153,6 +155,7 @@ namespace GhostSystem
|
||||
sceneIdReady = false;
|
||||
OnStopRecord?.Invoke();
|
||||
Debug.Log($"Stop recording: {SceneId}");
|
||||
Debug.Log("Framebuffer: " + _frameBuffer.Count + "Frames");
|
||||
|
||||
if (doorCount > 0 && TrackedObjects.Count >= doorCount)
|
||||
{
|
||||
@@ -161,6 +164,12 @@ namespace GhostSystem
|
||||
|
||||
doorCount = 0;
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
_flushTimer = 0f;
|
||||
_ = FlushBatchAsync(); // Fire and forget
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user