summaryrefslogtreecommitdiff
path: root/src/v4l2subdev.h
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2011-10-07 18:38:04 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-10-08 13:31:04 +0200
commit4ba96d43a0b96eabf86ca38f07141e7ed3016cef (patch)
tree60e5cd9eff913f7bcc992889e2f35b5910a4ad3a /src/v4l2subdev.h
parent636b48e43db57442fd631a7c5592e34da74f191d (diff)
Move V4L2 subdev format parsing from main.c to subdev.c
This makes format parsing a part of the libv4l2subdev and thus available on all who use the library. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/v4l2subdev.h')
-rw-r--r--src/v4l2subdev.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/v4l2subdev.h b/src/v4l2subdev.h
index 37cae08..5975848 100644
--- a/src/v4l2subdev.h
+++ b/src/v4l2subdev.h
@@ -158,4 +158,41 @@ int v4l2_subdev_get_frame_interval(struct media_entity *entity,
int v4l2_subdev_set_frame_interval(struct media_entity *entity,
struct v4l2_fract *interval);
+/**
+ * @brief Parse a string and apply format, crop and frame interval settings.
+ * @param media - media device.
+ * @param p - input string
+ * @param endp - pointer to string p where parsing ended (return)
+ *
+ * Parse string @a p and apply format, crop and frame interval settings to a
+ * subdev pad specified in @a p. @a endp will be written a pointer where
+ * parsing of @a p ended.
+ *
+ * Format strings are separeted by commas (,).
+ *
+ * @return 0 on success, or a negative error code on failure.
+ */
+int v4l2_subdev_parse_setup_formats(struct media_device *media, const char *p);
+
+/**
+ * @brief Convert media bus pixel code to string.
+ * @param code - input string
+ *
+ * Convert media bus pixel code @a code to a human-readable string.
+ *
+ * @return A pointer to a string on success, NULL on failure.
+ */
+const char *v4l2_subdev_pixelcode_to_string(enum v4l2_mbus_pixelcode code);
+
+/**
+ * @brief Parse string to media bus pixel code.
+ * @param string - input string
+ * @param lenght - length of the string
+ *
+ * Parse human readable string @a string to an media bus pixel code.
+ *
+ * @return media bus pixelcode on success, -1 on failure.
+ */
+enum v4l2_mbus_pixelcode v4l2_subdev_string_to_pixelcode(const char *string,
+ unsigned int length);
#endif