-
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 stateful decode update #4593
Conversation
I tested this (along with firmware changes) with kodi, and didn't see any issues (no observable change). |
Added one further commit that resolves a refcounting issue should you reuse the same MMAL component instance after a timeout returning buffers. That makes Chromium happier. |
…URE) The V4L2 stateful video decoder API requires that you can STREAMON on only the OUTPUT queue, feed in buffers, and wait for the SOURCE_CHANGE event. This requires that we enable the MMAL output port at the same time as the input port, because the output port is the one that creates the SOURCE_CHANGED event. Signed-off-by: Dave Stevenson <[email protected]>
With video decode we now enable both input and output ports on the component. This means that buffers will get passed to the VPU earlier than desired if they are queued befoer STREAMON. Check that the queue is streaming before sending buffers to the VPU. Signed-off-by: Dave Stevenson <[email protected]>
The list of includes was slightly over generic, and wasn't in alphabetical order. Clean it up. Signed-off-by: Dave Stevenson <[email protected]>
ffa4802
to
0dcf5b9
Compare
Rebased and tweaked some patches. Added WIP tag as John needs to test under Chromium. |
When a format changed event occurs, the spec says that it triggers an implicit drain, and that needs to be signalled via -EPIPE. For BCM2835, the format changed event happens at the point the format change occurs, so no further buffers exist from before the resolution changed point. We therefore signal the last buffer immediately. We don't have a V4L2 available to us at this point, so set the videobuf2 queue last_buffer_dequeued flag directly. Signed-off-by: Dave Stevenson <[email protected]>
The firmware defaults to not stopping video decode if only the pixel aspect ratio or colourspace change. V4L2 requires us to stop decoding on any change, therefore tell the firmware of the desire for this alternate behaviour. Signed-off-by: Dave Stevenson <[email protected]>
Adds a module parameter "debug" to enable various logging levels. Signed-off-by: Dave Stevenson <[email protected]>
When a buffer is returned on a port that is disabled, return it to the videobuf2 QUEUED state instead of DONE which returns it to the client. Signed-off-by: Dave Stevenson <[email protected]>
Should we go through the timeout failure case with port_disable not returning all buffers for whatever reason, the buffers_with_vpu counter gets left at a non-zero value, which will cause reference counting issues should the instance be reused. Reset the count when the port is enabled again, but before any buffers have been sent to the VPU. Signed-off-by: Dave Stevenson <[email protected]>
Completions don't reference count, so setting the completion on the first buffer returned and then not reinitialising it means that the flush function doesn't behave as intended. Signal the completion when the last buffer is returned. Signed-off-by: Dave Stevenson <[email protected]>
Currently the code was only setting some controls from bcm2835_codec_set_ctrls, but it's simpler to use v4l2_ctrl_handler_setup to avoid forgetting to adding new controls to the list. Signed-off-by: Dave Stevenson <[email protected]>
The ISP can do H & V flips whilst resizing or converting the image, so expose that via V4L2_CID_[H|V]FLIP. Signed-off-by: Dave Stevenson <[email protected]>
0dcf5b9
to
3da0a09
Compare
Updated again as we've resolved the Chromium issue. If @popcornmix could check against Kodi that would be useful, otherwise I think we're good to go. |
Kodi appears fine with this PR (and latest firmware) in a quick test. |
Okay to merge? |
Thank popcornmix. |
See: raspberrypi/linux#4593 kernel: rpivid: Ensure IRQs have completed before uniniting context See: raspberrypi/linux#4599 kernel: net: phy: lan87xx: Allow more time for link detect See: raspberrypi/linux#4598
See: raspberrypi/linux#4593 kernel: rpivid: Ensure IRQs have completed before uniniting context See: raspberrypi/linux#4599 kernel: net: phy: lan87xx: Allow more time for link detect See: raspberrypi/linux#4598
A couple of fixes for the stateful decode (wants fw 1239).
Also adds support for H&V flips to the ISP wrapper.