Formatted and synchronised with VideoCapture.java in branchoff.