summaryrefslogtreecommitdiff
path: root/src/cam
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-07-14 20:14:26 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-07-15 13:43:47 +0200
commite9b6b362820338d0546563444e7b1767f5c7044c (patch)
tree28b91dc512e2bc0deac28db55d8d9b646e3dbcaf /src/cam
parenta5877e03072c9578cd97a84f4db1106f24a588a9 (diff)
cam: sdl: Use uint32_t in place of SDL_PixelFormatEnum
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 <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Diffstat (limited to 'src/cam')
-rw-r--r--src/cam/sdl_texture.cpp2
-rw-r--r--src/cam/sdl_texture.h5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/cam/sdl_texture.cpp b/src/cam/sdl_texture.cpp
index 2ca2add2..02a8ff28 100644
--- a/src/cam/sdl_texture.cpp
+++ b/src/cam/sdl_texture.cpp
@@ -9,7 +9,7 @@
#include <iostream>
-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 90974798..1d8b0928 100644
--- a/src/cam/sdl_texture.h
+++ b/src/cam/sdl_texture.h
@@ -14,8 +14,7 @@
class SDLTexture
{
public:
- SDLTexture(const SDL_Rect &rect, SDL_PixelFormatEnum pixelFormat,
- const int pitch);
+ SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int pitch);
virtual ~SDLTexture();
int create(SDL_Renderer *renderer);
virtual void update(const libcamera::Span<uint8_t> &data) = 0;
@@ -24,6 +23,6 @@ public:
protected:
SDL_Texture *ptr_;
const SDL_Rect rect_;
- const SDL_PixelFormatEnum pixelFormat_;
+ const uint32_t pixelFormat_;
const int pitch_;
};