def createContext(self): """Creates a LiveConnectionContext and registers it to LiveThread """ # define stream source, how the stream is passed on, etc. # USBCameraConnectionContext """ std::string device; // <pyapi> /** A unique stream slot that identifies this stream */ SlotNumber slot; // <pyapi> /** Frames are feeded into this FrameFilter */ FrameFilter* framefilter; // <pyapi> int width; // <pyapi> int height; // <pyapi> /** How to perform frame timestamp correction */ TimeCorrectionType time_correction; // <pyapi> // TODO: format, fps, etc. // <pyapi> """ self.ctx = core.USBCameraConnectionContext() self.ctx.device = self.address self.ctx.width = 1280 self.ctx.height = 720 self.ctx.slot = self.slot self.ctx.framefilter = self.av_in_filter if (self.time_correction is not None): self.ctx.time_correction = self.time_correction self.usbthread.playStream(self.ctx)
def createUSBContext(self): """Context for USBDeviceThread Creates & registers a context to USBDeviceThread and connects it to the main filterchain Required parameters: :: self.slot self.address self.msreconnect self.time_correction """ self.ctx = core.USBCameraConnectionContext() self.ctx.slot = self.slot self.ctx.device = self.address self.ctx.width = 1280 self.ctx.height = 720 if (self.time_correction is not None): self.ctx.time_correction = self.time_correction # connect to the main filterchain self.ctx.framefilter = self.fork_filter_main # start playing print("createUSBContext: play") self.usbdevicethread.playStream(self.ctx)