summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_compat_manager.h
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-22 18:42:07 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-06-25 23:41:19 +0900
commitedacd07c5e9a5080628e7cc4d057674f7f742ead (patch)
treedc9b1f11d0d0758e4622364f6353b4cda7627ee8 /src/v4l2/v4l2_compat_manager.h
parentd37ec82515fda4ae014d904e6d50cd0ed0ada850 (diff)
v4l2: V4L2CameraProxy: Take V4L2CameraFile as argument for intercepted calls
Prepare for using the V4L2CameraFile as a container for file-specific information in the V4L2 compatibility layer by making it a required argument for all V4L2CameraProxy calls that are directed from V4L2CompatManager, which are intercepted via LD_PRELOAD. Change V4L2CameraFile accordingly. Also change V4L2CompatManager accordingly. Instead of keeping a map of file descriptors to V4L2CameraProxy instances, we keep a map of V4L2CameraFile instances to V4L2CameraProxy instances. When the proxy methods are called, feed the file as a parameter. The dup function is also modified, in that it is removed from V4L2CameraProxy, and is handled completely in V4L2CompatManager, as a map from file descriptors to V4L2CameraFile instances. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/v4l2/v4l2_compat_manager.h')
-rw-r--r--src/v4l2/v4l2_compat_manager.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h
index 3d4e512e..bc548ab2 100644
--- a/src/v4l2/v4l2_compat_manager.h
+++ b/src/v4l2/v4l2_compat_manager.h
@@ -44,7 +44,6 @@ public:
static V4L2CompatManager *instance();
- V4L2CameraProxy *getProxy(int fd);
const FileOperations &fops() const { return fops_; }
int openat(int dirfd, const char *path, int oflag, mode_t mode);
@@ -62,13 +61,14 @@ private:
int start();
int getCameraIndex(int fd);
+ std::shared_ptr<V4L2CameraFile> cameraFile(int fd);
FileOperations fops_;
CameraManager *cm_;
std::vector<std::unique_ptr<V4L2CameraProxy>> proxies_;
- std::map<int, V4L2CameraProxy *> devices_;
+ std::map<int, std::shared_ptr<V4L2CameraFile>> files_;
std::map<void *, V4L2CameraProxy *> mmaps_;
};