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>
This commit is contained in:
parent
2ca2d65870
commit
a40023e6cc
16 changed files with 69 additions and 173 deletions
|
@ -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_; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue