Track audio writes in the mix buffer to set the `active` flag to true
whenever a write occurs, which makes it possible to create the buffer in
an inactivate state and implicitly set it active on demand.
Handle the mix buffer not returning any data in the RTP sending logic
(which is what happens for an inactive buffer) by simply not sending any
packets.
Change-Id: Iaeb0f6deadb3d90020c8c62872735cc94db80504
Similar to the existing media_player, but instead of simply producing
its own standalone output media stream, the audio_player takes over the
entire media stream flowing to the receiver, including media forwarded
from the opposite side of the call, as well as media produced by the
media_player.
Change-Id: Ic34ecf08fc73b04210cfffb1a7d795b462ece5ea
Extend __make_transcoder_full with a custom callback function to create
the SSRC handlers.
Functional no-op.
Change-Id: I79cfabf6e9758b105a89908f9023bd773b838d9e
Support creating transcoders with different "packet decoded" callback
functions.
Functional no-op.
Change-Id: I49ba720841161999dc0ae166ea0841dc094e8bc7
Split out the parts of __ssrc_handler_transcode_new that are related to
the decoder only, leaving the encoder-related code in a separate
function. Allow re-use of the decoder setup code.
Functional no-op.
Change-Id: Ifb91c388a872a4ca14c0cc4571f4d0578271407f
Only parse out a codec type if the codec is given with any parameters
set (and not just by name). Parsing out a codec type when just its name
is given leads to a codec type with default parameters set (such as the
number of channels) which can lead to a stricter matching than desired.
When a codec is given just by name we want to match all codecs of that
type, not just the ones with the same parameters as the default ones.
Change-Id: I583bf4045dbd55291d8dc596310730024853d386
Use dedicated functions and different code paths for the different use
cases, instead of just a single function which does if/else all the
time.
Change-Id: Ic3ab928c3605cfe4a2f48889e95a3a1ddccdbbec
This type is used as const everywhere except internally, so make it part
of the typedef for brevity.
Change-Id: Ic4afe037b392239a991d5380c6708903011da29e
1) Read dtxb->start while the lock is held (not strictly necessary as
the read should be atomic anyway)
2) Expect that dtxb->start can be larger than rtpe_now.tv
The latter can happen as `rtpe_now` in a timer thread is faked to be
exactly the time when the timer was supposed to run, and not the actual
current time, which means that a newly added packet can have a later
time stamp than the "now" the timer thread is using.
Change-Id: I48fd7f78af97c6d5b802e5151d69855a90f4032d
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
Reset the iteration counter for the frequency list when codec handlers
are set up, which happens while setting a new block mode. This makes
sure that a newly set list of frequencies is iterated starting from the
top.
Change-Id: I7ab4e28a1a998c11e38e26cf5b1f17f01299d5ad
Support multiple tone frequencies for DTMF-security=tone to enable
audibly distinguishing multiple consecutive DTMF events from one
another.
Change-Id: I6fa33a5768aae198220d0b0cc4c53308c5661a52
The `dtmf_send` event might not have a matching entry while handling a
received DTMF event. Move bookkeeping of the random output event into
`dtmf_recv`.
Change-Id: I5507b0b7f5eca6e29cbcaccc905ab25249b22aa3
Usually supplemental RTP types (DTMF) are listed after the primary audio
codecs. In the case of the order being reversed, fix `single-codec` so
that it doesn't strip the actual audio codec that is listed after the
DTMF type.
Change-Id: I1b03b89e31bebf4de303b643dcf08d2ffb90ebaf
Similar to I7fd298669a4fd69e62edc4760ffd92eff074707b but for
codec-accept. This prefers accepting codecs that match the given
definiton exactly, but also accepts compatible codecs if no exact match
is found.
Change-Id: I52a2ab6e75f7334a85a8ef059a0d6703a07e4b7f
When adding codecs to the SDP for potential transcoding, use more
sophisticated logic to determine whether the desired codec is already
present. Previously only the raw RTP payload string was used, which
doesn't take codec-specific format options into account. The new
matching function will now also match against existing codecs with
slightly different but compatible a=fmtp options, but will not match
against those with incompatible options.
Change-Id: I7fd298669a4fd69e62edc4760ffd92eff074707b
Convenience function to get a list of all codecs that match a given
definition, including a possible exact match.
Change-Id: I2b7d49fb320ad1725b348f7d29be450e5fea925b
Make these functions return the newly created payload type object so
that it can be manipulated directly without having to do a lookup.
Change-Id: Ib035cf7d61c61d0de6d5f87dfd497d17ba28ca5f
Parse out the format parameters for a payload type object when the codec
definition is loaded. Parsing it out is done only once, and if done
early the parsed contents can be used for format checking, comparing,
matching, etc.
Change-Id: I2856e5a8d4d76e7e1e648eff4a91fc51d0ba20c2
Split up this function into two parts so that they can be used
individually. Eliminate the special 0x1 return value as this isn't used
anywhere else. Move the error reporting into
codec_make_payload_type_sup() where it belongs.
Change-Id: Id2060272d87596a3db32d8776930a98b0f226b3b
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
We have no use for -1/0/1 return values. Change the return type to bool
to make things more clear.
Change-Id: Iedf1d8278c6dfddddb328ce7b3b1dbae132a39b7
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
Create a dedicated struct to hold certain attributes shared by both sink
handlers and media subscriptions, as a preparation to simplify handling
these attributs.
Change-Id: I866159c33ed6d6a2873d2cf68c4906ea705d253e