From 1590e9b2b8c1b8b120a9b0dd6a53f4ef1298b2a0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 8 Aug 2022 18:35:43 +0300 Subject: cam: sdl_texture: Rename 'pitch' to 'stride' The libcamera public API uses 'stride' to refer to the line stride. Rename the SDLTexture::pitch_ member variable for consistency. Signed-off-by: Laurent Pinchart Reviewed-by: Eric Curtin Reviewed-by: Jacopo Mondi --- src/cam/sdl_texture_mjpg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cam/sdl_texture_mjpg.cpp') diff --git a/src/cam/sdl_texture_mjpg.cpp b/src/cam/sdl_texture_mjpg.cpp index 8dd5ee3e..da958e03 100644 --- a/src/cam/sdl_texture_mjpg.cpp +++ b/src/cam/sdl_texture_mjpg.cpp @@ -39,7 +39,7 @@ struct JpegErrorManager : public jpeg_error_mgr { SDLTextureMJPG::SDLTextureMJPG(const SDL_Rect &rect) : SDLTexture(rect, SDL_PIXELFORMAT_RGB24, rect.w * 3), - rgb_(std::make_unique(pitch_ * rect.h)) + rgb_(std::make_unique(stride_ * rect.h)) { } @@ -65,7 +65,7 @@ int SDLTextureMJPG::decompress(Span data) jpeg_start_decompress(&cinfo); for (int i = 0; cinfo.output_scanline < cinfo.output_height; ++i) { - JSAMPROW rowptr = rgb_.get() + i * pitch_; + JSAMPROW rowptr = rgb_.get() + i * stride_; jpeg_read_scanlines(&cinfo, &rowptr, 1); } @@ -79,5 +79,5 @@ int SDLTextureMJPG::decompress(Span data) void SDLTextureMJPG::update(const std::vector> &data) { decompress(data[0]); - SDL_UpdateTexture(ptr_, nullptr, rgb_.get(), pitch_); + SDL_UpdateTexture(ptr_, nullptr, rgb_.get(), stride_); } -- cgit v1.2.1