[v2,2/4] apps: cam: sdl_texture: Drop `&rect_` from `SDL_Update{NV, }Texture()` call
diff mbox series

Message ID 20250425104703.805170-3-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • apps: cam: sdl_sink: Support more RGB and YUV formats
Related show

Commit Message

Barnabás Pőcze April 25, 2025, 10:47 a.m. UTC
If the entire texture is to be updated, there is no need to specify
the target area explicitly.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/apps/cam/sdl_texture_yuv.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kieran Bingham April 25, 2025, 12:02 p.m. UTC | #1
Quoting Barnabás Pőcze (2025-04-25 11:47:01)
> If the entire texture is to be updated, there is no need to specify
> the target area explicitly.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/apps/cam/sdl_texture_yuv.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp
> index 80a5ec05d..7e2ce3f49 100644
> --- a/src/apps/cam/sdl_texture_yuv.cpp
> +++ b/src/apps/cam/sdl_texture_yuv.cpp
> @@ -17,7 +17,7 @@ SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride)
>  
>  void SDLTextureNV12::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
>  {
> -       SDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), stride_,
> +       SDL_UpdateNVTexture(ptr_, nullptr, data[0].data(), stride_,
>                             data[1].data(), stride_);
>  }
>  #endif
> @@ -29,5 +29,5 @@ SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)
>  
>  void SDLTextureYUYV::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
>  {
> -       SDL_UpdateTexture(ptr_, &rect_, data[0].data(), stride_);
> +       SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_);
>  }
> -- 
> 2.49.0
>
Laurent Pinchart April 25, 2025, 12:35 p.m. UTC | #2
Hi Barnabás,

Thank you for the patch.

On Fri, Apr 25, 2025 at 12:47:01PM +0200, Barnabás Pőcze wrote:
> If the entire texture is to be updated, there is no need to specify
> the target area explicitly.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/apps/cam/sdl_texture_yuv.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp
> index 80a5ec05d..7e2ce3f49 100644
> --- a/src/apps/cam/sdl_texture_yuv.cpp
> +++ b/src/apps/cam/sdl_texture_yuv.cpp
> @@ -17,7 +17,7 @@ SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride)
>  
>  void SDLTextureNV12::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
>  {
> -	SDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), stride_,
> +	SDL_UpdateNVTexture(ptr_, nullptr, data[0].data(), stride_,
>  			    data[1].data(), stride_);
>  }
>  #endif
> @@ -29,5 +29,5 @@ SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)
>  
>  void SDLTextureYUYV::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
>  {
> -	SDL_UpdateTexture(ptr_, &rect_, data[0].data(), stride_);
> +	SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_);
>  }

Patch
diff mbox series

diff --git a/src/apps/cam/sdl_texture_yuv.cpp b/src/apps/cam/sdl_texture_yuv.cpp
index 80a5ec05d..7e2ce3f49 100644
--- a/src/apps/cam/sdl_texture_yuv.cpp
+++ b/src/apps/cam/sdl_texture_yuv.cpp
@@ -17,7 +17,7 @@  SDLTextureNV12::SDLTextureNV12(const SDL_Rect &rect, unsigned int stride)
 
 void SDLTextureNV12::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
 {
-	SDL_UpdateNVTexture(ptr_, &rect_, data[0].data(), stride_,
+	SDL_UpdateNVTexture(ptr_, nullptr, data[0].data(), stride_,
 			    data[1].data(), stride_);
 }
 #endif
@@ -29,5 +29,5 @@  SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)
 
 void SDLTextureYUYV::update(libcamera::Span<const libcamera::Span<const uint8_t>> data)
 {
-	SDL_UpdateTexture(ptr_, &rect_, data[0].data(), stride_);
+	SDL_UpdateTexture(ptr_, nullptr, data[0].data(), stride_);
 }