style: add clang-format config and reformat scaffolding files

This commit is contained in:
2026-09-07 10:07:26 +02:00
parent 975e3b2974
commit 50369995c7
12 changed files with 100 additions and 64 deletions
+6 -6
View File
@@ -6,14 +6,14 @@ namespace sc {
// RTP clock rate for video is 90 kHz. Convert a monotonic nanosecond timestamp
// into a 32-bit RTP timestamp. Overflows wrap around intentionally.
constexpr uint32_t rtp_timestamp_from_ns ( uint64_t nanoseconds ) noexcept {
constexpr uint32_t rtp_timestamp_from_ns(uint64_t nanoseconds) noexcept {
// (nanoseconds * 90_000) / 1_000_000_000
// Simplify: 90_000 / 1_000_000_000 = 9 / 100_000
return static_cast<uint32_t> ( ( nanoseconds * 9ULL ) / 100'000ULL );
return static_cast<uint32_t>((nanoseconds * 9ULL) / 100'000ULL);
}
static_assert ( rtp_timestamp_from_ns ( 0 ) == 0 );
static_assert ( rtp_timestamp_from_ns ( 1'000'000'000ULL ) == 90'000 );
static_assert ( rtp_timestamp_from_ns ( 500'000'000ULL ) == 45'000 );
static_assert(rtp_timestamp_from_ns(0) == 0);
static_assert(rtp_timestamp_from_ns(1'000'000'000ULL) == 90'000);
static_assert(rtp_timestamp_from_ns(500'000'000ULL) == 45'000);
} // namespace sc
} // namespace sc