libcamera: Add link handling functions
Add a function to the MediaLink class to set the state of a link to enabled or disabled. The function makes use of an internal MediaDevice method, which is defined private and only accessible by the MediaLink setEnabled() function itself. Also add to MediaDevice a function to reset all links registered in the media graph. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -45,6 +45,7 @@ public:
|
||||
MediaLink *link(const MediaEntity *source, unsigned int sourceIdx,
|
||||
const MediaEntity *sink, unsigned int sinkIdx);
|
||||
MediaLink *link(const MediaPad *source, const MediaPad *sink);
|
||||
int disableLinks();
|
||||
|
||||
private:
|
||||
std::string driver_;
|
||||
@@ -65,6 +66,9 @@ private:
|
||||
bool populateEntities(const struct media_v2_topology &topology);
|
||||
bool populatePads(const struct media_v2_topology &topology);
|
||||
bool populateLinks(const struct media_v2_topology &topology);
|
||||
|
||||
friend int MediaLink::setEnabled(bool enable);
|
||||
int setupLink(const MediaLink *link, unsigned int flags);
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
MediaPad *source() const { return source_; }
|
||||
MediaPad *sink() const { return sink_; }
|
||||
unsigned int flags() const { return flags_; }
|
||||
int setEnabled(bool enable);
|
||||
|
||||
private:
|
||||
friend class MediaDevice;
|
||||
|
||||
Reference in New Issue
Block a user