summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-04-28 16:42:12 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-05-23 00:27:13 +0300
commita40023e6cc005dfc57cc535167ee44761f3ed9f6 (patch)
tree7b666b223754855a7ea8a4e83e3df0bb9752bdfe /include
parent2ca2d658700c57c3d734d72b2148436907152257 (diff)
libcamera: Use stream roles directly instead of StreamUsage
In order to prepare for an API overhall of the camera configuration generation, remove the StreamUsage class and replace its uses by stream roles. The size hints can't be specified anymore, and will be replaced with an API on the StreamConfiguration to negotiate configuration parameters with cameras. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/camera.h8
-rw-r--r--include/libcamera/stream.h44
2 files changed, 9 insertions, 43 deletions
diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index 306739b7..42ba5201 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -14,16 +14,13 @@
#include <libcamera/request.h>
#include <libcamera/signal.h>
+#include <libcamera/stream.h>
namespace libcamera {
class Buffer;
class PipelineHandler;
class Request;
-class Stream;
-class StreamUsage;
-
-struct StreamConfiguration;
class CameraConfiguration
{
@@ -74,8 +71,7 @@ public:
int release();
const std::set<Stream *> &streams() const;
- CameraConfiguration
- generateConfiguration(const std::vector<StreamUsage> &usage);
+ CameraConfiguration generateConfiguration(const StreamRoles &roles);
int configure(const CameraConfiguration &config);
int allocateBuffers();
diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index 0c986310..59bdf217 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -8,6 +8,7 @@
#define __LIBCAMERA_STREAM_H__
#include <string>
+#include <vector>
#include <libcamera/buffer.h>
#include <libcamera/geometry.h>
@@ -25,48 +26,17 @@ struct StreamConfiguration {
std::string toString() const;
};
-class StreamUsage
-{
-public:
- enum Role {
- StillCapture,
- VideoRecording,
- Viewfinder,
- };
-
- Role role() const { return role_; }
- const Size &size() const { return size_; }
-
-protected:
- explicit StreamUsage(Role role);
- StreamUsage(Role role, const Size &size);
-
-private:
- Role role_;
- Size size_;
+enum StreamRole {
+ StillCapture,
+ VideoRecording,
+ Viewfinder,
};
+using StreamRoles = std::vector<StreamRole>;
+
class Stream
{
public:
- class StillCapture : public StreamUsage
- {
- public:
- StillCapture();
- };
-
- class VideoRecording : public StreamUsage
- {
- public:
- VideoRecording();
- };
-
- class Viewfinder : public StreamUsage
- {
- public:
- Viewfinder(int width, int height);
- };
-
Stream();
BufferPool &bufferPool() { return bufferPool_; }
const StreamConfiguration &configuration() const { return configuration_; }