
from threading import Thread
import cv2
class FASTIO:
	def __init__(self, src=0):
		self.stream = cv2.VideoCapture(src)
		(self.access,self.frame) = self.stream.read()
		self.stopped = False
	def start(self):
		Thread(target=self.update,args=()).start()
		return self
	def update(self):
		while True:
			if self.stopped:
				return
			(self.access,self.frame) = self.stream.read()
	def read(self):
		return self.frame
	def stop(self):
		
		self.stopped = True
