Replies: 2 comments
|
I assume that all DMA-BUF handles become invalid when the decoder is reopened. I don't know if it is a problem when the handle is invalidated while the frame is still being displayed. This is probably the cause why this pops up during reverse trickspeed: The handle is closed in cDrmBuffer::Destroy(), which is called by the display thread, but the reopening of the decoder is done asynchronously in the decoder thread. When the decoder thread reopened the decoder before the display thread closed the handle, closing the handle (again) fails. |
|
RPI4 with rpi-ffmpeg seems to need destroying each buffer also in forward trickspeed. Otherwise, there will be more than max |
Uh oh!
There was an error while loading. Please reload this page.
I just want to summarize the facts and findings around the reverse trickspeed mode, if, in the future, we want to optimize it, i.e., find a solutions that works with all hardware platforms and all FFmpeg versions without any quirks *dreaming*.
Potential code optimizations/simplifications:
QUIRK_CODEC_FLUSH_WORKAROUND.Facts:
The following tests were done in reverse trickspeed, reusing the DRM buffers:
Faking the PTS, so that the video decoder only sees monotonically increasing PTS, doesn't make any difference with RPI5. Not tested with RPI4.
When destroying and recreating the DRM buffers, and applying the quirk after each decoder flush, all codecs work on RPI4 and RPI5.
Tested with this FFmpeg version:
H.264 in reverse trick speed mode on RPI4, reusing the DRM buffers, not using
QUIRK_CODEC_FLUSH_WORKAROUND, using rpi-ffmpeg, does not work. Question remains if that is an rpi-ffmpeg issue or if it is related to the combination of RPI4 and its H.264 HW decoder.All reactions