Enforce thread safety and improve immutability in CodecVendor
This change improves the thread safety of `CodecVendor` by adding a
sequence checker to ensure methods are invoked on the correct thread or
task queue. It also transitions audio codec members to be const,
preventing modification after initialization.
Key changes include:
* Fixed unit tests to configure the media engine or recreate
the vendor rather than mutating existing vendor instances.
This unblocks fixing const design problems in CodecVendor.
* Added `SequenceChecker` to `CodecVendor` and guarded usage of
video codec members.
* Made `audio_send_codecs_` and `audio_recv_codecs_` const,
initialized via a new helper function.
* Removed test-only setter methods (`set_audio_codecs`,
`set_video_codecs`) to enforce immutability.
* Updated `TypedCodecVendor` to require a valid media engine in
its non-default constructor and refactor the construction of
`codecs_`.
Bug: webrtc:360058654
Change-Id: Ia22a7384450b98f3adfac200f6bcebb9019fa5a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/426000
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46227}
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.