From f6d6181d3c91efa526b5027319331db9ac75f65b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 20 Jul 2022 14:47:33 +0300 Subject: cam: sdl_sink: Pass a Span to SDLTexture::update() The SDLTexture::update() function isn't meant to modify the data it receives. Make the Span type const to ensure this at compile time. While at it, pass the Span by value instead of reference, as a Span is only a pointer and size, which will fit in registers and will avoid pointer dereferences in the callee. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/cam/sdl_texture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cam/sdl_texture.h') diff --git a/src/cam/sdl_texture.h b/src/cam/sdl_texture.h index 1d8b0928..f523fa5e 100644 --- a/src/cam/sdl_texture.h +++ b/src/cam/sdl_texture.h @@ -17,7 +17,7 @@ public: SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int pitch); virtual ~SDLTexture(); int create(SDL_Renderer *renderer); - virtual void update(const libcamera::Span &data) = 0; + virtual void update(libcamera::Span data) = 0; SDL_Texture *get() const { return ptr_; } protected: -- cgit v1.2.1