I'm working on adding multiplanar support to v4l2-ctl, but I have a few 
questions.

First of all, when I call QUERYBUF I set the length field of v4l2_buffer to the
number of elements in my v4l2_plane array.

When QUERYBUF returns, shouldn't the length field be updated to the actual 
number
of planes? Right now it remains unchanged which was somewhat surprising to me.

Since the length isn't updated, can you walk over the planes and detect which 
are
valid and which aren't? The documentation is very vague.

Is anyone relying on the current behavior or could it be changed? It would 
actually
make __fill_v4l2_buffer() more efficient since currently it is copying as many
v4l2_planes as possible, when it only needs to copy num_planes.

The second question is that it seems that for multiplanar support you must setup
the pointer to the v4l2_plane array, otherwise __verify_planes_array() returns
an error. What is scary is that __fill_v4l2_buffer() calls 
__verify_planes_array(),
but often the error code of __fill_v4l2_buffer() is not checked. So if DQBUF
is called without a proper pointer, then it seems to work, but in reality struct
v4l2_buffer isn't filled in.

__verify_planes_array() should be called before __fill_v4l2_buffer() is called,
rather than inside that function.

Comments?

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

Reply via email to