Make sure a codec is not only known to us, but that it can actually be
used, in places where it makes sense. This is partially redundant
because ensure_codec_def_type already takes care of this, but a codec
definition may come from a different source, so it doesn't help to
double check.
Change-Id: I91af84afc2477840f1400674b2538ad8fb7746ee
In some cases, in particular when multiple input codecs are transcoding
to the same output codec (e.g. audio + DTMF -> audio), it's possible
that one of the input decoders produces frames in a format different
from the one expected by the encoder. Add an encoder-side resampler to
compensate for that.
Change-Id: I74d55edf47ac2fa65f950e68f4a5975f1ab947bb
ffmpeg 7.1+ has deprecated direct usage of ->sample_fmts in favour of a
call to avcodec_get_supported_config(). Update accordingly.
Change-Id: I0fbecbbcf52c38976f3387e34d816d11e1d09480
Add support for simplified G.107 formula, with math changed to
fixed-point. Retain legacy formula as an option for backwards
compatibility.
Change-Id: I999fc7de7be1407876c201c251538cea72b04008
Switch all memory buffers used for RTP I/O from generic stack or heap
allocated memory to the bufferpool implementation. Use a per-thread
bufferpool to minimise lock contention.
This commit is just a one-for-one swap and doesn't use the bufferpool's
reference counting semantics yet.
Change-Id: I9cba4ec97bd0afcd374bf6c0be2b608a46e73e57
As we don't directly append to an existing GString any more anyway,
simplify the function signature by just returning a new GString if the
format string is known.
Change-Id: I9f8e6fbd93ea063eecb519cd57366effd4022f75
Introduce rtpe_has_cpu_flag() and associated enum to test for specific
CPU flags. Use singleton approach to do the CPUID only once.
Convert simd_float2int16_array() to float2int16_array() as an ifunc. The
resolver function uses rtpe_has_cpu_flag() to determine which
implementation to use.
If no SIMD implementation is available, use the linked evs_syn_output()
from the shared object as before, with an intermediate wrapper function,
which is needed as the dlopen() happens only after the
float2int16_array() is resolved.
Change-Id: I34fa03433ba5d6fa7d6d4f290455015db29fdd74
Prevent a wrongly advertised (too small) a=ptime from producing too
small buffers to hold encoded packets by flagging codecs with a fixed or
minimum frame size as such.
This is relevant to libavcodec only as the code determines the expected
frame size from the clock rate and the ptime.
closes#1591
Change-Id: I9f5c56d45f2aad56951b19d846ddbfa4b7bd7e7d
This type is used as const everywhere except internally, so make it part
of the typedef for brevity.
Change-Id: Ic4afe037b392239a991d5380c6708903011da29e
Instead of going through ffmpeg to en/decode Opus, use libopus directly,
which allows us to benefit from additional features that aren't
available when going through ffmpeg.
Change-Id: I017c276cfa9755cefe95c8da26691446b718d4c8
Some codecs (e.g. Opus) can natively encode audio with various clock
rates without producing an output that is locked to that clock rate and
without requiring resampling the input. Add an appropriate callback
function and adapt tests.
Change-Id: Id788c4d4c05e20f93cce7e910f9f265b381cbe34
This makes it possible to have codecs running at variable clock rates
that differ from their RTP clock rates.
Change-Id: Ia2f5effb82eefe8c3028573ba0a6697da28473b1
Instead of just having an integer multiplier, support a fractional
factor. This allows us to have the RTP clock rate run faster than the
audio clock rate, and not just slower by an integer factor.
Change-Id: I7681cf369c43d8424ca2d2ebeffe932595d271ec
Introduce an additional function for codec matching. Different functions
match different parts of an RTP payload type object and the referenced
codecs.
Change-Id: I2e488eaa7f69a55322db748fd40c8d1195e38605
Parsing out the a=fmtp string has been left up to the codec init
function until now, with the values that resulted from the parsing being
stored only within the codec. Convert this to an explicit method to
parse the a=fmtp string, and introduce a dedicated struct to store the
resulting values.
Functionally this change is a no-op.
Change-Id: Ia84e26d632ed5209b4439fd82c1e4e38850fd024
Recent ffmpeg versions have removed AVPacket from the public ABI,
therefore deprecating av_init_packet on statically allocated objects.
The replacement is av_packet_alloc()/av_packet_free().
Change-Id: I5f93fbd19e43413c3328e143cc9147fbdf12d910