From patchwork Thu Jul 14 18:24:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16636 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DB778BD1F1 for ; Thu, 14 Jul 2022 18:24:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2F47763312; Thu, 14 Jul 2022 20:24:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657823071; bh=ay+U////fw/0cMy6QuRFCMWRxf9JCJFGnoVl5nASwjc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=kzFlj0xRLxabgLDVvjh9optfPNI0a0iGE/h4SPlx7z+TZZ9IZ/vhGCOLI2GD84YT2 ah388r+b5VT7mzZ9P9lAm6jpED/rpL1Rrl7lqUfXxcjpyEfWTkxDmeZE+OmFTAtiD8 BFWP+inAvJnLvtxP+jM+pUd08TsMkh5ZOtkWAk0P4b8gfCGEJMIAniUDl8TdYQFnJi ZRrBjaEqYhybZqr2uNwfmGCuW9jP3AmaWodYtNanTcGnB4VxjaxOeDQ6PpW0WVbwPs QDacNec8hKZVTIxdncCOJ7aRUbpi1PvAXWKAq6hY74S0emc6AnGJ8ewFvl7aN969ir yNdxuy1cbkEhA== Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 98DCB6330D for ; Thu, 14 Jul 2022 20:24:29 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 638C240004; Thu, 14 Jul 2022 18:24:28 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 14 Jul 2022 20:24:23 +0200 Message-Id: <20220714182423.179764-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] cam: sdl: Use uint32_t in place of SDL_PixelFormatEnum 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The SDL_PixelFormatEnum type has been introduced in libsdl by 1a4c0d4e17e6 ("Fixed bug 4377 - SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function") which is only available after release 2.0.10 of the library. Debian 10 ships libsdl at version 2.0.9 and building cam with sdl support there fails with error: ./src/cam/sdl_texture.h:27:8: error: ‘SDL_PixelFormatEnum’ does not name a type; did you mean ‘SDL_PixelFormat’? Fix that by using the base type uint32_t in place of SDL_PixelFormatEnum. Reported-by: https://buildbot.libcamera.org/#/builders/6/builds/355 Fixes: 11554a259f4e ("cam: sdl_sink: Add SDL sink with initial YUYV support") Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Eric Curtin --- src/cam/sdl_texture.cpp | 2 +- src/cam/sdl_texture.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.36.1 diff --git a/src/cam/sdl_texture.cpp b/src/cam/sdl_texture.cpp index 2ca2add2f00c..02a8ff28b669 100644 --- a/src/cam/sdl_texture.cpp +++ b/src/cam/sdl_texture.cpp @@ -9,7 +9,7 @@ #include -SDLTexture::SDLTexture(const SDL_Rect &rect, SDL_PixelFormatEnum pixelFormat, +SDLTexture::SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int pitch) : ptr_(nullptr), rect_(rect), pixelFormat_(pixelFormat), pitch_(pitch) { diff --git a/src/cam/sdl_texture.h b/src/cam/sdl_texture.h index 9097479846f7..2275b4e605d9 100644 --- a/src/cam/sdl_texture.h +++ b/src/cam/sdl_texture.h @@ -14,7 +14,7 @@ class SDLTexture { public: - SDLTexture(const SDL_Rect &rect, SDL_PixelFormatEnum pixelFormat, + SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int pitch); virtual ~SDLTexture(); int create(SDL_Renderer *renderer); @@ -24,6 +24,6 @@ public: protected: SDL_Texture *ptr_; const SDL_Rect rect_; - const SDL_PixelFormatEnum pixelFormat_; + const uint32_t pixelFormat_; const int pitch_; };