From 41d9a01f6a4c36bf968a44a8f3bef3a99b4f62a0 Mon Sep 17 00:00:00 2001 From: Fanny Linderborg Date: Mon, 14 Oct 2024 12:04:49 +0200 Subject: [PATCH] Prepare function for deprecation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `FrameToRender` function is considered a part of WebRTC's API so it cannot just be removed all at once. Since it is a pure virtual function it needs some preparation for the deprecation. This CL implements a default implementation. It will now be possible to not implement the function, but it will kill the process in that case. Bug: webrtc:358039777 Change-Id: Ia83c63ab035abda76beb30ba98b23f9cc835a6a1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365500 Commit-Queue: Erik Språng Auto-Submit: Fanny Linderborg Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/main@{#43235} --- modules/video_coding/BUILD.gn | 1 + modules/video_coding/include/video_coding_defines.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 241de922a4..2a95bba2a0 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -300,6 +300,7 @@ rtc_library("video_codec_interface") { "../../common_video", "../../common_video:frame_instrumentation_data", "../../common_video/generic_frame_descriptor", + "../../rtc_base:checks", "../../rtc_base/system:rtc_export", "//third_party/abseil-cpp/absl/types:variant", ] diff --git a/modules/video_coding/include/video_coding_defines.h b/modules/video_coding/include/video_coding_defines.h index c5d8e7597c..9cb32c4348 100644 --- a/modules/video_coding/include/video_coding_defines.h +++ b/modules/video_coding/include/video_coding_defines.h @@ -22,6 +22,7 @@ #include "api/video/video_frame_type.h" #include "api/video/video_timing.h" #include "api/video_codecs/video_decoder.h" +#include "rtc_base/checks.h" namespace webrtc { @@ -67,7 +68,10 @@ class VCMReceiveCallback { std::optional qp, TimeDelta decode_time, VideoContentType content_type, - VideoFrameType frame_type) = 0; + VideoFrameType frame_type) { + RTC_CHECK_NOTREACHED(); + return 0; + } // TODO: bugs.webrtc.org/358039777 - Make this pure virtual. virtual int32_t OnFrameToRender(const struct FrameToRender& arguments) {