summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms
ModeNameSize
-rw-r--r--af.cpp13751logplain
-rw-r--r--af.h2001logplain
-rw-r--r--agc.cpp8128logplain
-rw-r--r--agc.h1384logplain
-rw-r--r--algorithm.h357logplain
-rw-r--r--awb.cpp18332logplain
-rw-r--r--awb.h2071logplain
-rw-r--r--blc.cpp2131logplain
-rw-r--r--blc.h523logplain
-rw-r--r--meson.build152logplain
-rw-r--r--tone_mapping.cpp3338logplain
-rw-r--r--tone_mapping.h777logplain
* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C) 2022, Ideas on Board Oy * * SDL Sink */ #include "sdl_sink.h" #include <assert.h> #include <fcntl.h> #include <iomanip> #include <iostream> #include <signal.h> #include <sstream> #include <string.h> #include <unistd.h> #include <libcamera/camera.h> #include <libcamera/formats.h> #include "../common/event_loop.h" #include "../common/image.h" #ifdef HAVE_LIBJPEG #include "sdl_texture_mjpg.h" #endif #include "sdl_texture_yuv.h" using namespace libcamera; using namespace std::chrono_literals; SDLSink::SDLSink() : window_(nullptr), renderer_(nullptr), rect_({}), init_(false) { } SDLSink::~SDLSink() { stop(); } int SDLSink::configure(const libcamera::CameraConfiguration &config) { int ret = FrameSink::configure(config); if (ret < 0) return ret; if (config.size() > 1) { std::cerr << "SDL sink only supports one camera stream at present, streaming first camera stream" << std::endl; } else if (config.empty()) { std::cerr << "Require at least one camera stream to process" << std::endl; return -EINVAL; } const libcamera::StreamConfiguration &cfg = config.at(0); rect_.w = cfg.size.width; rect_.h = cfg.size.height; switch (cfg.pixelFormat) { #ifdef HAVE_LIBJPEG case libcamera::formats::MJPEG: texture_ = std::make_unique<SDLTextureMJPG>(rect_); break; #endif #if SDL_VERSION_ATLEAST(2, 0, 16) case libcamera::formats::NV12: texture_ = std::make_unique<SDLTextureNV12>(rect_, cfg.stride); break; #endif case libcamera::formats::YUYV: texture_ = std::make_unique<SDLTextureYUYV>(rect_, cfg.stride); break; default: std::cerr << "Unsupported pixel format " << cfg.pixelFormat.toString() << std::endl; return -EINVAL; }; return 0; }