First, i am unclear whether appropriate to reference links to other code, and if so apologies and would like to understand what a more appropriate mechanism might be for this case in which i am referencing libraries (these links are mainly provided as references to interested parties).
We have a webrtc native app for android which runs into difficulty when calling the dispose of the peerconnectionfactory. When the user selects to end an active session, we have a cleanup routine that closes the peer connection and then disposes of it (though the close is not really necessary as the call to the dispose also closes the connection before freeing other resources - e.g., such as the streams and the native observer - see libjingle - talk/app/webrtc/java/src/org/webrtc/PeerConnection.java ). In our case, the creation of the peerconnectionfactory is performed by a thread created via a runnable whereas the dispose of the factory is performed from the main UI thread.
This is where we run into problems - i.e., when trying to dispose of the peerconnectionfactory, the app crashes.
On review of posts related to the webRTC demo code (see https://chromium.googlesource.com/external/webrtc/+/master/webrtc/examples/androidapp/src/org/appspot/apprtc ) they do not appear to have this issues.
Additionally, when reviewing the native code for the peer connection factory implementation ( see peerconnectionfactory.cc in https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc/api/peerconnectionfactory.cc ) we see the unwrapping and deletion of the worker thread for the peer connection factory destructor.
Additionally, on review of the chromium webrtc issues list, we see several issues (e.g., https://bugs.chromium.org/p/webrtc/issues/detail?id=3100 or 4196) that lead one to believe that particular care needs to be taken relative to the threading / loop model to be used when using the peerconnectionfactory.
So, my basic question is whether there are issues when creating the peerconnectionfactory from a different thread than it is disposed by and whether there is a particular set of threading / looping requirements for managing the peerconnectionfactory.
thanks,