mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Make EncodeResultCallback rvalue ref-qualified.
Bug: b/336978562 Change-Id: Icc9be7a5ad095304bf68e19ffedca77d8bc1810c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349266 Commit-Queue: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42285}
This commit is contained in:
parent
cf4764e062
commit
a9d7c19011
2 changed files with 4 additions and 3 deletions
|
@ -14,6 +14,7 @@
|
|||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
|
@ -619,7 +620,7 @@ aom_svc_params_t GetSvcParams(
|
|||
void DoErrorCallback(std::vector<FrameEncodeSettings>& 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 = {};
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class VideoEncoderInterface {
|
|||
};
|
||||
using EncodeResult = absl::variant<EncodingError, EncodedData>;
|
||||
using EncodeResultCallback =
|
||||
absl::AnyInvocable<void(const EncodeResult& result)>;
|
||||
absl::AnyInvocable<void(const EncodeResult& result) &&>;
|
||||
|
||||
struct FrameEncodeSettings {
|
||||
struct Cbr {
|
||||
|
|
Loading…
Reference in a new issue