Commit Graph

13290 Commits

Author SHA1 Message Date
9920b38dbd move recording code from encoder to audio_rtp
It is bad design to have recording related code in the encoder. The
encoder should handle exclusively encoding related tasks.

Move recording related code to audio_rtp.

Change-Id: I4e2c59b09d40d1ae07b88cfb61865312a69c0942
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2018-08-14 09:11:38 -04:00
496fbbd618 media: build MediaStream from AudioFormat
Keeps track of sample format in AudioFormat, because MediaStream needs a
format.

Change-Id: I3ee3fe05f3d5d98706a20132876685e37ffdd966
Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
2018-08-13 17:33:31 -04:00
c49c89a666 decoder: add more fallbacks if fps is 0
Change-Id: I59f25e4537c393674f1b62b0e12deb143d9fc108
Reviewed-by: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
2018-08-13 16:43:36 -04:00
e4ba16d1b1 replace PRIx64 for mingw compilation
Addresses https://sourceforge.net/p/mingw-w64/bugs/360/

Change-Id: Ida4d2da450b8f935bb1953cf0c76b06631153dc2
2018-08-13 14:49:22 -04:00
cea56600b8 account: reset default ringtone path if empty
Change-Id: I477699c13343512830f82289bdef331f37282cff
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-08-13 14:30:26 -04:00
68cb09877b ringaccount: include cinttypes
Change-Id: Ic06371032cf701da53456fb551921b89b07efc9e
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2018-08-10 15:13:27 -04:00
6e68677874 ringaccount: reorder includes
Fixes problems with mingw not including inttypes.h when needed.

Change-Id: Icd3e1153eac74ac74e25d2ae1d0df4dc4e655314
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
2018-08-10 13:51:42 -04:00
47586cba7e build: add default PDB for ReleaseLib vcxproj configuration
- the default setting is /Zi(ProgramDatabase), so this patch
  specifies that so the line can be removed with a sed in our CI

Change-Id: I2ac60d755569f8aec3ca94f4b73b9cae4993e8b1
2018-08-09 09:55:32 -04:00
8a1d9e27ae ffmpeg: add libswresample check
Adds libswresample to the package check. Namely, we don't want to use
libavresample, which has a different API. The latter exists solely for
compatibility with Libav.

Change-Id: I717975c696e2de2787be98cac07862215095b667
2018-08-08 17:27:48 -04:00
20b631fb78 audio: refactor resampler class
Using MediaFilter would make the resampling time longer and more
unpredictable than directly using libswresample.

Adds libswresample as a dependency.
Simplifies Resampler class.
Resampler detects changes in input and output formats automatically.
Changes Audiofile to use Resampler instead of MediaFilter.

Change-Id: I24919e8fa514dbb4a38408e338016976e7424136
2018-08-08 13:36:45 -04:00
034fd6424f audio: play tone when calling
Fixes regression introduced by b1539bd. Since Tone was now in a
shared_ptr, reset was called on the shared_ptr instead of the Tone.

Change-Id: If2041feb8cffbb62f1748867a5099c2a0718de1d
2018-08-07 17:49:35 -04:00
67bb967fe2 build: properly carry build flags
Fix build flags for two directories, clean globals.

Change-Id: I2c2fb1fd7f73c8097de05f641ad3e71ccbabd965
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-08-07 16:52:30 -04:00
4776c563a6 decoder: set framerate if not found
If FFmpeg was unable to find a framerate in avformat_find_stream_info,
fall back to the DeviceParams' framerate.

This was the case for certain Macs.

Change-Id: I0ee7ebeef37676ff5907482421425051e880c6f5
2018-08-06 13:23:38 -04:00
170355f6af rational: convert to int when returning AVRational
Fixes potential warnings, as AVRational only deals with int.

Change-Id: I35d53a1a84b9e7f9709a51a4c8be8873ba4f7094
2018-08-06 13:23:38 -04:00
6d57b0c40b contrib: enable audio decoders
Allows different ringtones to be used to compensate for sndfile no
longer being used to decode them.

Also prepares for eventual audio streaming.

Change-Id: I0e5d4374266887b09fdab5846f85ed25b5a1679c
2018-08-03 17:03:42 -04:00
ea8197713a build: remove libsamperate for native windows builds
Change-Id: I13a43623c1e23b09557782f865d64a421d5c0cac
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2018-08-03 17:02:36 -04:00
1c8d8a3f52 contrib: remove deprecated dependencies
The flac, ogg and vorbis contribs were used by sndfile. They are not
used by ffmpeg, making them superfluous.

Change-Id: I57b2078c617fa764e3bc6302816a61ec9caa20c3
2018-08-03 14:36:49 -04:00
05d3813db6 decoder: set channel layout
Change-Id: I9aadd0696d7ad2e467ffe19841bc9e919e08777a
2018-08-03 14:13:45 -04:00
e3022741bd audio: remove libsamplerate dependency
Rewrites the Resampler class to use MediaFilter.
Adds a unit test for the new Resampler.

Change-Id: I8ed78d2e1d82df81bbaf46a9719c682c825ee245
2018-08-03 14:13:41 -04:00
834e835dee audio: remove sndfile dependency
Removes unused/deprecated audiorecord/audiorecorder
Allows any file to be used as a ringtone (mp3, ogg, etc)

Change-Id: I9ce33ec3d5f083caf098266befa597e78a95d7d6
2018-08-02 17:20:50 -04:00
60305d9224 filter: simplify usage and get input params
Adds a way to get input parameters.
Simplifies usage of simple filters.
Adds const where useful.

Change-Id: I768d2f3e4e46e791e10530a1c3010607fecc42da
2018-08-02 12:19:51 -04:00
d7fee9ca95 contrib: update opendht to 1.7.4
Change-Id: I0b6602938b931d3bdf06cdd1e96635c8781a9663
2018-07-31 13:56:03 -04:00
b106642f5d build: alterations for win32/uwp msc compliance
Change-Id: I02061e1319499e694817000e6184d1735c67261f
2018-07-30 18:15:14 -04:00
04556ae8ee test: add decoder unit test
If the PCM signed 16 decoders cannot be found, skip the test

Change-Id: If7ddf9778465415232e59f43b88ba17bf3bf7dbd
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-30 13:41:53 -04:00
ef63c35718 contrib/libressl: don't build tests, apps
Change-Id: I74b2c33e010aeff66e3bf346ca9db2c98d140448
2018-07-30 13:30:07 -04:00
68eba9f1b4 contrib: update asio
Change-Id: I4ba5e23ae4bd40c8520f8e4a5a59583616b2e8aa
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-30 13:23:56 -04:00
2cbbaf7983 configure: remove ilbc and gsm
FFmpeg's RTP muxer does not support GSM, while Ubuntu does not package
iLBC. Removes the old configure switches.

Removes package detection from contrib. Keeps contrib rules in case GSM
is later readded.

Change-Id: I705a521e2baf34c757c22a72e04cdf27233b5a7b
2018-07-30 13:15:51 -04:00
b1539bd145 tone: pass shared_ptr instead of raw pointer
Makes both ringtone and dtmf tones shared pointers instead of raw
pointers to avoid race conditions and use-after-free's.

Change-Id: Ib8dc12c17905ca9bf0bc9dc01667b3194be70927
2018-07-30 10:16:53 -04:00
4edce7243b decoder: don't set channels and sample rate in dictionary
This is redundant, the information can already be found in the AVStream
object and is set by avcodec_parameters_to_context. Let FFmpeg take care
of these details.

Change-Id: I199de87a852caeef34047e4f906ccd21dcb696c4
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-30 10:16:34 -04:00
a843a5b6a5 contrib: update opendht to 1.7.3
Change-Id: Ie34463b6ecbd04d37552dedbb07771f968d34061
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-27 15:56:28 -04:00
8d4fad419e sipvoiplink: catch exception in requestKeyframe
requestKeyframe is stateless and failure is not critical.

Change-Id: Iced5b13496e07153e7352d316c4cb5b06a9aab89
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-27 13:55:32 -04:00
e6ed1e1fab audiobuffer: add conversion to AVFrame
Moves the AudioBuffer to AVFrame conversion logic outside of the
MediaEncoder, so the latter only deals with AVFrame.

Does not copy the buffer, the resulting AVFrame will simply point to the
existing buffer.

This is the first in a series of patches attempting to rid Ring of its
RingBuffer/RingBufferPool system.

Change-Id: I17c9fcdb96dc945c3eeace647303339d558bcf38
Reviewed-by: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
2018-07-27 11:15:11 -04:00
2a1f41bc9c sipvoiplink: cleanup
Change-Id: I790780a6de8e4bf76177960a84527fd4eb6378f1
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-26 14:09:15 -04:00
55f48f133c fix spelling errors
Change-Id: Ifbc5f3792a7019dcfa8249eb30afe2a64cbeb57c
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-26 14:05:58 -04:00
c2bfe7cc31 video: replace yuv422_clear_to_black
FFmpeg's av_image_fill_black supports more pixel formats.

Works around casting int* to ptrdiff_t* on platforms where ptrdiff_t
is not the same size as int by recreating the linesize array.

Change-Id: I2825b18c6acc921a3cd3bb1398565df0aa657153
2018-07-23 10:09:32 -04:00
629aab9421 contrib: add native windows support for libsndfile
Change-Id: Ib78e459812dddc3d25dab7998f7ea5b9da07a758
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-20 16:06:18 -04:00
163d72fc50 ice: filter local deprecated and tentative ipv6 addresses
As described in RFC 2462, an ipv6 address can have several states and
some should be ignored when initializing an ICE session:

In fact DEPRECATED address SHOULD NOT be used in new communications.
Also, a TENTATIVE address is not ready to be used too. So, this
patch ignores this kind of addresses when initializing a new connection.

Change-Id: I95637286eb68451352fd7289a49ddc3cdf5ac383
Gitlab: #29
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
2018-07-20 11:57:51 -04:00
a210854083 smartools: set audio encoder name if not resampling
Change-Id: I9b6a97a7f60a4533f24a48c4638b47973c54b0f5
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-18 17:20:30 -04:00
64a0956bf4 configmanager: fix typo in setAccountDetails doc
setAccountDetails emits AccountDetailsChanged, not AccountsChanged.

Change-Id: Ic0af35d10ab7050f648b0dece0975f59370d077c
2018-07-18 14:08:55 -04:00
11585ed297 recorder: refactor pipeline
Moves the recorder up one level to the VideoInput, VideoReceiveThread
and AudioReceiveThread, instead of the MediaDecoder (there's no
equivalent to the VideoInput in the audio layer).

Emits the RecordPlaybackStopped when the recording is stopped, so the
client can sync its recording state with the daemon, in case the daemon
stops recording by itself (rather than user intervention).

Change-Id: I743b080cb354273ec074fec51caf2a4328fc1c58
2018-07-12 16:43:38 -04:00
e2de2c2d55 media: fixes rational/media_decoder for the native windows build
- adds headers for msc compliance
- removes C99-style casting of a list initializer in a C++ file

Change-Id: Id77a3945c060b26d6a1bc5920e8461cc7310b309
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2018-07-12 15:49:56 -04:00
e9117a8113 contrib: add native windows support for libvpx
Change-Id: I280be53a1246686dd6aba3be81f9937eee37ce27
2018-07-12 14:49:43 -04:00
0698af7647 project: provide cmake path for native windows restbed build
Change-Id: Idcce4c27fba8d6680ae451afdc07b8ea2b72a471
2018-07-12 14:49:43 -04:00
9e6d7b2f8d data transfer: correctly set parameters for cancelling transfer
a CANCEL message takes two parameters:
1. The peer device
2. The transfer id to cancel
Only one was given in some cases

Change-Id: I4f73b3d64be90bdb4d90fcb6bb935eb460840df5
Gitlab: #18
2018-07-11 15:50:28 -04:00
a617ed7e36 change startRecorder to initRecorder
It better explains what the method does, as the recorder is not started
at that moment).

Change-Id: Ib536600b663e9ee188257b3b166f497f5a2b2c1e
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-10 16:30:02 -04:00
f8bd331d66 recorder: use video input as source
MediaRecorder no longer uses VideoSender (encoder) as a source for its
local video and will directly use VideoInput (decoder), as it is earlier
in the pipeline.

This is the first step to support switching inputs while recording.

Change-Id: Ia163efa3b20a349a93fc7b05213ec5e00de1704e
Reviewed-by: Sebastien Blin <sebastien.blin@savoirfairelinux.com>
2018-07-10 16:29:46 -04:00
33293017c2 account: display pin in lowercase
Lowercase pins are valid, and easier to enter on a phone's smaller
keyboard. Also makes it so some characters that can be difficult to tell
apart from each other in uppercase easier to differentiate.

Change-Id: I7aee29ceef0fbc69c046e0bb7ced486de2a3d4a4
2018-07-10 12:45:45 -04:00
690198c67e decoder: use clock to set video timestamps
Fixes some recorder timing issues.

Change-Id: Ia6f5d016a35dbe41ab08f01cd9506f318d120cfe
2018-07-10 12:45:37 -04:00
2dbaf0fdd2 rational: add auto-simplification
Change-Id: I506dca0e5c4bb58b0c639219d4a4224f85fb2611
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2018-07-10 11:57:42 -04:00
70a1080f8e Revert "contrib/pjsip: add getifaddrs fallback on Android < 24"
This reverts commit 6c77382c63.

Reason for revert: causes crashes in some conditions

Change-Id: Ie6ce94a9893b08bcc553b67e043d6c6d7b38acfa
2018-07-06 21:41:18 -04:00