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_mjpg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cam/sdl_texture_mjpg.h') diff --git a/src/cam/sdl_texture_mjpg.h b/src/cam/sdl_texture_mjpg.h index 328c45a9..5141ed73 100644 --- a/src/cam/sdl_texture_mjpg.h +++ b/src/cam/sdl_texture_mjpg.h @@ -14,10 +14,10 @@ class SDLTextureMJPG : public SDLTexture public: SDLTextureMJPG(const SDL_Rect &rect); - void update(const libcamera::Span &data) override; + void update(libcamera::Span data) override; private: - int decompress(const libcamera::Span &data); + int decompress(libcamera::Span data); std::unique_ptr rgb_; }; -- cgit v1.2.1