summaryrefslogtreecommitdiff
path: root/src/cam/sdl_texture_mjpg.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-08 18:35:43 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-09 21:15:47 +0300
commit1590e9b2b8c1b8b120a9b0dd6a53f4ef1298b2a0 (patch)
tree7e443384dc608d39bb3ef7539803185e8342ad6b /src/cam/sdl_texture_mjpg.cpp
parent768f1138e9111975959057a621a99518ab78981f (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Eric Curtin <ecurtin@redhat.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/cam/sdl_texture_mjpg.cpp')
-rw-r--r--src/cam/sdl_texture_mjpg.cpp6
1 files changed, 3 insertions, 3 deletions
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<unsigned char[]>(pitch_ * rect.h))
+ rgb_(std::make_unique<unsigned char[]>(stride_ * rect.h))
{
}
@@ -65,7 +65,7 @@ int SDLTextureMJPG::decompress(Span<const uint8_t> 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<const uint8_t> data)
void SDLTextureMJPG::update(const std::vector<libcamera::Span<const uint8_t>> &data)
{
decompress(data[0]);
- SDL_UpdateTexture(ptr_, nullptr, rgb_.get(), pitch_);
+ SDL_UpdateTexture(ptr_, nullptr, rgb_.get(), stride_);
}