v4l2: camera: Merge getStreamConfig() with open()

The V4L2CameraProxy always calls V4L2Camera::getStreamConfig() right
after V4L2Camera::open(), and never afterwards. Simplify the code by
returning the initial configuration from V4L2Camera::open() and removing
V4L2Camera::getStreamConfig().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2020-01-05 04:35:25 +02:00
parent 852b9d0a76
commit 3bd1985545
3 changed files with 5 additions and 10 deletions

View file

@ -63,13 +63,12 @@ int V4L2CameraProxy::open(V4L2CameraFile *file)
* with count = 0.
*/
int ret = vcam_->open();
int ret = vcam_->open(&streamConfig_);
if (ret < 0) {
refcount_--;
return ret;
}
vcam_->getStreamConfig(&streamConfig_);
setFmtFromConfig(streamConfig_);
files_.insert(file);