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:
Jacopo Mondi
2019-01-09 09:16:47 +01:00
parent b65feafe32
commit 4e78147df9
4 changed files with 109 additions and 0 deletions
+4
View File
@@ -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 */
+1
View File
@@ -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;