Avoiding multiple video capture processes.

parent 77606490
......@@ -19,13 +19,14 @@ public class FFmpegCapture : MonoBehaviour
if (cameraCapture == null)
{
cameraCapture = Camera.main.GetComponentInChildren<CameraCapture>();
if (useScreenSize)
{
cameraCapture.height = Screen.height;
cameraCapture.width = Screen.width;
}
cameraCapture.enabled = true;
}
if (useScreenSize)
{
cameraCapture.height = Screen.height;
cameraCapture.width = Screen.width;
}
cameraCapture.enabled = true;
// else: capture already in progress
}
public string StopCapture()
......@@ -37,7 +38,9 @@ public class FFmpegCapture : MonoBehaviour
else
{
cameraCapture.enabled = false;
return cameraCapture.videoPath;
string path = cameraCapture.videoPath;
cameraCapture = null;
return path;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment