videodecoder: performance regression with libav decoders
@rawoul
Submitted by Arnaud Vrac Link to original bug (#790087)
Description
Commit ae8d0cf3 (videodecoder: Make sure we have an actually writable buffer when modifying metadata) introduces a performance regression when using libav based decoders with a downstream pool.
More specifically, in the following use case the buffer copy is actually not shallow, the whole memory is copied:
gst-launch-1.0 <source>
! avdec_xxx ! waylandsink
In this case waylandsink allocates a buffer pool with SHM memory (fd allocator), but the data is copied on the call to gst_buffer_make_writable() in the offending commit. This also prevents reuse of the wl_buffer objects, since those are now attached on a transient buffer and not on the buffer from the pool.
I think the only way to fix this properly would be to remove the reference on the buffer that libav has, however I can't find where this reference is kept and used. Any idea ?