Commit Graph

58 Commits

Author SHA1 Message Date
Martin Pulec
46ecc5ebda avoid use of strdupa 2025-04-14 15:44:10 +02:00
Martin Pulec
88e511f898 audio codec: if received no data, pass it further
This is an exception to the normal behavior used by the passive audio
mixer participant, that sends empty packets to request receiving the data.

It doesn't affect the normal UG behavior, because the situation when
nonzero_channels=0 doesn't occur otherwise. Either we receive at least
some packet from a frame and if not, the decoding doesn't take place.
2024-11-28 12:05:06 +01:00
Martin Pulec
a0ef81d76b audio/codec: improved including 2024-11-25 15:09:09 +01:00
Martin Pulec
544485bc54 audio/codec: allow PCMA/PCMU aliases
instead of u-/a-law for convenience
2024-08-06 16:25:12 +02:00
Martin Pulec
e494106bba moved strdupa from compat/misc to strings
\+ missing include guard
2024-06-12 14:26:34 +02:00
Martin Pulec
869c436588 audio codec fmt: accept shortcuts
accept prefix syntax for bitrate and sample_rate
2023-11-29 15:27:33 +01:00
Martin Pulec
5c61b9d4d8 parse_audio_codec_params: check bitrate suffix
do not accept something like:
`uv -A Opus:bitrate=64b`

(was meant 64 bps or what?)
2023-11-29 15:27:32 +01:00
Martin Pulec
7fa5f3e672 parse_audio_codec_params: wrong cond fix 2023-11-29 15:27:32 +01:00
Martin Pulec
40a7d04ec1 unit_evaluate[_dbl]: added endptr param 2023-11-29 15:27:32 +01:00
Martin Pulec
6ebcfa1a26 audio/codec: improved including 2023-11-29 15:26:32 +01:00
Martin Pulec
bfb7a1d232 removed no longer needed check_audio_codec 2023-11-29 14:58:16 +01:00
Martin Pulec
e50db753be audio/codec parse_audio_codec_params: check vals 2023-11-29 14:58:16 +01:00
Martin Pulec
288b2c5804 refactor audio codec fmt parse
Should be almost functional equivalent as the previous version.
2023-11-29 14:58:14 +01:00
Martin Pulec
53fad82f7e lavc audio: print available encoders/decoders 2023-10-25 13:02:41 +02:00
Martin Pulec
ff5ca386e6 audio codec: remove deprecated flag + new API fn
Get the info from audio lavc in textual form instead with a new API to
querying additional info about codec for user.

The new API will allow adding additional useful information in help,
eg. encoders present.

this updates the commit a0dd6b9b85
2023-10-25 13:02:38 +02:00
Martin Pulec
3683965e2c audio compress: correctly pass timestamps 2023-10-16 16:29:23 +02:00
Martin Pulec
2191dfd228 Revert "audio decompress: pass packet list (iterator)"
This reverts commit 29421cd1fe.
2023-10-16 16:19:56 +02:00
Martin Pulec
175844d63a Revert "lavd audio: use packet API"
This reverts commit 7f810b8ddd.
2023-10-16 16:19:56 +02:00
Martin Pulec
0b33b0a781 Revert "packet counter: remoed unneeded packet store"
This reverts commit f106180bbf.
2023-10-16 16:19:56 +02:00
Martin Pulec
f106180bbf packet counter: remoed unneeded packet store
Not needed to store separately "current" buffer packets since it is
already stored in cumulative, it is just needed to store the current
buffer number.
2023-08-01 12:01:09 +02:00
Martin Pulec
7f810b8ddd lavd audio: use packet API
use packet API for OPUS
2023-08-01 12:01:09 +02:00
Martin Pulec
29421cd1fe audio decompress: pass packet list (iterator) 2023-08-01 12:01:09 +02:00
Martin Pulec
a0dd6b9b85 deprecate Speex audio codec
Speex doesn't seem to offer any advantage over other codecs and is deprecated in
favor of Opus by Xiph.Org.

Added this feature in a generic fashion in order to allow eventual deprecation
of some other codecs that may not be useful but would complicate further
development.
2023-07-27 12:02:35 +02:00
Martin Pulec
1784f2cedd receiving: pass received frame TS for futher sync 2023-07-18 11:09:07 +02:00
Martin Pulec
17f50eede2 RTP: send synchronized A/V TS where possible
Send same RTP timestamps for audio/video frames captured at the same
time.

RTP specification allows this (although doesn't require - according to
the spec, the RTP timestamps should colaesce with RTCP NTP
correspondence). We slightly modify that in a way that we use for both
audio and video 90 kHz clock resolution, so if the start point is the
same (random), the RTP timestamps will be exactly the same for related
data.

Implemented for vidcap DeckLink and testcard.
2023-07-18 11:09:07 +02:00
Martin Pulec
5fe914edd9 audio/codec: get rid of rang.hpp 2023-06-23 10:58:33 +02:00
Martin Pulec
572209187e audio/codec: turned fprintfs into log_msg
+ print number of empty channels
2023-06-21 16:37:42 +02:00
Martin Pulec
83f8d55913 audio codec: do not pass empty channels to dec
libavcodec audio decoder has assertion on channel non-emptiness (which
is perhpas correct - there cannot be anything done there) so do not pass
emtpy channels.

refer to GH-316
2023-06-13 16:06:11 +02:00
Martin Pulec
48219758ea use Opus, not OPUS
For audio codecs, we respect its native capitalization of letters, eg.
AAC, speex. So do it also for Opus. This should not affect existing
applications since the Opus name is parsed case-insensitively.

Only exception is SDP (rtpmap) where is usually used lower-case (at
least in rfc7587).
2023-04-26 09:53:10 +02:00
Martin Pulec
b1f0e004f4 fixed new Coverity bugs
Fixed some of (easy) newly detected Coverity bugs. Those are mostly
innocent ones (performance) and not new (detected because of new release
of Coverity).
2022-08-22 09:57:16 +02:00
Martin Pulec
3913f589ed Audio compress: fixed encoder changing BPS with multichannel
Fixed a situation when audio compression changes BPS, eg. AAC:

    uv -s testcard --audio-codec AAC --audio-capture-format channels=2
2022-01-06 13:56:47 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Pulec
09426b2a7c print rather err msg on wrong unit_evaluate(_dbl) val
Use an user-friendlier error message than assert.
2021-10-05 10:26:48 +02:00
Martin Pulec
2fefba5259 Audio codec: prevent crashes when decreased number of channels
Number of codec states may exceed the actual number of frame channels
(states are not deleted).
2021-08-11 13:32:41 +02:00
Martin Pulec
1e9853e9e5 Audio compress: return object instead of pointer 2021-08-11 13:28:25 +02:00
Martin Pulec
31d9809fcd Updated documentation
Updated authors, copyright to 3-clause BSD (where possible) and file-level Doxygen
2019-11-09 13:47:11 +01:00
Martin Pulec
ad6ea541e6 Audio codec: improved help
+ mention that the bitrate is per channel
2019-10-08 15:35:15 +02:00
Martin Pulec
696034ff59 Audio codec: fill missing channel samples
Fill missing channel samples with a silence. This should behave better
in case of greater number of channels because now is not dropped the
whole frame.
2019-08-22 10:23:51 +02:00
Martin Pulec
e602942929 Typo 2019-08-19 09:13:08 +02:00
Milos Liska
9006d07f49 Fixed --audio-codec parameters parsing
* Fixed dangling pointer to parsed out value of audio codec parameters.
2019-08-08 09:33:43 +02:00
Martin Piatka
c96a20dec8 Capabilities: Print supported audio compressions 2019-07-30 11:01:20 +02:00
Martin Pulec
e0e315a6fa Audio codec: check validity of parameters 2018-09-18 11:28:00 +02:00
Martin Pulec
2894c313a2 Better input value check for bitrates and MTU
* better check values' boundries
* for MTU and traffic shapper also check if there are reasonable values
  (eg. for the cases when they are interchanged by mistake)
2017-03-15 16:45:47 +01:00
Martin Pulec
a390d0ab89 Audio codec: use new module API 2015-09-02 17:01:07 +02:00
Martin Pulec
9672fcc20c audio_codec_decompress: return obj instead of pointer 2015-08-31 11:11:03 +02:00
Martin Pulec
0fc4ba2942 Audio codec: choose sample rate automatically 2015-08-19 09:53:10 +02:00
Martin Pulec
899ca0b56f Audio sender: don't auto resample to 48000
+ some rework - audio_frame2 has now methods for changing bps and
resampling
2015-08-19 09:53:10 +02:00
Martin Pulec
7ca27e5d7d Libavcodec audio: support for further sample fmts
+ fixed AAC (bitrate == 0 caused malfunctioning)
2015-07-20 16:03:27 +02:00
Martin Pulec
fed097a97f Lavcd audio: removed G.726+ADPCM, added AAC+FLAC
Removed codecs seems to have some issues, not clear whether in UltraGrid
or libavcodec.
2014-11-27 18:21:51 +01:00
Martin Pulec
2e833bd261 Libavcodec audio: suport for mp3 + fixes 2014-11-26 13:06:24 +01:00