Upstream caps (re)negotiation

Upstream negotiation's primary use is to renegotiate (part of) an already-negotiated pipeline to a new format. Some practical examples include to select a different video size because the size of the video window changed, and the video output itself is not capable of rescaling, or because the audio channel configuration changed.

Upstream caps renegotiation is done in the gst_pad_alloc_buffer ()-function. The idea here is that an element requesting a buffer from downstream, has to specify the type of that buffer. If renegotiation is to take place, this type will no longer apply, and the downstream element will set a new caps on the provided buffer. The element should then reconfigure itself to push buffers with the returned caps. The source pad's setcaps will be called once the buffer is pushed.

It is important to note here that different elements actually have different responsibilities here:

Unfortunately, not all details here have been worked out yet, so this documentation is incomplete. FIXME.