diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-06-27 03:32:56 +0200 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-06-28 14:25:46 +0200 |
commit | b80c01843cf0228fc51f2429f47eee186ebdcb3d (patch) | |
tree | 2415d8624ef9dfc96b42b6a0e6e849de4cb3d887 /src/libcamera/pipeline/ipu3/imgu.cpp | |
parent | d275243979ceefea5c347fa532617cc3648f6582 (diff) |
libcamera: ipu3: imgu: Use specific functions to configure each sink
When the IPU3 pipeline only provided streams to applications that came
from the ImgU it made sense to have a generic function to configure all
the different outputs. With the addition of the RAW stream this begins
to be cumbersome to read and make sense of in the PipelineHandlerIPU3
code. Replace the generic function that takes a specific argument for
which sink to configure with a specific function for each sink.
This makes the code easier to follow as it's always clear which of the
ImgU sinks are being configured without knowing the content of a
generically named variable. It also paves the way for future
improvements.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/imgu.cpp')
-rw-r--r-- | src/libcamera/pipeline/ipu3/imgu.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp index 8a0b77a4..cbe31023 100644 --- a/src/libcamera/pipeline/ipu3/imgu.cpp +++ b/src/libcamera/pipeline/ipu3/imgu.cpp @@ -139,18 +139,17 @@ int ImgUDevice::configureInput(const Size &size, } /** - * \brief Configure the ImgU unit \a id video output - * \param[in] output The ImgU output device to configure + * \brief Configure a video device on the ImgU + * \param[in] dev The video device to configure + * \param[in] pad The pad of the ImgU subdevice * \param[in] cfg The requested configuration + * \param[out] outputFormat The format set on the video device * \return 0 on success or a negative error code otherwise */ -int ImgUDevice::configureOutput(ImgUOutput *output, - const StreamConfiguration &cfg, - V4L2DeviceFormat *outputFormat) +int ImgUDevice::configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad, + const StreamConfiguration &cfg, + V4L2DeviceFormat *outputFormat) { - V4L2VideoDevice *dev = output->dev; - unsigned int pad = output->pad; - V4L2SubdeviceFormat imguFormat = {}; imguFormat.mbus_code = MEDIA_BUS_FMT_FIXED; imguFormat.size = cfg.size; @@ -160,7 +159,7 @@ int ImgUDevice::configureOutput(ImgUOutput *output, return ret; /* No need to apply format to the stat node. */ - if (output == &stat_) + if (dev == stat_.dev) return 0; *outputFormat = {}; @@ -172,7 +171,8 @@ int ImgUDevice::configureOutput(ImgUOutput *output, if (ret) return ret; - LOG(IPU3, Debug) << "ImgU " << output->name << " format = " + const char *name = dev == output_.dev ? "output" : "viewfinder"; + LOG(IPU3, Debug) << "ImgU " << name << " format = " << outputFormat->toString(); return 0; |