Commit Graph

13016 Commits

Author SHA1 Message Date
bf105816ca Small cleanup of the ring-daemon introductory material
* CODING: Update wiki URLs and refresh content.
* ChangeLog: Fix typo.
* README: Likewise, and use HTTPS for URLs.
* doc/README: Rephrase.
* man/README.manpages: Fix typo.

Change-Id: I9d320ae2e5bdfacc84293001f08abb442da35fb5
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2018-01-09 13:04:30 -05:00
e6c7666a65 datatransfer: add bytes progress DBus API
Add ConfigurationManager::dataTransferBytesSent() DBus method access.

Change-Id: I74fc22f42faeb5c352059831150b6c8b7e813fd8
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-09 11:22:21 -05:00
25fcfd5b7c datatransfer: fix deadlock
Mutex deadlock occuring during file transfer creation.
Exchanging some calls to fix the situation.

Change-Id: I2f0108e63e89a13e3f6f2c1b1e096fbf9a6a1290
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-08 16:21:57 -05:00
4dee3af556 fix undefined constexpr symbols on osx
static constexpr in class/struct need to be redeclared in namespace
scope until C++17 (at which point it will be deprecated).

Change-Id: I27f0448edd65f9d7d51ad5eb7263c76d17563072
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-08 11:37:36 -05:00
39a42c701b dataxfer: fix DBus XML definition
add annotation type to fix Qt usage for the custom-type
added by the DBus dataTransferInfo method.

Change-Id: I62b8d13171d25c73850c6120a1e5fec8fda07e72
Reviewed-by: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
2018-01-05 15:26:43 -04:00
49c4bb186e fix for doxygen documentation
Doxygen keywords must be backslashed, not slashed.

Change-Id: I625e1241981c46da2d5a17da4daf4b9a571f3a35
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-05 10:22:52 -05:00
755347dd6b data transfer: first implementation
First implementation of Reliable Data Transfer feature in Ring.

This implementation is a draft, comes with a Python script
tools/dringctrl/sendfile.py to play with and doesn't
implement all the API as described into "datatransfer: API proposal"
commit.
This version uses TLS over TCP-TURN sockets to encrypt data.

Transfers require a TURN server with TCP peer connections
as described by the RFC-6062.

Testing: Currently only sendFile API is implemented and data are
saved into a temporary file saved in "/tmp/ring_XXXXXX",
where XXXXXX are replace by mkstemp() command.

Change-Id: I5b8f48432edd58df5046e368a99f58ea44046dcd
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-05 11:18:35 -04:00
bdafdfb43d make TlsSession great again
Or at least independant of underlaying transport...

To make TlsSession able to handle both TLS and DTLS
this patch removes the ICE dependency and replace is
by the generic network ABC class 'GenericTransport'.
As a first step this class is declared in tls_session.h.
Side effects of this change are:

* refactoring of PMTUD procedure: 'MTU' for gnutls has the meaning
  on 'payload-for-gnutls' so this information is now drived by
  the generic transport and not hardcoded anymore.
  The minimal value of probing remains hardcoded, as is a minimum
  given by RFC's documentation and it's based on an IPv4 packet
  associated with UDP protocol.

* getMtu() is now maxPayload() and represent correctly what
  the application must have.

* TlsSession implements itself GenericTransport: we can chain
  GenericTransport instances to construct an overlayed transport
  protocol.

* TlsSession is now considered as non thread-safe for its public API.
  Caller must bring itself this property.
  This permit to remove a redundant mutex in send() operation.
  Note: and it's the case in the only user (SipsIceTransport),
  that why the mutex is redundant in 100% of cases.

Notice the benefit of this genericity refactoring let us
write a unit-test for this TlsSession class without having
an heavy ICE transport to mock-up.

Also ICE transport gained of this by adding a new IceSocketTransport
to replace IceSocket in a near future (need async IO in GenericSocket,
but not required for the moment).

Change-Id: I6f4591ed6c76fa9cb5519c6e9296f8fc3a6798aa
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2018-01-03 17:59:09 -04:00
2dee5360da android: Move jni to daemon
Move all JNI file sources to the daemon. Ring Android client will use
this files to generate the final libring.so including the
ring_wrapper.cpp

Change-Id: I4e800bb1d33b5905c715054d1718c0bdb3fc1d55
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2018-01-03 09:19:06 -05:00
cb1ba72f82 fixup for sip_utils
fix for patch:
0f5248018d PJSIP support to std::error_code and std::system_error

pj_strerror crashes on due to wrong given string size.

Change-Id: I8d68b885ce0d587b27e8b361c9ad60019ed355fb
2018-01-02 16:25:49 -05:00
0f5248018d PJSIP support to std::error_code and std::system_error
Some practical C++ additions:
* class PjsipErrorCategory as error category for std::error_code.
* class PjsipFailure inheriting from std::system_error exception.

Change-Id: I957cd36d06cf49ae98cb6634f5e4d5dcac666be8
2018-01-02 10:23:34 -05:00
94a48eb994 fix build on debian testing
Debian Testing doesn't use the contribs, so bump down the FFmpeg
requirements in the configure.ac as well as making RING_ACCEL dependant
on a certain version of libavutil.

Reviewed-by: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
Change-Id: I1f9d0de44e5f9d0bbb69b20d73a396de7e5d64b4
2017-12-30 21:22:42 -04:00
7bc5d593e4 fix crash during incoming call
fix nullptr access during incoming call on ringaccount
due to a missplaced method call.

Change-Id: Ia226d9d8e53ae8143b42d9b08814b5448c8be95d
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2017-12-28 17:49:39 -05:00
ea8c592136 accel: refactor to fit new hwaccel api
libavutil now covers the simple cases for creating and managing devices.
As Ring does not need to fine-tune these processes, most of the accel
code can be and has been removed.

Most hardware decoders output NV12, so skip extra conversions by
outputting NV12. Said pixel format is supported by everything that isn't
excessively old.

Change-Id: I10c440026fc3b289dbba7ecbca47e55c57147207
Reviewed-by: Anthony Léonard <anthony.leonard@savoirfairelinux.com>
2017-12-28 17:21:12 -04:00
64322318dc osx: bump ffmpeg
Bumps FFmpeg to match the other platforms. Modifies the acceleration
code to work under the new API.

Enables bitstream filters, as some of libavcodec's components, such as
VideoToolbox, use them.

Change-Id: I3a6cee2cf06881bba4602c0ed635ff45908e7b85
Reviewed-by: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
2017-12-21 18:18:00 -04:00
5f042df9a2 fix IP2IP account signal at creation
When IP2IP account is created only AccountsChanged signal is emited.
But doRegister() method is called and this kind of account must succeed
on such (as there is no registration) and must call
setRegistrationState(RegistrationState::REGISTERED) to make aware the client
on this event.
This was not done. This patch adds this call.

Change-Id: Ic5b8a31d9e2b98dd96ed394247f77bbfa3d8cdde
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
2017-12-20 19:18:06 -04:00
6fa37b57c1 contrib: recursive dependency tracking
Let's say we're building gnutls (since the system version is too new).
gnutls depends on nettle.
Let's say we're using the system nettle (naturally in FOUND_PKGS).
nettle depends on gmp.

With the old (non-recursive) dependency tracking, we would end up building
gmp just for nettle, even though we aren't even building nettle!

Change-Id: I24e6f59416839ea202e0aceafe101432fe9c2646
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-19 15:41:16 -05:00
25f7464d36 fix little error in previous commit
fix commit 8a708851da
inverted comparaison.

Change-Id: Id7ed10fdd50b82537acc317fb17e0a7e8aebc293
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2017-12-18 18:13:25 -04:00
8a708851da fix account type checkings
Account::getAccountType() returns a raw pointer on char,
but we use it with simple operators like == or != to check
the semantic behind. This results to pointer comparaison
and not "string" comparaison, causing many bugs.

Fixed by changing the comparaison operators by "strcmp" function.

Change-Id: I74baba083af0159d445c1505ddd5df55e6ca4fa7
Tuleap: #1575
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2017-12-18 16:24:18 -05:00
f8a7074051 debug: add few debug line/helpers
make dev life easier during debugging steps.

Change-Id: I762763436b4aa0800da6d926230c011649a44e88
Tuleap: #1575
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2017-12-18 17:12:02 -04:00
d08826f038 encoder: use max 16 threads for video, 4 for audio
Audio encoding is usually mono-threaded and doesn't require
as much CPU as video encoding. Limit to 4 threads since more
would not be useful and might introduce latency and decrease performance.

Video encoding takes significantly more resources, however for live encoding,
using more than 16 threads might introduce unreasonable latency.
Since new customer CPUs (AMD Ryzen and Intel Core i7/i9) now have
more than 16 logical cores, setting a higher bound of 16 threads.

Change-Id: I5dc2d3f51019c563b8cec3fbddffa13cbafdb9a5
2017-12-13 16:12:25 +01:00
15f8fb84c4 incoming call, getCallDetails inform about AUDIO_ONLY
make public Call::setEarlyDetails and change its name
for Call::updateDetails().
This permits to change details at creation AND after
as in the case of RingAccount where we don't have
details when the call is created.

Change-Id: I145624f93358990ed36d027bdb47bd4e498b1770
Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-12 16:57:04 -05:00
ba9f49b046 build: fix secp256k1 arm64 build
- Adds CFLAGS to make command for secp256k1 build when building for
  iPhoneOS(arm64) as the configure script ignores the SDK parameter

Change-Id: Id57933d8776e7c348a0c37bae508fe61161e4151
2017-12-08 14:18:01 -05:00
0d7545cb03 build(UWP): add diffie-helman files to project
- Updates the vs2015 project files
- Adds ciso646 header to diffie-hellman.cpp for logical operator
  compatibility with the Microsoft compiler

Change-Id: Ie858e054bf26cf839bef6eace79fa546894a7963
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-07 15:29:21 -04:00
50d2dfc4eb fix ios build
<thread> std include was missing to build on ios.

Change-Id: I8da9dd25e41d67ca3fa7343e487e2b0a94d93843
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
2017-12-06 12:48:32 -04:00
255fd16ada CallManager: Remove unused parameter
Change-Id: I75106210a5db977d57cc2e3921e28e8bf30e9af7
2017-12-05 23:29:23 -05:00
56fc9a99db use new jsoncpp API
Use latest jsoncpp API to remove deprecation warning.

Change-Id: Id599e1e30cf201f4027ee10fa4229f14b93264e6
Reviewed-by: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
2017-12-05 23:27:21 -05:00
b768f518f2 ice: refactor using pimpl idiom
Continue the compilation firewall work.
Also update code to use C++14 features.

Rationale: prepare the change to a new transport
abstraction over the project.

Change-Id: I4d387bea8447f5dc251a6bd64ecb63b234bd1cdf
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-12-05 16:55:22 -05:00
73c20f633b header dependency cleanup
Remove high dependencies on OpenDHT includes inside Ring internal
header files.
This reduces compile time by not recompiling the whole project
for any changes into opendht.

Change-Id: Iba852e0b889e67ee12b3a9747e6d04de23572c2e
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-12-05 14:47:59 -05:00
598caf5170 fix: conditionals for audio-only
Change-Id: Ic2796d22258e37ad531aec4e638196915e35969e
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-04 18:23:38 -04:00
f8f13c8e64 test: add string_utils unit-tests
[GR: adapt for coding-rules]
[GR: fix bool_to_str_test and split_string_test]

Change-Id: Iee1b767e57697d19eab8105697dbfa5cc1ec943e
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-04 15:44:13 -05:00
dd98c5dd27 call: gives the possibility to make an audio-only call
Use the new placeCall with details API and add a new AUDIO_ONLY
call details to let the possibility to make an audio-only call.

Change-Id: I6ff0032a2b315b6ef5f32677d72ca8d37ef7077b
Reviewed-by: Nicolas Jäger <nicolas.jager@savoirfairelinux.com>
2017-12-04 14:02:20 -04:00
c8c0c7e2a7 new placeCall API, bump daemon API to 4.1.0
Add a new placeCall API with possibility to gives call details.
This permits to give information like media preferences before
to start the call.

This changes force a daemon API bump to 4.1.0

Change-Id: I95d3b5480e194ece4a3cdb03436b2e1625eae016
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-12-04 11:21:21 -05:00
64d25ed8d3 extra/tools: autmake bump to 1.15.1
1.15 doesn't build at all!

Change-Id: I40b2cdaf5a99adf6556749de7348b090a68a549a
2017-12-04 10:02:14 -05:00
54fbaba633 ice: remove unused API
Remove IceTransport::getNextPacketSize() API and IceSocket one.
Unused and on-going to be deprecated API.

Change-Id: I6cdf72e81838411060e3cae636b156f309200e14
Reviewed-by: Nicolas Jäger <nicolas.jager@savoirfairelinux.com>
2017-12-01 11:30:03 -05:00
a922c9f1da video: increase max quality for h264
Recent CPUs should be able to encode higher quality h264 in real-time
without any problems.

Allows users to encode h264 with higher quality if they so choose.

Change-Id: Ibbb01cbc55e20f497f99f56c6c0e6616ff0734bc
2017-12-01 08:30:58 -05:00
dffa312b2e media: don't set AVCodecContext->refcounted_frames
This attribute was useful with the old decoding API. Refcounted frames
are always used with the avcodec_send_packet/avcodec_receive_frame API.

Change-Id: I0904ed8731c329e0f8f3d59d1872bff6a26543be
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-30 14:54:57 -05:00
5e3a394adc video_input: fallback to software decoding
Handles RestartRequired return code on hardware acceleration failure.

Change-Id: I170928e23ed607c2255e20729a71adc1364bbb6a
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-29 10:43:28 -05:00
664ea5fa51 video: fix keyframe request
Fixes a regression where keyframe requests were sent by the wrong peer.

Corrects artifacts in a shorter amount of time.

Change-Id: I2b981b46c07422a4289f378e2a5deaaba0047a3b
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-29 10:01:18 -05:00
53b5469773 win32: add rsync install in Dockerfile
This tool is needed during build when using make-ring.py script from
ring-project repo. It was included as base tool in previous Fedora 25
docker image but not anymore in Fedora 27.

Change-Id: I11833a5eb3cd3b7a0bcb705d4a136f349035dd45
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-11-29 10:47:06 -04:00
6340983f07 pj_ice_sess.patch: add description
Change-Id: I5c8320077b2697b7e3ed69ef432a5547e8780a1d
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-28 18:37:28 -05:00
465d368e18 ice_config.patch: add patch description
Change-Id: Iaf40ae5403ec29944e7f82628e0faeb74ef124b9
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-28 18:36:04 -05:00
1bf8957c36 tls: remove an uneeded and annoying debug line
Change-Id: I0913251c29f7d4a8c020c46f27216ce4a7753040
Reviewed-by: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
2017-11-28 15:57:27 -04:00
f961c32203 win32: update Fedora version for mingw build
Version is changed from 25 to 27 as the former one is entering EOL
soon.

Change-Id: I38eb0c687101a45ecd24531694e41118295c5fd1
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-28 14:30:12 -05:00
38155c0880 encoder: update FF_MIN_BUFFER_SIZE ffmpeg macro
AV_INPUT_BUFFER_MIN_SIZE is the new name for FF_MIN_BUFFER_SIZE, which is
not available anymore in new releases.

Change-Id: I79abb3a8192d8572323f705eecc44edc974026f8
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
2017-11-28 13:01:29 -05:00
c2c6ddc002 decoder: limit number of threads
Using too many threads for decoding is not recommended and can
introduce latency.
Also during a call there are 2 live encoding and 2 live decoding,
so using all threads for every decoding is not useful and could
decrease performance and increase latency because of more
CPU context switch.
This is especially visible on machines with many logical cores
like AMD Threadrippers or some Intel CPUs.
Ideally, loads should use in total as many threads as logical cores
to profit from the full machine power while limiting context switches.

In this patch, decoders will use half the number of logical core,
with a maximum of 8 threads.

Change-Id: Ibe6c083c35fba972d930346629de2175625afd8c
Reviewed-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
2017-11-28 12:55:29 -04:00
e18892fbd9 contrib: bump opendht to 1.5.0
* fix reported address issue
* fix SockAddr endianness issue
* fix memory leak
* minor performance improvements
* InfoHash: add operator bool()

Change-Id: I47ca3dedc1b96aa8082183eaf23fb9efc092b97a
2017-11-28 06:53:29 -05:00
950ce8f142 video: request keyframe on missed packet
Keyframes will only be sent on request instead of a timely interval.
This may interfere with clients that do not yet have this patch.

Change-Id: Ie786160744257052ef9d103d50fe46cd90138927
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-11-27 16:18:37 -04:00
d7f61d316f channel: fix stream push operator
Fix definition of Channel::operator <<
Was not correctly defined to be perfect-forwarding template.

Change-Id: If6b6a97a1d627ff9908a38bb2958bbb236b1e4f0
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-11-24 17:26:29 -04:00
a0e3381bc2 datatransfer: API proposal
This is a DRing API proposal (no implementation) to the data transfer
feature.

Change-Id: I3dd270ae910540b5aef1f3c15dc1b7b2966156c0
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
2017-11-22 14:40:51 -05:00