Use the address family of the address object to do the conversion, not
the family of the socket. This allows for v4-in-v6 socket usage.
Change-Id: I4d23b7036207e71f5e70706d621d8ec2b7ca0934
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
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
... as an extra offset for newly added sources, based on the difference
between the last runtime (read time) of the buffer and the current time.
Change-Id: Ie99e24f0697f0950f0fcfa1e5e58b8f4be134018
A simple circular audio buffer that allows mixing multiple sources of
audio. Sources are tracked by SSRC and all sources are expected to
provide audio in the same format (same clock rate, channels, sample
format).
Only one consumer per buffer is supported, which is expected to retrieve
buffered audio at regular intervals (ptime) and so continuously empty
the buffer.
The first audio source to write into the buffer at the leading edge of
the circular buffer has its audio simply copied into the buffer, with
the leading edge advanced, while other later sources writing into the
buffer mixed into the existing buffered audio at their respective write
positions.
Change-Id: I0f6642b036944508f2a33420359de488ef8b991c
For source files generated from the "strhash" helper script, output line
and file number information into the generated .c source to help gdb and
other tools correspond the compiled code with the correct source code.
Change-Id: Ieddc86ab59b41ab26942e8a7d3c24e7800e9936f
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
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
This include only serves to define one type, which is used only as a
pointer. Use an empty typedef declaration instead.
Change-Id: I7d2cc8b97303b9363a5bfe363fffeea09ee56686
At least the recording daemon uses the linesize directly, so this needs
to be corrected after returning a frame from the resampler.
Change-Id: Ia940d8acbbee3fb2d6564474ecb93ae27422d8af