summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_camera_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4l2/v4l2_camera_file.cpp')
-rw-r--r--src/v4l2/v4l2_camera_file.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/v4l2/v4l2_camera_file.cpp b/src/v4l2/v4l2_camera_file.cpp
new file mode 100644
index 00000000..d3232ab2
--- /dev/null
+++ b/src/v4l2/v4l2_camera_file.cpp
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * v4l2_camera_file.h - V4L2 compatibility camera file information
+ */
+
+#include "v4l2_camera_file.h"
+
+#include <linux/videodev2.h>
+
+#include "v4l2_camera_proxy.h"
+
+using namespace libcamera;
+
+V4L2CameraFile::V4L2CameraFile(int efd, bool nonBlocking, V4L2CameraProxy *proxy)
+ : proxy_(proxy), nonBlocking_(nonBlocking), efd_(efd),
+ priority_(V4L2_PRIORITY_DEFAULT)
+{
+ proxy_->open(nonBlocking);
+}
+
+V4L2CameraFile::~V4L2CameraFile()
+{
+ proxy_->close();
+}