mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-26 10:05:08 +03:00
libcamera: ipu3: Set pipe_mode based on stream configuration
Set the ImgU pipe_mode control based on the active stream configuration. Use 'Video' pipe mode unless the viewfinder stream is not active. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
3ef81b7f7f
commit
cb21bb3311
1 changed files with 18 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include "media_device.h"
|
#include "media_device.h"
|
||||||
#include "pipeline_handler.h"
|
#include "pipeline_handler.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "v4l2_controls.h"
|
||||||
#include "v4l2_subdevice.h"
|
#include "v4l2_subdevice.h"
|
||||||
#include "v4l2_videodevice.h"
|
#include "v4l2_videodevice.h"
|
||||||
|
|
||||||
|
@ -194,6 +195,12 @@ private:
|
||||||
class PipelineHandlerIPU3 : public PipelineHandler
|
class PipelineHandlerIPU3 : public PipelineHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static constexpr unsigned int V4L2_CID_IPU3_PIPE_MODE = 0x009819c1;
|
||||||
|
enum IPU3PipeModes {
|
||||||
|
IPU3PipeModeVideo = 0,
|
||||||
|
IPU3PipeModeStillCapture = 1,
|
||||||
|
};
|
||||||
|
|
||||||
PipelineHandlerIPU3(CameraManager *manager);
|
PipelineHandlerIPU3(CameraManager *manager);
|
||||||
|
|
||||||
CameraConfiguration *generateConfiguration(Camera *camera,
|
CameraConfiguration *generateConfiguration(Camera *camera,
|
||||||
|
@ -559,6 +566,17 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* Apply the "pipe_mode" control to the ImgU subdevice. */
|
||||||
|
V4L2ControlList ctrls;
|
||||||
|
ctrls.add(V4L2_CID_IPU3_PIPE_MODE, vfStream->active_ ?
|
||||||
|
IPU3PipeModeVideo :
|
||||||
|
IPU3PipeModeStillCapture);
|
||||||
|
ret = imgu->imgu_->setControls(&ctrls);
|
||||||
|
if (ret) {
|
||||||
|
LOG(IPU3, Error) << "Unable to set pipe_mode control";
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue