def setDevice(self, device):
print(self.pre, "<STR_LIT>", device)<EOL>if (not device and not self.device): <EOL><INDENT>return<EOL><DEDENT>if (self.device):<EOL><INDENT>if self.device == device:<EOL><INDENT>print(self.pre, "<STR_LIT>")<EOL>return<EOL><DEDENT><DEDENT>if self.filterchain: <EOL><INDENT>self.clearDevice()<EOL><DEDENT>self.device = device<EOL>self.video.setDevice(self.device) <EOL>self.filterchain = self.filterchain_group.get(_id = self.device._id)<EOL>if self.filterchain:<EOL><INDENT>self.viewport.setXScreenNum(self.n_xscreen)<EOL>self.viewport.setWindowId  (int(self.video.winId()))<EOL>self.filterchain.addViewPort(self.viewport)<EOL><DEDENT>
Sets the video stream

        :param device:      A rather generic device class.  In this case DataModel.RTSPCameraDevice.