From patchwork Thu Apr 16 22:05:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3473 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6096660406 for ; Fri, 17 Apr 2020 00:06:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="J18iS6zc"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DD6EA97D for ; Fri, 17 Apr 2020 00:06:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1587074775; bh=AVylLCuoraGMDNfK7pn2NjYfq2vHXUQ5p25WCP4sqSU=; h=From:To:Subject:Date:From; b=J18iS6zc07ycPmbj5OvA8ZeLa77SMLhK7vLrDNxMkdCSq/ayU1GVGDtClFpFK0FHx GSQSixeJZ5Aus89OxezkjvH981oNwqg8vK5vggT3LTtE3jCjhDNXNfJPdIx3mV8LO5 SoQGlsUpOTsR6oUhtjBl6VvoNTnNG+jQvZDPFXck= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 17 Apr 2020 01:05:58 +0300 Message-Id: <20200416220558.32136-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Return correct format for metadata X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 22:06:15 -0000 When setting format on a metadata video device, the returned format isn't updated with the actual set format due to a typo. Fix it. Fixes: 629e9301c518 ("libcamera: v4l2_device: Add META support in g/s_fmt") Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reported-by: Coverity DefectId=279098 Reported-by: Coverity CID=279098 Reported-by: Coverity Scan CID=279098 Reported-by: Coverity CID=279098 Reported-by: Coverity ID=279098 --- src/libcamera/v4l2_videodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 439a9c90dbf7..a959cfe65c43 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -848,7 +848,7 @@ int V4L2VideoDevice::setFormatMeta(V4L2DeviceFormat *format) */ format->size.width = 0; format->size.height = 0; - format->fourcc = format->fourcc; + format->fourcc = V4L2PixelFormat(pix->dataformat); format->planesCount = 1; format->planes[0].bpl = pix->buffersize; format->planes[0].size = pix->buffersize;