This reverts commit 809198edfff416fce8d75b574a43afab5e67b1cd. Reason for revert: Performance regressions that need to be addressed. Original change's description: > Fix minor regression caused by a8336d3 > > VideoEncoder::SetRates was being called unnessesarily when the fields > appended to RateControlParameters were changed. Since SetRates only > cares about RateControlParameters, it should have only been called if > the RateControlParameters themselves were actually changed. > > Bug: webrtc:10126 > Change-Id: Ic47d67e642a3043307fec950e5fba970d9f95167 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152829 > Reviewed-by: Erik Språng <sprang@webrtc.org> > Commit-Queue: Evan Shrubsole <eshr@google.com> > Cr-Commit-Position: refs/heads/master@{#29208} TBR=sprang@webrtc.org,eshr@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:10126 Change-Id: I133cbe5d8cb894ed944ae8a2d0f63a78bbed72ee Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153484 Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29221}
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/.
That is, 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.