#NEWLINE# def gen_process( self ) : #NEWLINE# #INDENT# device = '/dev/video0' #NEWLINE# capturesize = vidsize #NEWLINE# camera = pygame . camera . Camera ( device , capturesize ) #NEWLINE# camera . start ( ) #NEWLINE# count = 0 #NEWLINE# ts = time . time ( ) #NEWLINE# print ( 'START' ) #NEWLINE# while True : #NEWLINE# #INDENT# time . sleep ( 0.02 ) #NEWLINE# ( yield 1 ) #NEWLINE# count += 1 #NEWLINE# snapshot = camera . get_image ( ) #NEWLINE# now = time . time ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . produce ( snapshot , now ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( count > 30 ) : #NEWLINE# #INDENT# print ( ts , time . time ( ) , 'Count' , count , end = '' ) #NEWLINE# dur = ( time . time ( ) - ts ) #NEWLINE# if ( dur > 0 ) : #NEWLINE# #INDENT# print ( 'RATE: ' , ( count / ( time . time ( ) - ts ) ) ) #NEWLINE# #UNINDENT# count = 0 #NEWLINE# ts = time . time ( )