Rename PlayoutDelay --> VideoPlayoutDelay, move to api/video/video_timing.h

We can then finally delete the top-level common_types.h, and the
corresponding build target webrtc_common.

Bug: webrtc:7660
Change-Id: I1c1096541477586d90774c7a3405b9d36edec14a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182800
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32044}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 50a9c5a..c257a7d 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -68,7 +68,6 @@
   ]
   deps = [
     ":array_view",
-    "..:webrtc_common",
     "units:timestamp",
     "video:video_rtp_headers",
   ]
diff --git a/api/rtp_headers.h b/api/rtp_headers.h
index 454149c..b9a97c8 100644
--- a/api/rtp_headers.h
+++ b/api/rtp_headers.h
@@ -23,7 +23,6 @@
 #include "api/video/video_content_type.h"
 #include "api/video/video_rotation.h"
 #include "api/video/video_timing.h"
-#include "common_types.h"  // NOLINT (build/include)
 
 namespace webrtc {
 
@@ -142,7 +141,7 @@
   bool has_video_timing;
   VideoSendTiming video_timing;
 
-  PlayoutDelay playout_delay = {-1, -1};
+  VideoPlayoutDelay playout_delay;
 
   // For identification of a stream when ssrc is not signaled. See
   // https://tools.ietf.org/html/draft-ietf-avtext-rid-09
diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn
index e864e03..b85c2b6 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -135,7 +135,6 @@
     "..:refcountedbase",
     "..:rtp_packet_info",
     "..:scoped_refptr",
-    "../..:webrtc_common",
     "../../rtc_base:checks",
     "../../rtc_base:deprecation",
     "../../rtc_base:rtc_base_approved",
diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h
index 35c2584..cb0f2eb 100644
--- a/api/video/encoded_image.h
+++ b/api/video/encoded_image.h
@@ -25,7 +25,6 @@
 #include "api/video/video_frame_type.h"
 #include "api/video/video_rotation.h"
 #include "api/video/video_timing.h"
-#include "common_types.h"  // NOLINT(build/include_directory)
 #include "rtc_base/checks.h"
 #include "rtc_base/deprecation.h"
 #include "rtc_base/ref_count.h"
@@ -183,7 +182,7 @@
   // When an application indicates non-zero values here, it is taken as an
   // indication that all future frames will be constrained with those limits
   // until the application indicates a change again.
-  PlayoutDelay playout_delay_ = {-1, -1};
+  VideoPlayoutDelay playout_delay_;
 
   struct Timing {
     uint8_t flags = VideoSendTiming::kInvalid;
diff --git a/api/video/video_timing.h b/api/video/video_timing.h
index 4cc75dd..fbd9225 100644
--- a/api/video/video_timing.h
+++ b/api/video/video_timing.h
@@ -100,6 +100,30 @@
   uint8_t flags;  // Flags indicating validity and/or why tracing was triggered.
 };
 
+// Minimum and maximum playout delay values from capture to render.
+// These are best effort values.
+//
+// A value < 0 indicates no change from previous valid value.
+//
+// min = max = 0 indicates that the receiver should try and render
+// frame as soon as possible.
+//
+// min = x, max = y indicates that the receiver is free to adapt
+// in the range (x, y) based on network jitter.
+struct VideoPlayoutDelay {
+  VideoPlayoutDelay() = default;
+  VideoPlayoutDelay(int min_ms, int max_ms) : min_ms(min_ms), max_ms(max_ms) {}
+  int min_ms = -1;
+  int max_ms = -1;
+
+  bool operator==(const VideoPlayoutDelay& rhs) const {
+    return min_ms == rhs.min_ms && max_ms == rhs.max_ms;
+  }
+};
+
+// TODO(bugs.webrtc.org/7660): Old name, delete after downstream use is updated.
+using PlayoutDelay = VideoPlayoutDelay;
+
 }  // namespace webrtc
 
 #endif  // API_VIDEO_VIDEO_TIMING_H_