def start(self, _format): imageFormat = QVideoFrame.imageFormatFromPixelFormat(_format.pixelFormat()) size = _format.frameSize() if (imageFormat != QImage.Format_Invalid and not size.isEmpty()): self.imageFormat = imageFormat self.imageSize = size self.sourceRect = _format.viewport() QAbstractVideoSurface.start(self, _format) self.widget.updateGeometry() self.updateVideoRect() return True else: return False
def start(self, format): return QAbstractVideoSurface.start(self, format)