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_yuyv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cam/sdl_texture_yuyv.cpp') diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp index cc161b2c..637c0900 100644 --- a/src/cam/sdl_texture_yuyv.cpp +++ b/src/cam/sdl_texture_yuyv.cpp @@ -14,7 +14,7 @@ SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect) { } -void SDLTextureYUYV::update(const Span &data) +void SDLTextureYUYV::update(Span data) { SDL_UpdateTexture(ptr_, &rect_, data.data(), pitch_); } -- cgit v1.2.1