for that, we should create a new capture event if one isn't already created, i.e at startup it will create a capture event from which we will get frames from camera.
In case the capture was already created (i.e once the application had begun) then now it will do either of the following based on value of captureInProgress: