Skip to content

Commit

Permalink
Fix camera test script
Browse files Browse the repository at this point in the history
  • Loading branch information
scotty007 committed Sep 8, 2020
1 parent 6ed57bd commit ae994bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/test/checkcamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def testFormat(self):
self.loadEmptyScene()
self.__openCamera()
self.actions = [None, None]
avg.player.setOnFrameHandler(self.__onFrame)
avg.player.play()
player.setOnFrameHandler(self.__onFrame)
player.play()
self.assertEqual(self.cam.framenum, 2)
self.cam = None

Expand Down Expand Up @@ -158,10 +158,10 @@ def isColorParam(paramName):
self.loadEmptyScene()
self.__openCamera()
self.actions = buildParamActionList(testCfg)
avg.player.setOnFrameHandler(self.__onFrame)
player.setOnFrameHandler(self.__onFrame)
self.averages = []
self.camBmps = []
avg.player.play()
player.play()
self.cam = None

def __openCamera(self):
Expand All @@ -170,7 +170,7 @@ def __openCamera(self):
fw800=self.cameraCfg.fw800, framerate=self.fmt.framerate,
capturewidth=self.fmt.size[0], captureheight=self.fmt.size[1],
pixelformat=self.fmt.pixelformat,
parent=avg.player.getRootNode())
parent=player.getRootNode())
self.cam.play()
self.lastCameraFrame = -1
self.assert_(self.cam.isAvailable())
Expand All @@ -181,7 +181,7 @@ def __onFrame(self):
if self.cam.framenum != self.lastCameraFrame:
self.lastCameraFrame += 1
if len(self.actions) == self.lastCameraFrame:
avg.player.stop()
player.stop()
else:
action = self.actions[self.lastCameraFrame]
if action is not None:
Expand Down

0 comments on commit ae994bf

Please sign in to comment.