Closed AndrewRH closed 3 years ago
Hi. Would be also quite useful to be notified when the (future) async StopCapture will finish its work. Looking forward to it!
@leavittx I've put up a preview package here with support for non-blocking StopCapture()
https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/releases/tag/4.4.2
You can simply use it as is and it should work, but if you need to know when the file writing is complete then you can register for notification (see ScreenCaptureDemo.cs for an implementation):
void Start()
{
_capture.BeginFinalFileWritingAction += OnBeginFinalFileWriting;
}
void OnBeginFinalFileWriting(FileWritingHandler handler)
{
_fileWritingHandler = handler;
}
void Update()
{
if (_fileWritingHandler != null)
{
if (_fileWritingHandler.IsFileReady())
{
Debug.Log("File is ready " + _fileWritingHandler.Path);
_fileWritingHandler = null;
}
}
}
Let me know if that works for you and then we can get it into a proper release.
Thanks,
I'm closing this issue as the feature request has been implemented in 4.4.2 and we are about to release 4.4.3
Some captures can take quite a while to stop, and currently this blocks the calling thread. There should be an async version of StopCapture()