Fix circular dependencies in webrtc_common.

One reason for the circular deps is that common_types.h is a
historical dumping ground for various structs and defines that
are believed to be generally useful. I tried moving things out
that did not appear to be used downstream (StreamCounters,
RtpCounters etc) and moved the things that seemed used
(RtpHeader + supporting structs) to a new file api/rtp_headers.h.
This makes their place in the api more clear while moving out
the things that don't belong in the API in the first place.

I had to extract out typedefs.h from webrtc_common to resolve
another circular dependency. I believe checks includes typedefs,
but common depends on checks.

Bug: webrtc:7745
Change-Id: I725d49616b1ec0cdc8b74be7c078f7a4d46f084b
Reviewed-on: https://webrtc-review.googlesource.com/33001
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21295}
diff --git a/modules/audio_coding/BUILD.gn b/modules/audio_coding/BUILD.gn
index 9c674d4..6365d56 100644
--- a/modules/audio_coding/BUILD.gn
+++ b/modules/audio_coding/BUILD.gn
@@ -65,6 +65,7 @@
     "acm2/rent_a_codec.h",
   ]
   deps = [
+           "../../:typedefs",
            "../../rtc_base:checks",
            "../../api:array_view",
            "../../api:optional",
@@ -96,6 +97,7 @@
   deps = [
     "..:module_api",
     "../..:webrtc_common",
+    "../../:typedefs",
   ]
 }
 
@@ -132,6 +134,8 @@
   }
 
   deps = audio_coding_deps + [
+           "../../rtc_base:deprecation",
+           "../../:typedefs",
            "../../rtc_base:checks",
            "../../system_wrappers:metrics_api",
            "..:module_api",
@@ -177,6 +181,7 @@
 
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../api:array_view",
     "../../api/audio_codecs:audio_codecs_api",
     "../../common_audio",
@@ -241,6 +246,7 @@
   ]
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
   ]
 }
 
@@ -282,6 +288,7 @@
   ]
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
   ]
 }
 
@@ -461,6 +468,7 @@
 
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../api/audio_codecs:audio_codecs_api",
     "../../common_audio",
     "../../rtc_base:checks",
@@ -569,6 +577,7 @@
   deps = [
     ":isac_common",
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../common_audio",
     "../../rtc_base:checks",
     "../../rtc_base:compile_assert_c",
@@ -675,6 +684,7 @@
   deps = [
     ":isac_common",
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../api/audio_codecs:audio_codecs_api",
     "../../common_audio",
     "../../rtc_base:checks",
@@ -799,6 +809,7 @@
   public_configs = [ ":pcm16b_config" ]
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
   ]
 }
 
@@ -856,6 +867,7 @@
 
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
   ]
@@ -1042,6 +1054,8 @@
     ":neteq_decoder_enum",
     "..:module_api",
     "../..:webrtc_common",
+    "../../:typedefs",
+    "../../api:libjingle_peerconnection_api",
     "../../api:optional",
     "../../api/audio_codecs:audio_codecs_api",
     "../../common_audio",
@@ -1084,6 +1098,8 @@
     ":neteq",
     "..:module_api",
     "../..:webrtc_common",
+    "../../:typedefs",
+    "../../api:libjingle_peerconnection_api",
     "../../api:optional",
     "../../api/audio_codecs:audio_codecs_api",
     "../../api/audio_codecs:builtin_audio_decoder_factory",
@@ -1121,7 +1137,9 @@
     ":pcm16b",
     "..:module_api",
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../api:array_view",
+    "../../api:libjingle_peerconnection_api",
     "../../common_audio",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
@@ -1169,6 +1187,7 @@
 
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../api:array_view",
     "../../api:optional",
     "../../api/audio_codecs:audio_codecs_api",
@@ -1195,6 +1214,7 @@
 
   deps = [
     "../..:webrtc_common",
+    "../../:typedefs",
     "../../common_audio",
     "../../rtc_base:checks",
     "../../rtc_base:rtc_base_approved",
@@ -1308,6 +1328,7 @@
       ":pcm16b_c",
       "..:module_api",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../api:optional",
       "../../api/audio_codecs:builtin_audio_decoder_factory",
       "../../rtc_base:rtc_base_approved",
@@ -1339,6 +1360,7 @@
       ":neteq_test_support",
       ":neteq_test_tools",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../api/audio_codecs/opus:audio_encoder_opus",
       "../../rtc_base:protobuf_utils",
       "../../rtc_base:rtc_base_approved",
@@ -1411,6 +1433,7 @@
       ":audio_coding_module_typedefs",
       ":audio_format_conversion",
       "..:module_api",
+      "../../:typedefs",
       "../../:webrtc_common",
       "../../api:optional",
       "../../rtc_base:rtc_base_approved",
@@ -1441,6 +1464,7 @@
       ":audio_coding",
       ":audio_format_conversion",
       "..:module_api",
+      "../../:typedefs",
       "../../:webrtc_common",
       "../../api:optional",
       "../../rtc_base:rtc_base_approved",
@@ -1519,6 +1543,7 @@
       defines = []
       deps = [
         "..:module_api",
+        "../../:typedefs",
         "../../rtc_base:checks",
       ]
       sources = [
@@ -1567,7 +1592,9 @@
   rtc_test("audio_codec_speed_tests") {
     testonly = true
     defines = []
-    deps = []
+    deps = [
+      "../../:typedefs",
+    ]
     sources = [
       "codecs/isac/fix/test/isac_speed_test.cc",
       "codecs/opus/opus_speed_test.cc",
@@ -1626,6 +1653,7 @@
       ":pcm16b",
       "..:module_api",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../api/audio_codecs:audio_codecs_api",
       "../../api/audio_codecs:builtin_audio_decoder_factory",
       "../../rtc_base:checks",
@@ -1653,6 +1681,7 @@
       ":neteq_test_tools",
       "..:module_api",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../api/audio_codecs:builtin_audio_decoder_factory",
       "../../rtc_base:checks",
       "../../rtc_base:rtc_base_approved",
@@ -1665,6 +1694,7 @@
     testonly = true
 
     deps = audio_coding_deps + [
+             "../../:typedefs",
              ":audio_coding",
              ":neteq_input_audio_tools",
              "../../api/audio_codecs/g711:audio_encoder_g711",
@@ -1688,6 +1718,7 @@
     testonly = true
 
     deps = audio_coding_deps + [
+             "../../:typedefs",
              "../../system_wrappers:system_wrappers_default",
              "../rtp_rtcp:rtp_rtcp_format",
              "../../api:array_view",
@@ -1768,6 +1799,7 @@
       ":neteq",
       ":neteq_test_support",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../rtc_base:rtc_base_approved",
       "../../system_wrappers:system_wrappers_default",
       "../../test:test_support",
@@ -1915,6 +1947,7 @@
     deps = [
       ":g722",
       "../..:webrtc_common",
+      "../../:typedefs",
     ]
   }
 
@@ -2098,6 +2131,7 @@
       ":webrtc_opus",
       "..:module_api",
       "../..:webrtc_common",
+      "../../:typedefs",
       "../../api/audio_codecs:audio_codecs_api",
       "../../api/audio_codecs:builtin_audio_decoder_factory",
       "../../api/audio_codecs:builtin_audio_encoder_factory",