From 22b70ff1d4308cb56c08d16e06f2f6945b984831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Tue, 20 Nov 2018 11:06:58 +0100 Subject: [PATCH] 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 Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#25710} --- BUILD.gn | 1 + api/video/BUILD.gn | 1 + api/video/encoded_image.h | 1 + api/video/video_codec_type.h | 30 +++++++++++++++++++ api/video_codecs/video_codec.h | 1 + common_types.h | 14 ++------- media/BUILD.gn | 2 +- media/engine/webrtcvideodecoderfactory.h | 2 +- media/engine/webrtcvideoencoderfactory.h | 2 +- modules/rtp_rtcp/source/rtp_video_header.h | 1 + rtc_base/BUILD.gn | 1 - rtc_base/experiments/BUILD.gn | 1 - .../experiments/quality_scaling_experiment.h | 1 - video/video_quality_observer.h | 2 +- 14 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 api/video/video_codec_type.h diff --git a/BUILD.gn b/BUILD.gn index 4deafefac0..554c5b89ce 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -439,6 +439,7 @@ rtc_source_set("webrtc_common") { 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 b184dd1ab2..5ed70898f7 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -15,6 +15,7 @@ rtc_source_set("video_frame") { "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 b04e1ca524..4cf410b390 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 0000000000..447723cf08 --- /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 95a1d845e1..9fba60c4e8 100644 --- a/api/video_codecs/video_codec.h +++ b/api/video_codecs/video_codec.h @@ -16,6 +16,7 @@ #include #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 ffd19b7187..41b901cec2 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 @@ enum Profile { } // 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 e2d7704b44..ea234331a8 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -252,8 +252,8 @@ rtc_static_library("rtc_internal_video_codecs") { 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 b81ac3447f..f00d9a69e0 100644 --- a/media/engine/webrtcvideodecoderfactory.h +++ b/media/engine/webrtcvideodecoderfactory.h @@ -13,7 +13,7 @@ #include -#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 4fc2e70b79..d39e0fd5f9 100644 --- a/media/engine/webrtcvideoencoderfactory.h +++ b/media/engine/webrtcvideoencoderfactory.h @@ -14,7 +14,7 @@ #include #include -#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 ddf5942e39..1c75f539a1 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 8d38adb4fc..ae891078cb 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -78,7 +78,6 @@ rtc_source_set("rtc_base_approved") { ":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 b2e1302edc..35d1da9393 100644 --- a/rtc_base/experiments/BUILD.gn +++ b/rtc_base/experiments/BUILD.gn @@ -56,7 +56,6 @@ rtc_static_library("quality_scaling_experiment") { ] 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 80a25ef1ee..14833c00b1 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 a73de92c91..74f201e8c4 100644 --- a/video/video_quality_observer.h +++ b/video/video_quality_observer.h @@ -15,8 +15,8 @@ #include #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 {