mmal/codec: Rework buffer handling
mmal/codec: Rework buffer handling

This patch reduces the number of required pictures in the picture pool as well
as the number of required buffer headers on the mmal component. If
MMAL_ENCODING_OPAQUE is used as data format the number of buffers which have
to be provided to the components ports are very critical and there is a
relation between the configured number of buffers at the port and the actual
number of buffers which are available at a port at any time.
The previous approach was rather conservative and allocated a lot of extra
buffers to ensure that things are smooth all the time. This has the drawback
of wasting memory though. Especially when adding another mmal element
(deinterlace filter) it caused a situation where we run out of resources. This
new approach reduces the required resources so that another mmal component can
be added to the chain.

Signed-off-by: Julian Scheel <354106e416911844661e1603d99ecf7d1c318dda@jusst.de>
Signed-off-by: Rémi Denis-Courmont <f0699137713be92736351a0674e79536595e4a60@remlab.net>

shyamalschandra/vlc,xkfz007/vlc,vlc-mirror/vlc,krichter722/vlc,xkfz007/vlc,xkfz007/vlc,shyamalschandra/vlc,xkfz007/vlc,shyamalschandra/vlc,krichter722/vlc,krichter722/vlc,xkfz007/vlc,vlc-mirror/vlc,krichter722/vlc,xkfz007/vlc,vlc-mirror/vlc,krichter722/vlc,shyamalschandra/vlc,krichter722/vlc,vlc-mirror/vlc,xkfz007/vlc,vlc-mirror/vlc,shyamalschandra/vlc,krichter722/vlc,vlc-mirror/vlc,shyamalschandra/vlc,vlc-mirror/vlc,shyamalschandra/vlc