From 73f3393426513197c9d482c49b8c63b7bc99da2f Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Thu, 27 Oct 2022 16:37:28 +0200 Subject: [PATCH] Select openh264 includes based on OPENH264_API_WELS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should be landed after https://chromium-review.googlesource.com/c/chromium/src/+/3986032 Bug: chromium:1218384 Change-Id: Id4104d2914f811e722a083021f515fd06b69b910 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280800 Reviewed-by: Harald Alvestrand Commit-Queue: Sergey Silkin Reviewed-by: Bruce Dawson Reviewed-by: Åsa Persson Cr-Commit-Position: refs/heads/main@{#38515} --- modules/video_coding/BUILD.gn | 1 + modules/video_coding/codecs/h264/h264_encoder_impl.cc | 9 +++++++++ modules/video_coding/codecs/h264/h264_encoder_impl.h | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 640d6626de..125a368972 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -544,6 +544,7 @@ rtc_library("webrtc_h264") { if (rtc_use_h264) { deps += [ "//third_party/ffmpeg", + "//third_party/openh264:buildflags", "//third_party/openh264:encoder", ] if (!build_with_mozilla) { diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/modules/video_coding/codecs/h264/h264_encoder_impl.cc index fc3fd195fb..5029dc9763 100644 --- a/modules/video_coding/codecs/h264/h264_encoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_encoder_impl.cc @@ -31,10 +31,19 @@ #include "system_wrappers/include/metrics.h" #include "third_party/libyuv/include/libyuv/convert.h" #include "third_party/libyuv/include/libyuv/scale.h" +// TODO(crbug.com/1218384): Remove after new openh264 is rolled. +#include "third_party/openh264/buildflags.h" +#if BUILDFLAG(OPENH264_API_WELS) +#include "third_party/openh264/src/codec/api/wels/codec_api.h" +#include "third_party/openh264/src/codec/api/wels/codec_app_def.h" +#include "third_party/openh264/src/codec/api/wels/codec_def.h" +#include "third_party/openh264/src/codec/api/wels/codec_ver.h" +#else #include "third_party/openh264/src/codec/api/svc/codec_api.h" #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" #include "third_party/openh264/src/codec/api/svc/codec_def.h" #include "third_party/openh264/src/codec/api/svc/codec_ver.h" +#endif namespace webrtc { diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.h b/modules/video_coding/codecs/h264/h264_encoder_impl.h index 780781be23..c1d81915cf 100644 --- a/modules/video_coding/codecs/h264/h264_encoder_impl.h +++ b/modules/video_coding/codecs/h264/h264_encoder_impl.h @@ -30,7 +30,13 @@ #include "modules/video_coding/codecs/h264/include/h264.h" #include "modules/video_coding/svc/scalable_video_controller.h" #include "modules/video_coding/utility/quality_scaler.h" +// TODO(crbug.com/1218384): Remove after new openh264 is rolled. +#include "third_party/openh264/buildflags.h" +#if BUILDFLAG(OPENH264_API_WELS) +#include "third_party/openh264/src/codec/api/wels/codec_app_def.h" +#else #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" +#endif class ISVCEncoder;