Deduplicate codecs matched by codec preferences

RtpTransceiver::SetCodecPreferences removes exact duplicates, so a codec
that is sent and received at different levels stays listed twice when an
application passes both its sender and its receiver capabilities.
MatchCodecPreference ignores levels when matching preferences against
supported codecs, which made both entries resolve to the same codec and
append its payload type (and any associated RTX codec) twice. Since
CodecVendor started finalizing offered and answered codec lists, the
duplicate payload type fails offer and answer creation.

Add matched codecs with CodecList::PushIfNotPresent in
MatchCodecPreference so that each codec and its associated RTX codec
appear at most once.

Fixed: chromium:585451900
Change-Id: I3354931ad9bfe0faab2418adac453e1088b7103b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/517180
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#49302}
2 files changed
tree: cd54e2013416619c104ca5213762d9e799e28118
  1. .agents/
  2. agents/
  3. api/
  4. audio/
  5. build_overrides/
  6. call/
  7. common_audio/
  8. common_video/
  9. data/
  10. docs/
  11. examples/
  12. experiments/
  13. g3doc/
  14. infra/
  15. knowledge_base/
  16. logging/
  17. media/
  18. modules/
  19. net/
  20. p2p/
  21. pc/
  22. resources/
  23. rtc_base/
  24. rtc_tools/
  25. rust/
  26. sdk/
  27. stats/
  28. system_wrappers/
  29. test/
  30. tools_webrtc/
  31. video/
  32. .clang-format
  33. .clang-tidy
  34. .git-blame-ignore-revs
  35. .gitignore
  36. .gn
  37. .mailmap
  38. .rustfmt.toml
  39. .style.mdformat
  40. .style.yapf
  41. .yapfignore
  42. AUTHORS
  43. BUILD.gn
  44. CODE_OF_CONDUCT.md
  45. codereview.settings
  46. DEPS
  47. DIR_METADATA
  48. ENG_REVIEW_OWNERS
  49. GEMINI.md
  50. LICENSE
  51. license_template.txt
  52. native-api.md
  53. OWNERS
  54. OWNERS_INFRA
  55. PATENTS
  56. PRESUBMIT.py
  57. presubmit_test.py
  58. presubmit_test_mocks.py
  59. pylintrc
  60. pylintrc_old_style
  61. README.chromium
  62. README.md
  63. unsafe_buffers_paths.txt
  64. vpython.toml
  65. vpython.toml.uv.lock
  66. WATCHLISTS
  67. webrtc.gni
  68. webrtc_lib_link_test.cc
  69. whitespace.txt
README.md

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.

Development

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.

More info