PSA: Android: Consolidating different initialize calls to PeerConnectionFactory.initialize

333 views
Skip to first unread message

Sami Kalliomäki

unread,
Oct 4, 2017, 7:01:43 AM10/4/17
to discuss-webrtc
Hi,

What?
We are introducing a new API that will combine all the previous different initialize calls. In the future, this API will also be responsible for loading the native library.

Right now, the native library is loaded in the static initializer of PeerConnectionFactory. Therefore, it is important that you ensure that you call PeerConnectionFactory.initialize before any other calls to WebRTC. Otherwise, your application will break when this static initializer is removed.

Why?
Consolidating the calls cleans up the interface and gives us better control over in which order the different components are initialized. The new builder pattern provides a clean way to add and deprecate new parameters to the initialize method.

What needs to be done?
Replace initializeAndroidGlobals, initializeFieldTrials and initializeInternalTracer calls with a single PeerConnectionFactory.initialize calls. Example can be seen here.

Sub-PSA: We removed functionality from WebRTC logging that loaded the native library on Logging.enableLogThreads, enableLogTimeStamps, enableTracing and enableLogToDebugOutput calls. This was legacy code and we didn't expect anyone to be using this functionality but it seems at least one application broke. If you are experiencing problems, ensure that you call PeerConnectionFactory.initialize before any of these calls or manually load the library.

Regards,
Sami Kalliomäki
Reply all
Reply to author
Forward
0 new messages