[PATCH/RFC 1/3] v4l: Add new g_framesamples subdev video operation

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

 



g_framesamples() callback can be used for negotiating the maximum amount of
compressed data transmitted over the video bus. It allows the host drivers
to query the amount of the frame data which corresponds to required memory
buffer that needs to be allocated, before the actual transmission begins.

This is helpful in any case where the frame data size is not obvious from
frame width, height and media bus pixel format.

To obtain the final memory buffer size the host drivers should multiply
the value returned in 'count' by the number of bytes per media bus sample.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
 include/media/v4l2-subdev.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 257da1a..e46779d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -273,6 +273,10 @@ struct v4l2_subdev_audio_ops {
    s_mbus_config: set a certain mediabus configuration. This operation is added
 	for compatibility with soc-camera drivers and should not be used by new
 	software.
+
+   g_mbus_framesamples: get maximum number of media bus frame samples. This is
+	used to negotiate maximum memory buffer size for a compressed image
+	frame of given pixel format.
  */
 struct v4l2_subdev_video_ops {
 	int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
@@ -320,6 +324,8 @@ struct v4l2_subdev_video_ops {
 			     struct v4l2_mbus_config *cfg);
 	int (*s_mbus_config)(struct v4l2_subdev *sd,
 			     const struct v4l2_mbus_config *cfg);
+	int (*g_mbus_framesamples)(struct v4l2_subdev *sd,
+			struct v4l2_mbus_framefmt *fmt, unsigned int *count);
 };
 
 /*
-- 
1.7.7.1

--
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