Move VideoCodecType from common_types.h to api/video/video_codec_type.h
Bug: webrtc:7660
Change-Id: I9381364a64113dbb622b26acbf2b71228c3c4b96
Reviewed-on: https://webrtc-review.googlesource.com/c/111480
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25710}
diff --git a/BUILD.gn b/BUILD.gn
index 4deafef..554c5b8 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -439,6 +439,7 @@
deps = [
"api:array_view",
"api/video:video_bitrate_allocation",
+ "api/video:video_frame",
"rtc_base:checks",
"//third_party/abseil-cpp/absl/strings",
]
diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn
index b184dd1..5ed7089 100644
--- a/api/video/BUILD.gn
+++ b/api/video/BUILD.gn
@@ -15,6 +15,7 @@
"color_space.h",
"hdr_metadata.cc",
"hdr_metadata.h",
+ "video_codec_type.h",
"video_content_type.cc",
"video_content_type.h",
"video_frame.cc",
diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h
index b04e1ca..4cf410b 100644
--- a/api/video/encoded_image.h
+++ b/api/video/encoded_image.h
@@ -16,6 +16,7 @@
#include "absl/types/optional.h"
#include "api/video/hdr_metadata.h"
#include "api/video/video_bitrate_allocation.h"
+#include "api/video/video_codec_type.h"
#include "api/video/video_content_type.h"
#include "api/video/video_rotation.h"
#include "api/video/video_timing.h"
diff --git a/api/video/video_codec_type.h b/api/video/video_codec_type.h
new file mode 100644
index 0000000..447723c
--- /dev/null
+++ b/api/video/video_codec_type.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef API_VIDEO_VIDEO_CODEC_TYPE_H_
+#define API_VIDEO_VIDEO_CODEC_TYPE_H_
+
+namespace webrtc {
+
+// Video codec types
+enum VideoCodecType {
+ // There are various memset(..., 0, ...) calls in the code that rely on
+ // kVideoCodecGeneric being zero.
+ kVideoCodecGeneric = 0,
+ kVideoCodecVP8,
+ kVideoCodecVP9,
+ kVideoCodecH264,
+ kVideoCodecI420,
+ kVideoCodecMultiplex,
+};
+
+} // namespace webrtc
+
+#endif // API_VIDEO_VIDEO_CODEC_TYPE_H_
diff --git a/api/video_codecs/video_codec.h b/api/video_codecs/video_codec.h
index 95a1d84..9fba60c 100644
--- a/api/video_codecs/video_codec.h
+++ b/api/video_codecs/video_codec.h
@@ -16,6 +16,7 @@
#include <string>
#include "api/video/video_bitrate_allocation.h"
+#include "api/video/video_codec_type.h"
#include "common_types.h" // NOLINT(build/include)
#include "rtc_base/system/rtc_export.h"
diff --git a/common_types.h b/common_types.h
index ffd19b7..41b901c 100644
--- a/common_types.h
+++ b/common_types.h
@@ -17,6 +17,8 @@
#include "absl/strings/match.h"
// TODO(sprang): Remove this include when all usage includes it directly.
#include "api/video/video_bitrate_allocation.h"
+// TODO(bugs.webrtc.org/7660): Delete include once downstream code is updated.
+#include "api/video/video_codec_type.h"
#include "rtc_base/checks.h"
#if defined(_MSC_VER)
@@ -243,18 +245,6 @@
} // namespace H264
-// Video codec types
-enum VideoCodecType {
- // There are various memset(..., 0, ...) calls in the code that rely on
- // kVideoCodecGeneric being zero.
- kVideoCodecGeneric = 0,
- kVideoCodecVP8,
- kVideoCodecVP9,
- kVideoCodecH264,
- kVideoCodecI420,
- kVideoCodecMultiplex,
-};
-
struct SpatialLayer {
bool operator==(const SpatialLayer& other) const;
bool operator!=(const SpatialLayer& other) const { return !(*this == other); }
diff --git a/media/BUILD.gn b/media/BUILD.gn
index e2d7704..ea23433 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -252,8 +252,8 @@
deps += [
":rtc_constants",
":rtc_media_base",
- "..:webrtc_common",
"../api/video:video_bitrate_allocation",
+ "../api/video:video_frame",
"../api/video_codecs:rtc_software_fallback_wrappers",
"../api/video_codecs:video_codecs_api",
"../call:call_interfaces",
diff --git a/media/engine/webrtcvideodecoderfactory.h b/media/engine/webrtcvideodecoderfactory.h
index b81ac34..f00d9a6 100644
--- a/media/engine/webrtcvideodecoderfactory.h
+++ b/media/engine/webrtcvideodecoderfactory.h
@@ -13,7 +13,7 @@
#include <string>
-#include "common_types.h" // NOLINT(build/include)
+#include "api/video/video_codec_type.h"
#include "media/base/codec.h"
#include "rtc_base/refcount.h"
#include "rtc_base/system/rtc_export.h"
diff --git a/media/engine/webrtcvideoencoderfactory.h b/media/engine/webrtcvideoencoderfactory.h
index 4fc2e70..d39e0fd 100644
--- a/media/engine/webrtcvideoencoderfactory.h
+++ b/media/engine/webrtcvideoencoderfactory.h
@@ -14,7 +14,7 @@
#include <string>
#include <vector>
-#include "common_types.h" // NOLINT(build/include)
+#include "api/video/video_codec_type.h"
#include "media/base/codec.h"
#include "rtc_base/system/rtc_export.h"
diff --git a/modules/rtp_rtcp/source/rtp_video_header.h b/modules/rtp_rtcp/source/rtp_video_header.h
index ddf5942..1c75f53 100644
--- a/modules/rtp_rtcp/source/rtp_video_header.h
+++ b/modules/rtp_rtcp/source/rtp_video_header.h
@@ -15,6 +15,7 @@
#include "absl/container/inlined_vector.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
+#include "api/video/video_codec_type.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame_marking.h"
#include "api/video/video_rotation.h"
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 8d38adb..ae89107 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -78,7 +78,6 @@
":safe_compare",
":safe_minmax",
":type_traits",
- "..:webrtc_common",
"../api:array_view",
"../system_wrappers:field_trial",
"experiments:field_trial_parser",
diff --git a/rtc_base/experiments/BUILD.gn b/rtc_base/experiments/BUILD.gn
index b2e1302..35d1da9 100644
--- a/rtc_base/experiments/BUILD.gn
+++ b/rtc_base/experiments/BUILD.gn
@@ -56,7 +56,6 @@
]
deps = [
"../:rtc_base_approved",
- "../..:webrtc_common",
"../../api/video_codecs:video_codecs_api",
"../../system_wrappers:field_trial",
"//third_party/abseil-cpp/absl/types:optional",
diff --git a/rtc_base/experiments/quality_scaling_experiment.h b/rtc_base/experiments/quality_scaling_experiment.h
index 80a25ef..14833c0 100644
--- a/rtc_base/experiments/quality_scaling_experiment.h
+++ b/rtc_base/experiments/quality_scaling_experiment.h
@@ -12,7 +12,6 @@
#include "absl/types/optional.h"
#include "api/video_codecs/video_encoder.h"
-#include "common_types.h" // NOLINT(build/include)
namespace webrtc {
class QualityScalingExperiment {
diff --git a/video/video_quality_observer.h b/video/video_quality_observer.h
index a73de92..74f201e 100644
--- a/video/video_quality_observer.h
+++ b/video/video_quality_observer.h
@@ -15,8 +15,8 @@
#include <vector>
#include "absl/types/optional.h"
+#include "api/video/video_codec_type.h"
#include "api/video/video_content_type.h"
-#include "common_types.h" // NOLINT(build/include)
#include "rtc_base/numerics/sample_counter.h"
namespace webrtc {