Move timestamp_aligner out of rtc_base_approved

Bug: webrtc:9838
Change-Id: I4ea34fd161e321f6506f300abfd27c4be6d785d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258766
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36580}
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 20a864d..1073d81 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -95,6 +95,7 @@
     ":safe_conversions",
     ":stringutils",
     ":strong_alias",
+    ":timestamp_aligner",
     ":timeutils",
     ":type_traits",
     "../api:array_view",
@@ -143,8 +144,7 @@
     "rate_tracker.h",
     "strong_alias.h",  # Transitional, use :strong_alias
     "swap_queue.h",
-    "timestamp_aligner.cc",
-    "timestamp_aligner.h",
+    "timestamp_aligner.h",  # Transitional, use :timestamp_aligner
     "trace_event.h",
     "zero_memory.cc",
     "zero_memory.h",
@@ -180,6 +180,12 @@
   if (is_android) {
     libs = [ "log" ]
   }
+
+  if (build_with_chromium) {
+    # Remove when the dependency has been propagated to Chromium
+    public_deps +=  # no-presubmit-check TODO(webrtc:8603)
+        [ ":timestamp_aligner" ]
+  }
 }
 
 rtc_source_set("one_time_event") {
@@ -223,6 +229,20 @@
   ]
 }
 
+rtc_library("timestamp_aligner") {
+  visibility = [ "*" ]
+  sources = [
+    "timestamp_aligner.cc",
+    "timestamp_aligner.h",
+  ]
+  deps = [
+    ":checks",
+    ":logging",
+    ":timeutils",
+    "system:rtc_export",
+  ]
+}
+
 rtc_library("platform_thread_types") {
   sources = [
     "platform_thread_types.cc",
@@ -1473,6 +1493,7 @@
         ":strong_alias",
         ":testclient",
         ":threading",
+        ":timestamp_aligner",
         ":timeutils",
         "../api:array_view",
         "../api:scoped_refptr",