Extract corruption detection message to its own target

Bug: webrtc:358039777
Change-Id: I6bc064aaba4c5b7f9b55215414e70e55eb0e0f64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361864
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42977}
diff --git a/common_video/BUILD.gn b/common_video/BUILD.gn
index 54c346e..6b42a37 100644
--- a/common_video/BUILD.gn
+++ b/common_video/BUILD.gn
@@ -8,6 +8,14 @@
 
 import("../webrtc.gni")
 
+rtc_library("corruption_detection_message") {
+  sources = [ "corruption_detection_message.h" ]
+  deps = [
+    "../api:array_view",
+    "//third_party/abseil-cpp/absl/container:inlined_vector",
+  ]
+}
+
 rtc_library("frame_instrumentation_data") {
   sources = [ "frame_instrumentation_data.h" ]
 }
@@ -17,7 +25,6 @@
 
   sources = [
     "bitrate_adjuster.cc",
-    "corruption_detection_message.h",
     "frame_rate_estimator.cc",
     "frame_rate_estimator.h",
     "framerate_controller.cc",
@@ -60,7 +67,6 @@
   }
 
   deps = [
-    ":frame_instrumentation_data",
     "../api:array_view",
     "../api:make_ref_counted",
     "../api:scoped_refptr",
@@ -91,7 +97,6 @@
     "../rtc_base/synchronization:mutex",
     "../rtc_base/system:rtc_export",
     "../system_wrappers:metrics",
-    "//third_party/abseil-cpp/absl/container:inlined_vector",
     "//third_party/abseil-cpp/absl/numeric:bits",
     "//third_party/libyuv",
   ]
@@ -120,12 +125,20 @@
     }
   }
 
+  rtc_library("corruption_detection_message_unittest") {
+    testonly = true
+    sources = [ "corruption_detection_message_unittest.cc" ]
+    deps = [
+      ":corruption_detection_message",
+      "../test:test_support",
+    ]
+  }
+
   rtc_test("common_video_unittests") {
     testonly = true
 
     sources = [
       "bitrate_adjuster_unittest.cc",
-      "corruption_detection_message_unittest.cc",
       "frame_rate_estimator_unittest.cc",
       "framerate_controller_unittest.cc",
       "h264/h264_bitstream_parser_unittest.cc",
@@ -148,6 +161,7 @@
 
     deps = [
       ":common_video",
+      ":corruption_detection_message_unittest",
       "../api:scoped_refptr",
       "../api/units:time_delta",
       "../api/video:video_frame",
diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn
index 3189430..0b9caef 100644
--- a/modules/rtp_rtcp/BUILD.gn
+++ b/modules/rtp_rtcp/BUILD.gn
@@ -126,7 +126,7 @@
     "../../api/units:timestamp",
     "../../api/video:video_layers_allocation",
     "../../api/video:video_rtp_headers",
-    "../../common_video:common_video",
+    "../../common_video:corruption_detection_message",
     "../../rtc_base:bit_buffer",
     "../../rtc_base:bitstream_reader",
     "../../rtc_base:buffer",
@@ -139,7 +139,6 @@
     "../../rtc_base:safe_conversions",
     "../../rtc_base:stringutils",
     "../../rtc_base/network:ecn_marking",
-    "../../rtc_base/synchronization:mutex",
     "../../system_wrappers",
     "../video_coding:codec_globals_headers",
     "//third_party/abseil-cpp/absl/algorithm:container",
@@ -763,7 +762,7 @@
     sources = [ "source/corruption_detection_extension_unittest.cc" ]
     deps = [
       ":rtp_rtcp_format",
-      "../../common_video:common_video",
+      "../../common_video:corruption_detection_message",
       "../../test:test_support",
     ]
   }
diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn
index 6d28c7b..34b765b 100644
--- a/test/fuzzers/BUILD.gn
+++ b/test/fuzzers/BUILD.gn
@@ -236,7 +236,7 @@
 webrtc_fuzzer_test("rtp_packet_fuzzer") {
   sources = [ "rtp_packet_fuzzer.cc" ]
   deps = [
-    "../../common_video:common_video",
+    "../../common_video:corruption_detection_message",
     "../../modules/rtp_rtcp:rtp_rtcp_format",
   ]
   seed_corpus = "corpora/rtp-corpus"