[libcamera-devel] libcamera: Add pipeline manager file hierarchy

Message ID 1544634282-19854-1-git-send-email-jacopo@jmondi.org
State Rejected
Headers show
Series
  • [libcamera-devel] libcamera: Add pipeline manager file hierarchy
Related show

Commit Message

Jacopo Mondi Dec. 12, 2018, 5:04 p.m. UTC
Add a pure virtual base class to define the PipelineManager interface
and an empty IPU3 implementation of the hierarchy.

This commit mostly validates the file hierarchy, build system and
doxygen documentation.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

---
Patch based on current master + Laurent's Doxygen series + mine std=c++11 patch

The resulting file hierarchy in the 'src' dir is the following one:

$ tree src/
src/
├── libcamera
│   ├── hw
│   │   ├── ipu3
│   │   │   ├── ipu3_pipeline_manager.cpp
│   │   │   └── meson.build
│   │   └── meson.build
│   ├── include
│   │   ├── hw
│   │   │   └── ipu3
│   │   │       └── ipu3_pipeline_manager.h
│   │   ├── log.h
│   │   ├── pipeline_manager.h
│   │   └── utils.h
│   ├── log.cpp
│   ├── main.cpp
│   └── meson.build
└── meson.build

6 directories, 11 files
---
 src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp    | 36 ++++++++++++++++++++++
 src/libcamera/hw/ipu3/meson.build                  |  3 ++
 src/libcamera/hw/meson.build                       |  1 +
 .../include/hw/ipu3/ipu3_pipeline_manager.h        | 22 +++++++++++++
 src/libcamera/include/pipeline_manager.h           | 36 ++++++++++++++++++++++
 src/libcamera/main.cpp                             |  7 +++++
 src/libcamera/meson.build                          |  2 ++
 7 files changed, 107 insertions(+)
 create mode 100644 src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp
 create mode 100644 src/libcamera/hw/ipu3/meson.build
 create mode 100644 src/libcamera/hw/meson.build
 create mode 100644 src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h
 create mode 100644 src/libcamera/include/pipeline_manager.h

--
2.7.4

Patch

diff --git a/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp b/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp
new file mode 100644
index 0000000..4593fb3
--- /dev/null
+++ b/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp
@@ -0,0 +1,36 @@ 
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2018, Google Inc.
+ *
+ * ipu3_pipeline_manager.cpp - Intel IPU3 pipeline manager
+ */
+
+#include "hw/ipu3/ipu3_pipeline_manager.h"
+
+/**
+ * \file ipu3_pipeline_manager.h
+ * \brief Intel IPU3 pipeline manager
+ */
+
+namespace libcamera {
+
+/**
+ * \class IPU3PipelineManager
+ * \brief Intel IPU3 pipeline manager
+ */
+
+/**
+ * \fn int IPU3PipelineManager::init()
+ * \brief Initialize the IPU3 pipeline manager
+ *
+ * The Intel IPU3 ISP exposes two media controllers, one for the
+ * cio2 interface, and one for the imgU unit.
+ *
+ * Open and enumerate entities from both the media graphs.
+ */
+int IPU3PipelineManager::init()
+{
+	return 0;
+}
+
+} /* namespace libcamera */
diff --git a/src/libcamera/hw/ipu3/meson.build b/src/libcamera/hw/ipu3/meson.build
new file mode 100644
index 0000000..e5a74a9
--- /dev/null
+++ b/src/libcamera/hw/ipu3/meson.build
@@ -0,0 +1,3 @@ 
+libcamera_sources += files([
+    'ipu3_pipeline_manager.cpp',
+])
diff --git a/src/libcamera/hw/meson.build b/src/libcamera/hw/meson.build
new file mode 100644
index 0000000..f434c79
--- /dev/null
+++ b/src/libcamera/hw/meson.build
@@ -0,0 +1 @@ 
+subdir('ipu3')
diff --git a/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h b/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h
new file mode 100644
index 0000000..74d0a11
--- /dev/null
+++ b/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h
@@ -0,0 +1,22 @@ 
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2018, Google Inc.
+ *
+ * ipu3_pipeline_manager.h - Intel IPU3 pipeline manager
+ */
+#ifndef __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__
+#define __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__
+
+#include "pipeline_manager.h"
+
+namespace libcamera {
+
+class IPU3PipelineManager : public PipelineManager
+{
+public:
+	~IPU3PipelineManager() { }
+	int init(void);
+};
+
+} /* namespace libcamera */
+#endif /* __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__ */
diff --git a/src/libcamera/include/pipeline_manager.h b/src/libcamera/include/pipeline_manager.h
new file mode 100644
index 0000000..1722d77
--- /dev/null
+++ b/src/libcamera/include/pipeline_manager.h
@@ -0,0 +1,36 @@ 
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2018, Google Inc.
+ *
+ * pipeline_manager.h - Media pipeline managers interface definition
+ */
+#ifndef __LIBCAMERA_PIPELINE_MANAGER_H__
+#define __LIBCAMERA_PIPELINE_MANAGER_H__
+
+/**
+ * \file pipeline_manager.h
+ */
+
+namespace libcamera {
+
+/**
+ * \class PipelineManager
+ * \brief Pure virtual pipeline manager base class
+ *
+ * The PipelineManager abstract class defines the pipeline manager
+ * interface that HW-specific implementations have to realize.
+ */
+class PipelineManager
+{
+public:
+	virtual ~PipelineManager() { };
+
+	/**
+	 * \fn int PipelineManager::init()
+	 * \brief Initialize the pipeline manager
+	 */
+	virtual int init(void) = 0;
+};
+
+} /* namespace libcamera */
+#endif /* __LIBCAMERA_PIPELINE_MANAGER_H__ */
diff --git a/src/libcamera/main.cpp b/src/libcamera/main.cpp
index 7ed37df..ef327b0 100644
--- a/src/libcamera/main.cpp
+++ b/src/libcamera/main.cpp
@@ -8,11 +8,18 @@ 
 #include <libcamera/libcamera.h>

 #include "log.h"
+#include "pipeline_manager.h"
+#include "hw/ipu3/ipu3_pipeline_manager.h"

 namespace libcamera {

 void libcamera::init_lib(void)
 {
+	PipelineManager *pipeline = new IPU3PipelineManager;
+	int ret = pipeline->init();
+	if (ret)
+		LOG(Error) << "Failed to initialize pipeline manager: " << ret;
+
 	LOG(Info) << "Lib Camera Init";
 }

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 0c44b5a..10a71a6 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -13,6 +13,8 @@  includes = [
     include_directories('include'),
 ]

+subdir('hw')
+
 libcamera = shared_library('camera',
                            libcamera_sources,
                            install : true,