This reverts commit 56db8d09529d5ba92d24954a1d78a90c8ea2cd85. Reason for revert: downstream problem addressed Original change's description: > Revert "Represent RtpPacketToSend::capture_time with Timestamp" > > This reverts commit 385eb9714daa80306d2f92d36678c42892dab555. > > Reason for revert: Causes problems downstream: > > # > # Fatal error in: rtc_base/units/unit_base.h, line 122 > # last system error: 0 > # Check failed: value >= 0 (-234 vs. 0) > > Original change's description: > > Represent RtpPacketToSend::capture_time with Timestamp > > > > Bug: webrtc:13757 > > Change-Id: I0ede22cd34e3a59afe1477d8edd495dce64e3242 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252586 > > Reviewed-by: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> > > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#36083} > > Bug: webrtc:13757 > Change-Id: I8442abd438be8726cf671d0f372d50ecfac6847e > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252720 > Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org> > 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@{#36087} Bug: webrtc:13757 Change-Id: I1fa852757480116f35deb2b6c3c27800bdf5e197 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252781 Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36093}
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.