-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V4L2 Codec/camera fixes #4765
V4L2 Codec/camera fixes #4765
Conversation
53fd070
to
20e3d07
Compare
Hold fire - messed up in last changes. |
MMAL error values were being returned to userspace by some of the functions. Map them to appropriate Linux ones. Signed-off-by: Dave Stevenson <[email protected]>
The mmal-vchiq layer allows submission of buffers before the port is enabled, and it queues them to be sent on port enable. There isn't a way of returning those buffers, which leads to videobuf2 complaining of buffers not being returned by drivers. Add such a call, and reuse the same code in port_disable. Signed-off-by: Dave Stevenson <[email protected]>
Buffers submitted before VIDIOC_STREAMON would be passed to the mmal-vchiq layer, but weren't returned to videobuf2 if STREAMON failed as there wasn't a call into mmal-vchiq to do so. As there is now a suitable call, ensure buffers are returned. Signed-off-by: Dave Stevenson <[email protected]>
…ailure If STREAMON failed, then buffers weren't being returned to videobuf2, leading to it producing WARNs in the kernel logs. Return all buffers stored with the V4L2 M2M framework and with mmal-vchiq should STREAMON fail. Signed-off-by: Dave Stevenson <[email protected]>
If the encode tunnel failed to enable, then the camera was left enabled and that caused a failure on a subsequent request to change format. Disable the camera on failure. Signed-off-by: Dave Stevenson <[email protected]>
Replace several instances of if (foo == 0) with if (!foo) and if (foo != 0) with if (foo) Signed-off-by: Dave Stevenson <[email protected]>
20e3d07
to
4a8ff7e
Compare
OK, that should work now. |
I'll wait for some feedback from @jc-kynesim, but LGTM. |
Ok, I have tested this code, and the result is no HW decoding for video files. There are no errors reported, but I see only a black square instead of a rendered picture. Don't you know whether a newer GStreamer is required for this to work? I am on 1.16. |
I've tried a newer GStreamer 1.18.4, and it is the same. When rendering a web page with an mp4 file included, the only black square is present on the screen. Load and unload of that element is fine without any error or warning. When I play using gst-play, I could see some warnings:
Here is the output of the gst-inspect | grep v4l
|
@timemaster5 GStreamer issue may well be the same as raspberrypi/firmware#1673 I'll pull these patches forward to 5.15 as 5.10 is effectively frozen now. |
@jc-kynesim Fixes for the kernel WARN due to us not returning any buffers that have been queued with mmal-vchiq before the port is enabled.