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
Generate the output fmtp= string based on the preferences received from
the opposite side. Also add the required format printing function.
Change-Id: I12124efe0b9876c6571bc32c1c45744af80b83d3
If the remote Opus decoder prefers receiving single-channel encoded
audio, honour it and send them single-channel audio.
Change-Id: I4bf952b9f922099c95e19b0ab51fbdffb2cc19db
This commit parses out the string, but doesn't do anything with the
values except for the FEC flag. Move the FEC on/off switch from the
extra codec options into the `fmtp` string.
Change-Id: I51f74f7cb62dd49a9af9815920f077bf300cfa33
In order to actually select codec options in the selection function, we
need to parse the `fmtp` string out first.
Change-Id: I43fe2d61c36c48c093e92681f7578adda0252cb0
If the expected buffer to hold a packet was determined incorrectly, log
a warning instead of throwing an assertion.
closes#1591
Change-Id: I4169378a27b27fed51e453e6d2da8014259c659e
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
G.722 uses 4 bits per sample, not 8. This error was negated by the ptime
incorrectly being adjusted by the clock rate multiplier.
Change-Id: I125c897ee9cbdac29278be9b6451d82b48ff94c2
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
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
Starting with release 5.1, ffmpeg obsoletes the `channels` and
`channel_layout` fields, replacing them with a unified `ch_layout`
struct of type AVChannelLayout. Add wrapper defines into the
compile-time build-test headers fix_frame_channel_layout*.h to
accommodate both new and old versions.
Change-Id: I3d43b85dc3140155a61b1cf2269cda166ad88e9a
If encoder_config errors out for some reason, avpkt may end up
uninitialised. Make sure there is an avpkt when flushing/closing the
encoder. Also make the encoder input more resilient against
half-initialised encoders for the same reason.
closes#1312
Change-Id: I44ebcf6e35f1c383aa5c8202b5d9bbf968b0d5f1
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
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