History

media: videodev2.h: Add request_fd field to v4l2_buffer

When queuing buffers allow for passing the request that should be associated with this buffer. If V4L2_BUF_FLAG_REQUEST_FD is set, then request_fd is used as the file descriptor. If a buffer is stored in a request, but not yet queued to the driver, then V4L2_BUF_FLAG_IN_REQUEST is set.

Hans Verkuil committed 8 years ago

Commit 62fed261 parent 55028695 files · +19 −8Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/videodev2.h+9−1
@@ -917,6 +917,7 @@ struct v4l2_plane { · 916 unmodified lines
917917 * @length: size in bytes of the buffer (NOT its payload) for single-plane
918918 * buffers (when type != *_MPLANE); number of elements in the
919919 * planes array for multi-plane buffers
920+ * @request_fd: fd of the request that this buffer should use
920921 *
921922 * Contains data exchanged by application and driver using one of the Streaming
922923 * I/O methods.
@@ -941,7 +942,10 @@ struct v4l2_buffer { · 18 unmodified lines
941942 } m;
942943 __u32 length;
943944 __u32 reserved2;
944− __u32 reserved;
945+ union {
946+ __s32 request_fd;
947+ __u32 reserved;
948+ };
945949 };
946950
947951 /* Flags for 'flags' field */
@@ -959,6 +963,8 @@ struct v4l2_buffer { · 11 unmodified lines
959963 #define V4L2_BUF_FLAG_BFRAME 0x00000020
960964 /* Buffer is ready, but the data contained within is corrupted. */
961965 #define V4L2_BUF_FLAG_ERROR 0x00000040
966+/* Buffer is added to an unqueued request */
967+#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080
962968 /* timecode field is valid */
963969 #define V4L2_BUF_FLAG_TIMECODE 0x00000100
964970 /* Buffer is prepared for queuing */
@@ -977,6 +983,8 @@ struct v4l2_buffer { · 12 unmodified lines
977983 #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
978984 /* mem2mem encoder/decoder */
979985 #define V4L2_BUF_FLAG_LAST 0x00100000
986+/* request_fd is valid */
987+#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000
980988
981989 /**
982990 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor