Add Performance::encode_on_calling_thread flag.

Bug: b/336978562
Change-Id: Id6edf45e80efb99ace46299ef36082f280cb8921
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350622
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42311}
diff --git a/api/video_codecs/libaom_av1_encoder_factory.cc b/api/video_codecs/libaom_av1_encoder_factory.cc
index 29c4eb6..5c950c7 100644
--- a/api/video_codecs/libaom_av1_encoder_factory.cc
+++ b/api/video_codecs/libaom_av1_encoder_factory.cc
@@ -810,11 +810,13 @@
   return {};
 }
 
+// clang-format off
+// The formater and cpplint have conflicting ideas.
 VideoEncoderFactoryInterface::Capabilities
 LibaomAv1EncoderFactory::GetEncoderCapabilities() const {
   return {
-      .prediction_constraints =
-          {.num_buffers = kNumBuffers,
+      .prediction_constraints = {
+           .num_buffers = kNumBuffers,
            .max_references = kMaxReferences,
            .max_temporal_layers = kMaxTemporalLayers,
            .buffer_space_type = VideoEncoderFactoryInterface::Capabilities::
@@ -834,14 +836,16 @@
           },
       .encoding_formats = {{.sub_sampling = EncodingFormat::k420,
                             .bit_depth = 8}},
-      .rate_control =
-          {.qp_range = {0, kMaxQp},
+      .rate_control = {
+           .qp_range = {0, kMaxQp},
            .rc_modes = {VideoEncoderFactoryInterface::RateControlMode::kCbr,
                         VideoEncoderFactoryInterface::RateControlMode::kCqp}},
-      .performance = {.min_max_effort_level = {kMinEffortLevel,
+      .performance = {.encode_on_calling_thread = true,
+                      .min_max_effort_level = {kMinEffortLevel,
                                                kMaxEffortLevel}},
   };
 }
+// clang-format on
 
 std::unique_ptr<VideoEncoderInterface> LibaomAv1EncoderFactory::CreateEncoder(
     const StaticEncoderSettings& settings,
diff --git a/api/video_codecs/video_encoder_factory_interface.h b/api/video_codecs/video_encoder_factory_interface.h
index 63b21d4..67ca42a 100644
--- a/api/video_codecs/video_encoder_factory_interface.h
+++ b/api/video_codecs/video_encoder_factory_interface.h
@@ -70,6 +70,7 @@
     } rate_control;
 
     struct Performance {
+      bool encode_on_calling_thread;
       std::pair<int, int> min_max_effort_level;
     } performance;
   };