-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
DVDVideoCodecDRMPRIME: update process info in get format callback #15964
Conversation
bb83f46
to
c16da03
Compare
Dropped the threaded decoding commit, it caused issues with 4K on Allwinner devices, something to improve in future. |
@Kwiboo was the issue with threaded decoding with a hw decoder or sw decoder? |
I think the issue was memory constraints for hw decoder, with 4k, multiple threads and each thread allocating extra buffers it was too much on the board @jernejsk tested. |
@lrusak issue is that too much CMA memory is requested when decoding 4K videos. It seems that ffmpeg makes multiple instances of v4l2_request codec. |
Ah, makes sense. Are we going to be able to set the threading if we are using SW decoding?
Are you able to decrease the buffer pool size? How much CMA are you currently allocating? |
ffmpeg already allocates only on-demand, but @Kwiboo might correct me on that one. Currently I set 256 MiB for CMA, but I don't want to increase that. Older AW SoCs are not even capable of using more or even that amount of memory for VPU. |
256MiB should be plenty no? |
You forgot to divide by 1.5 - NV12 has 12 bpp, but that's still 20, which should be enough for all videos. Worst case would be 16 images in DPB and 1 decoding. That still leaves 3 for buffering purposes, if needed. However, I haven't seen video yet which would use 16 reference frames... |
V4l2 request api hwaccel also allocates 2 mb bitstream buffer for each frame buffer so it adds up, though it was easier to leave threading to a dedicated PR in near future |
Right 😸
No problem, just thought I would ask 👍 |
ah, true and we must not forget other users of CMA. For example, fbcon also allocates one frame to show console. Some other drivers use it too, but I'm not sure how much. |
Description
This PR adds support for using
threads when decoding, changes to update process info in get format callback and fixes a potential issue in case v4l2 request api hwaccel fails to init and sw pix fmt is used.Motivation and Context
Fixes wrong info in process info dialog (pix fmt, hw/sw) in some cases and prepares for sw decode fallback in case hwaccel fails to init.
How Has This Been Tested?
Tested on Allwinner and Rockchip devices using LibreELEC and mainline kernel.
Screenshots (if appropriate):
Types of change
Checklist: