From a9d7c19011cfb5c0945bc63e177ef7d91ac2cf6d Mon Sep 17 00:00:00 2001 From: philipel Date: Fri, 26 Apr 2024 15:22:10 +0200 Subject: [PATCH] Make EncodeResultCallback rvalue ref-qualified. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: b/336978562 Change-Id: Icc9be7a5ad095304bf68e19ffedca77d8bc1810c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349266 Commit-Queue: Philip Eliasson Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/main@{#42285} --- api/video_codecs/libaom_av1_encoder_factory.cc | 5 +++-- api/video_codecs/video_encoder_interface.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/video_codecs/libaom_av1_encoder_factory.cc b/api/video_codecs/libaom_av1_encoder_factory.cc index 7e3c583c7f..29c4eb6eda 100644 --- a/api/video_codecs/libaom_av1_encoder_factory.cc +++ b/api/video_codecs/libaom_av1_encoder_factory.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "absl/algorithm/container.h" @@ -619,7 +620,7 @@ aom_svc_params_t GetSvcParams( void DoErrorCallback(std::vector& frame_settings) { for (FrameEncodeSettings& settings : frame_settings) { if (settings.result_callback) { - settings.result_callback({}); + std::move(settings.result_callback)({}); // To avoid invoking any callback more than once. settings.result_callback = {}; } @@ -788,7 +789,7 @@ void LibaomAv1Encoder::Encode( return; } else { RTC_CHECK(settings.result_callback); - settings.result_callback(result); + std::move(settings.result_callback)(result); // To avoid invoking any callback more than once. settings.result_callback = {}; } diff --git a/api/video_codecs/video_encoder_interface.h b/api/video_codecs/video_encoder_interface.h index 55ef55861c..de7c118d49 100644 --- a/api/video_codecs/video_encoder_interface.h +++ b/api/video_codecs/video_encoder_interface.h @@ -52,7 +52,7 @@ class VideoEncoderInterface { }; using EncodeResult = absl::variant; using EncodeResultCallback = - absl::AnyInvocable; + absl::AnyInvocable; struct FrameEncodeSettings { struct Cbr {