commit | d2254677af3346db4c7a019df444f0e48e9c8b5d | [log] [tgz] |
---|---|---|
author | Tommi <tommi@webrtc.org> | Sat Sep 27 08:02:41 2025 |
committer | WebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Sep 30 08:12:22 2025 |
tree | 3e9dd6d88736d08ec2ab308a3646fa7593c1644e | |
parent | d4871e2ca1dc0650acbf9adcf50ec7000c6c462c [diff] |
Move media engine teardown logic to a new Terminate() method This fixes a need for a recent addition of a blocking invoke in the destructor of ConnectionContext, and also removes the blocking invoke that's been a part of the construction of ConnectionContext for a while. Add Terminate() methods to MediaEngineInterface and VoiceEngineInterface as a symmetric counterpart to the existing Init() method. This follows the existing naming convention in the media code (see e.g. AudioInput, AudioOutput, AudioDeviceGeneric) and is not related to an ongoing conversation about introducing blocking Terminate calls elsewhere in the codebase. This new method is responsible for tearing down active processing that was started by Init(). All blocking shutdown logic (e.g., stopping audio devices) is moved from the WebRtcVoiceEngine destructor into Terminate(). The media engine's lifecycle is, as before, managed by ConnectionContext but active processing is now additionally controlled through usage a reference counting mechanism. ConnectionContext calls Init() when the first media engine usage is registered and Terminate() when the last usage is unregistered. This change removes blocking calls from the ConnectionContext constructor and destructor, simplifying shutdown and resolving potential threading issues. A call to Init() must now always be matched by a corresponding call to Terminate(). Bug: webrtc:42224720 Change-Id: I83e6922a9d082ee67a4d3b08b110259e88f602d9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/410860 Reviewed-by: Per Kjellander <perkj@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45773}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See here for instructions on how to get started developing with the native code.
Authoritative list of directories that contain the native API header files.