summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3/imgu.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-27 03:32:56 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-06-28 14:25:46 +0200
commitb80c01843cf0228fc51f2429f47eee186ebdcb3d (patch)
tree2415d8624ef9dfc96b42b6a0e6e849de4cb3d887 /src/libcamera/pipeline/ipu3/imgu.h
parentd275243979ceefea5c347fa532617cc3648f6582 (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.h')
-rw-r--r--src/libcamera/pipeline/ipu3/imgu.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h
index 31f4d75c..2ad2a65d 100644
--- a/src/libcamera/pipeline/ipu3/imgu.h
+++ b/src/libcamera/pipeline/ipu3/imgu.h
@@ -47,9 +47,29 @@ public:
}
int init(MediaDevice *media, unsigned int index);
+
int configureInput(const Size &size, V4L2DeviceFormat *inputFormat);
- int configureOutput(ImgUOutput *output, const StreamConfiguration &cfg,
- V4L2DeviceFormat *outputFormat);
+
+ int configureOutput(const StreamConfiguration &cfg,
+ V4L2DeviceFormat *outputFormat)
+ {
+ return configureVideoDevice(output_.dev, PAD_OUTPUT, cfg,
+ outputFormat);
+ }
+
+ int configureViewfinder(const StreamConfiguration &cfg,
+ V4L2DeviceFormat *outputFormat)
+ {
+ return configureVideoDevice(viewfinder_.dev, PAD_VF, cfg,
+ outputFormat);
+ }
+
+ int configureStat(const StreamConfiguration &cfg,
+ V4L2DeviceFormat *outputFormat)
+ {
+ return configureVideoDevice(stat_.dev, PAD_STAT, cfg,
+ outputFormat);
+ }
int allocateBuffers(unsigned int bufferCount);
void freeBuffers();
@@ -76,6 +96,10 @@ private:
const std::string &sink, unsigned int sinkPad,
bool enable);
+ int configureVideoDevice(V4L2VideoDevice *dev, unsigned int pad,
+ const StreamConfiguration &cfg,
+ V4L2DeviceFormat *outputFormat);
+
std::string name_;
MediaDevice *media_;
};