[yavta PATCH v3 04/11] Make struct for buffer type and name mapping usable elsewhere

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxx>
---
 yavta.c |   28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/yavta.c b/yavta.c
index 02a7403..01f61d2 100644
--- a/yavta.c
+++ b/yavta.c
@@ -97,24 +97,24 @@ static bool video_is_output(struct device *dev)
 	       dev->type == V4L2_BUF_TYPE_VIDEO_OUTPUT;
 }
 
+static struct {
+ 	enum v4l2_buf_type type;
+	const char *name;
+} buf_types[] = {
+	{ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "Video capture mplanes", },
+	{ V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "Video output", },
+	{ V4L2_BUF_TYPE_VIDEO_CAPTURE, "Video capture" },
+	{ V4L2_BUF_TYPE_VIDEO_OUTPUT, "Video output mplanes" },
+	{ V4L2_BUF_TYPE_VIDEO_OVERLAY, "Video overlay" },
+};
+
 static const char *v4l2_buf_type_name(enum v4l2_buf_type type)
 {
-	static struct {
-		enum v4l2_buf_type type;
-		const char *name;
-	} names[] = {
-		{ V4L2_BUF_TYPE_VIDEO_CAPTURE, "Video capture" },
-		{ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "Video capture mplanes" },
-		{ V4L2_BUF_TYPE_VIDEO_OUTPUT, "Video output" },
-		{ V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "Video output mplanes" },
-		{ V4L2_BUF_TYPE_VIDEO_OVERLAY, "Video overlay" },
-	};
-
 	unsigned int i;
 
-	for (i = 0; i < ARRAY_SIZE(names); ++i) {
-		if (names[i].type == type)
-			return names[i].name;
+	for (i = 0; i < ARRAY_SIZE(buf_types); ++i) {
+		if (buf_types[i].type == type)
+			return buf_types[i].name;
 	}
 
 	if (type & V4L2_BUF_TYPE_PRIVATE)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux