summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cam/sdl_sink.cpp2
-rw-r--r--src/cam/sdl_texture_yuyv.cpp4
-rw-r--r--src/cam/sdl_texture_yuyv.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/cam/sdl_sink.cpp b/src/cam/sdl_sink.cpp
index 19fdfd6d..a59d0751 100644
--- a/src/cam/sdl_sink.cpp
+++ b/src/cam/sdl_sink.cpp
@@ -68,7 +68,7 @@ int SDLSink::configure(const libcamera::CameraConfiguration &config)
break;
#endif
case libcamera::formats::YUYV:
- texture_ = std::make_unique<SDLTextureYUYV>(rect_);
+ texture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride);
break;
default:
std::cerr << "Unsupported pixel format "
diff --git a/src/cam/sdl_texture_yuyv.cpp b/src/cam/sdl_texture_yuyv.cpp
index 637c0900..cb51fb0e 100644
--- a/src/cam/sdl_texture_yuyv.cpp
+++ b/src/cam/sdl_texture_yuyv.cpp
@@ -9,8 +9,8 @@
using namespace libcamera;
-SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect)
- : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, 4 * ((rect.w + 1) / 2))
+SDLTextureYUYV::SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride)
+ : SDLTexture(rect, SDL_PIXELFORMAT_YUY2, stride)
{
}
diff --git a/src/cam/sdl_texture_yuyv.h b/src/cam/sdl_texture_yuyv.h
index 529a72d6..81e51381 100644
--- a/src/cam/sdl_texture_yuyv.h
+++ b/src/cam/sdl_texture_yuyv.h
@@ -12,6 +12,6 @@
class SDLTextureYUYV : public SDLTexture
{
public:
- SDLTextureYUYV(const SDL_Rect &rect);
+ SDLTextureYUYV(const SDL_Rect &rect, unsigned int stride);
void update(libcamera::Span<const uint8_t> data) override;
};