This reverts commit 117d847901ea231cd86ca152b359b88619b9de20. Reason for revert: Downstream error has been corrected. Original change's description: > Revert "Reland: Remove unsupported configuration value, `allow_codec_switching`" > > This reverts commit 23501a2aa656b94e26d4c67b8b9393258551560f. > > Reason for revert: Breaks downstream features > > Original change's description: > > Reland: Remove unsupported configuration value, `allow_codec_switching` > > > > This reverts commit 6b0c5babe0700f12493cf659e1b35c58d2327995. > > > > Reason for revert: Relanding once downstream issues have been addressed > > > > Original change's description: > > > Revert "Remove unsupported configuration value, `allow_codec_switching`" > > > > > > This reverts commit 8f7a17f80f43a47ce3801a3cfd2afda3575c8023. > > > > > > Reason for revert: breaks downstream > > > > > > Original change's description: > > > > Remove unsupported configuration value, `allow_codec_switching` > > > > > > > > Bug: webrtc:11341 > > > > Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459 > > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284 > > > > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > > > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > > > Cr-Commit-Position: refs/heads/main@{#40995} > > > > > > Bug: webrtc:11341 > > > Change-Id: I784fd95062fc71f8dcc139b05121985f60709004 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780 > > > Owners-Override: Philip Eliasson <philipel@webrtc.org> > > > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > > Cr-Commit-Position: refs/heads/main@{#40998} > > > > Bug: webrtc:11341 > > Change-Id: I3cb3e699fd76942c51f0f42a99bcb19ac607632e > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324782 > > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#41032} > > Bug: webrtc:11341 > Change-Id: I0eb8e6a464a8a51e6359caf8f43231dc275c4f20 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327382 > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#41161} Bug: webrtc:11341 Change-Id: I4a5390a3b8c5e665b742fc564709847ad8853ba9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328160 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#41213}
How to write code in the api/ directory
Mostly, just follow the regular style guide, but:
- Note that
api/code is not exempt from the “.hand.ccfiles come in pairs” rule, so if you declare something inapi/path/to/foo.h, it should be defined inapi/path/to/foo.cc. - Headers in
api/should, if possible, not#includeheaders outsideapi/. It’s not always possible to avoid this, but be aware that it adds to a small mountain of technical debt that we’re trying to shrink. .ccfiles inapi/, on the other hand, are free to#includeheaders outsideapi/.- Avoid structs in api, prefer classes.
The preferred way for api/ code to access non-api/ code is to call
it from a .cc file, so that users of our API headers won’t transitively
#include non-public headers.
For headers in api/ that need to refer to non-public types, forward
declarations are often a lesser evil than including non-public header files. The
usual rules still apply, though.
.cc files in api/ should preferably be kept reasonably small. If a
substantial implementation is needed, consider putting it with our non-public
code, and just call it from the api/ .cc file.
Avoid defining api with structs as it makes harder for the api to evolve. Your struct may gain invariant, or change how it represents data. Evolving struct from the api is particular challenging as it is designed to be used in other code bases and thus needs to be updated independetly from its usage. Class with accessors and setters makes such migration safer. See Google C++ style guide for more.
If you need to evolve existent struct in api, prefer first to convert it into a class.