

 
 - import toybrick as toy
 
- import time
 
 
 
- if __name__ == '__main__':
 
-     count = 0
 
-     begintime = time.time()
 
 
-     hdmi = toy.HdmiCapture(1920, 1080)
 
-     disp = toy.Display('', 1920, 1080, True)
 
-     print("Connect display width = " + str(disp.width()) + " ; height = " + str(disp.height()))
 
-     while True:
 
-         ret, frame = hdmi.read(1920, 1080)
 
-         if frame is not None:
 
-             ret = disp.imshow(frame)
 
-             if ret == toy.RET_TERMINATED:
 
-                 break
 
-             count += 1
 
-             if time.time() - begintime >= 10:
 
-                 fps = count / (time.time() - begintime)
 
-                 print('fps = ' + str(fps))
 
-                 count = 0
 
-                 begintime = time.time()
 
-     # End of While
 
复制代码| 欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |