videorate: stop copying buffers in drop-only mode
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 4 Apr 2017 11:19:02 +0000 (13:19 +0200)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Sat, 20 May 2017 14:35:53 +0000 (16:35 +0200)
commit36b7e5890f4f8b68384978e4e62c0e1839f98237
treeab56fb12fc5de638a9edb298e7c6e10dd607adc1
parent2c2d2a444c5451e1ec48e3123e31fc13ab016384
videorate: stop copying buffers in drop-only mode

gst_video_rate_flush_prev() ensures that the pushed buffer is writable
by calling gst_buffer_make_writable() on videorate->prevbuf.

In drop-only mode we always push buffers directly when they are received
from GstBaseTransform (gst_video_rate_transform_ip()) and do not keep them
around. GstBaseTransform already ensures that those buffers are
writable so there is no need to do it twice.

This change saves us from copying buffers in drop-only mode as we no longer
calls gst_buffer_make_writable() with a buffer having a refcount of 2
(one ref owned by GstBaseTransform and one in videorate->prevbuf).

https://bugzilla.gnome.org/show_bug.cgi?id=780767
gst/videorate/gstvideorate.c