summaryrefslogtreecommitdiff
path: root/src/mediactl.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-31 15:28:22 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-03-10 19:53:58 +0100
commit00b872075dc1232ceeadb2a732b6926c285ac7fb (patch)
treeab57fbfa58efa05aa3417283d2f28a7d56c21c68 /src/mediactl.h
parentbc72e1332cfc81e166c83c90ad63b4b648f19867 (diff)
Make the media_device structure private
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Diffstat (limited to 'src/mediactl.h')
-rw-r--r--src/mediactl.h62
1 files changed, 48 insertions, 14 deletions
diff --git a/src/mediactl.h b/src/mediactl.h
index 34e7487..efa59d6 100644
--- a/src/mediactl.h
+++ b/src/mediactl.h
@@ -52,20 +52,7 @@ struct media_entity {
__u32 padding[6];
};
-struct media_device {
- int fd;
- int refcount;
- char *devnode;
- struct media_device_info info;
- struct media_entity *entities;
- unsigned int entities_count;
- void (*debug_handler)(void *, ...);
- void *debug_priv;
- __u32 padding[6];
-};
-
-#define media_dbg(media, ...) \
- (media)->debug_handler((media)->debug_priv, __VA_ARGS__)
+struct media_device;
/**
* @brief Create a new media device.
@@ -184,6 +171,53 @@ struct media_entity *media_get_entity_by_id(struct media_device *media,
__u32 id);
/**
+ * @brief Get the number of entities
+ * @param media - media device.
+ *
+ * This function returns the total number of entities in the media device. If
+ * entities haven't been enumerated yet it will return 0.
+ *
+ * @return The number of entities in the media device
+ */
+unsigned int media_get_entities_count(struct media_device *media);
+
+/**
+ * @brief Get the entities
+ * @param media - media device.
+ *
+ * This function returns a pointer to the array of entities for the media
+ * device. If entities haven't been enumerated yet it will return NULL.
+ *
+ * The array of entities is owned by the media device object and will be freed
+ * when the media object is destroyed.
+ *
+ * @return A pointer to an array of entities
+ */
+struct media_entity *media_get_entities(struct media_device *media);
+
+/**
+ * @brief Get the media device information
+ * @param media - media device.
+ *
+ * The information structure is owned by the media device object and will be freed
+ * when the media object is destroyed.
+ *
+ * @return A pointer to the media device information
+ */
+const struct media_device_info *media_get_info(struct media_device *media);
+
+/**
+ * @brief Get the media device node name
+ * @param media - media device.
+ *
+ * The device node name string is owned by the media device object and will be
+ * freed when the media object is destroyed.
+ *
+ * @return A pointer to the media device node name
+ */
+const char *media_get_devnode(struct media_device *media);
+
+/**
* @brief Configure a link.
* @param media - media device.
* @param source - source pad at the link origin.