This is a reland of 809198edfff416fce8d75b574a43afab5e67b1cd A fix was made in https://webrtc-review.googlesource.com/c/src/+/154343 which fixed the regression issues caused by the original patch. 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} Bug: webrtc:10126 Change-Id: Iecc3ab6a5cd1193a1fa8e824dcf4f0b8165f9bf8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/154359 Commit-Queue: Evan Shrubsole <eshr@google.com> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29356}
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.