bayer2rgb: take into account filter in transform_caps function

Fixes criticals when filter caps are passed.

Also fix wrong GST_DEBUG_OBJECT use.

https://bugzilla.gnome.org/show_bug.cgi?id=741863
audiomixer: Use the src query implementation of aggregator as the default case
videoaggregator: Use the src query implementation of aggregator as the default case
aggregator: Also include the subclass latency in the result of the latency query
aggregator: Fix docs and default value of the latency property
aggregator: Also change the default latency to 0, not just the minimum
aggregator: Don't leak flush-start events
audiomixer: Change blocksize property to output-buffer-duration in time format

This makes the interface of audiomixer independent of the actual caps.
audiomixer: Make sure to release the current buffer in reset()

If we didn't output the last one in aggregate because we were shutting down
earlier we might otherwise leak it.
audiomixer: If getting a timeout before having caps, just advance our position

This can happen if this is a live pipeline and no source produced any buffer
and sent no caps until the an output buffer should've been produced according
to the latency.
adaptivedemux: allow subclass to use new pads group when switching bitrate

Fix pad groups switching when bitrate changes to allow HLS to use this feature
adaptivedemux: fix segment start when exposing new streams

Segment start needs only to be updated when starting the streams
or after a seek, doing it during bitrate changes will cause the
running time to go discontinuous (jump back to a previous ts)
and QOS will drop buffers
adaptivedemux: make sure task has stopped before freeing it

Otherwise the thread will be running and its memory will get freed.
This leads to memory corruption
adaptivedemux: check if element exists before setting it to null

Under certain error conditions it might happen that the element
has been freed already and trying to set it to NULL causes an
assertion
hlsdemux: port to adaptive base class

Conflicts:
	ext/hls/gsthlsdemux.c
	ext/hls/gsthlsdemux.h
hlsdemux: typefind might fail if first buffer is too short

If typefind fails, check to see if the buffer is too short for typefind. If this is the case,
prepend the decrypted buffer to the pending buffer and try again the next time around.

https://bugzilla.gnome.org/show_bug.cgi?id=740458
gdppay: dataprotocol: drop bogus const

Doesn't really make sense given that we map
it and possibly merge memories and such.
gdppay: optimise payloading of buffers with multiple memories

Add function to calculate a payload CRC across multiple memories
so we don't have to merge buffers with multiple memories just to
calculate the CRC. Also make CRC calculation function static,
since it's not used outside dataprotocol.h and move special-casing
of length = 0 -> CRC = 0 into CRC function (from caller).

Perhaps more importantly, since payload CRC is off by default:
don't map buffer (and possibly merge memories in the process)
if we are not going to use it to calculate a CRC anyway.
tests: gdppay: initialise memory of buffers used in unit test
gdppay: refactor a little

Get rid of now-useless packetizer struct and just
call internal functions directly. Also remove
version property which is now defunct, not least
because we create the packetizer with the
version in the init function before a version
can be set.