The patch from Bug #580796 hacked around existing infrastructure to handle
timestamps as DTS (as in all AVI files) causing the logic to be disabled.
Properly hook the timestamp handling into the existing infrastructure to handle
these cases too, partially reverting a26b94d92c
and moving some stuff around.
Refixes #580796.
If the set of caps for either audio or video is completely empty, skip
adding that pad template to the class. Some muxers only support audio-only
or video-only and otherwise end up with EMPTY caps in the pad template.
Rewrite the audio encoders to use the right API functions of ffmpeg. Also get
rid of the handrolled cache and use adapter instead for formats that require
fixed frame_size as input.
We don't need to set a default frame_size, ffmpeg has set this value to 0 to
inform us that there is a fixed relation between the amount of input samples
and output samples. Now we only need to implement handling that fact.
ffmpeg only tells us on a per-decoded-buffer basis if the stream is
interlaced or not. When we see a change, we force negotiation.
We can't detect that in our get_buffer() (when doing downstream allocation),
because at that point the interlaced flags aren't set on the outgoing
buffer.
Add a new function new_aligned_buffer() which creates a GstBuffer of
the requested size/caps, with the memory being allocated/freed by ffmpeg's
av_malloc/av_free which guarantees properly aligned memory.
Added a can_allocate_aligned internal property which we use to figure out
whether downstream can provide us with 128bit aligned buffers.
Don't use AC_CONFIG_SUBDIRS to call the FFmpeg configure script, as it
complains about all the unknown parameters autoconf gives it, and fiddling
with ac_configure_args makes maintainer-mode call our real configure script
with a bunch of bogus arguments.
Instead, use AC_CONFIG_COMMANDS to call the FFmpeg configure script
ourselves.
Remove autogen.sh code that modifies the FFmpeg configure script, as it's
not needed now that we only pass it arguments it understands, and move
the detection of flags like --disable-ffmpeg into the configure script,
otherwise they never get passed to FFmpeg if we call configure ourselves,
such as from a tarball.
Without a frame_size configured in the context, the ffmpeg encoders do nothing.
Since the G726 does not configure a size itself, we set ourselves a frame_size
that corresponds to 20ms of audio, which is a reasonable default.