libcamera: v4l2_subdevice: Store media entity
Store the media entity backing the V4L2Subdevice and add a deviceName() method to retrieve the human readable name of the subdevice, which is created using the name of the associated media entity. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -9,9 +9,10 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "media_object.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class MediaEntity;
|
||||
struct Rectangle;
|
||||
|
||||
struct V4L2SubdeviceFormat {
|
||||
@@ -31,7 +32,8 @@ public:
|
||||
bool isOpen() const;
|
||||
void close();
|
||||
|
||||
std::string deviceNode() const { return deviceNode_; }
|
||||
std::string deviceNode() const { return entity_->deviceNode(); }
|
||||
std::string deviceName() const { return entity_->name(); }
|
||||
|
||||
int setCrop(unsigned int pad, Rectangle *rect);
|
||||
int setCompose(unsigned int pad, Rectangle *rect);
|
||||
@@ -43,7 +45,7 @@ private:
|
||||
int setSelection(unsigned int pad, unsigned int target,
|
||||
Rectangle *rect);
|
||||
|
||||
std::string deviceNode_;
|
||||
const MediaEntity *entity_;
|
||||
int fd_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user