Deprecate write-only member CodecInfo::is_hardware_accelerated

This member of the CodecInfo struct was set in several places, but not
used for anything. To aid deletion, this cl defines a default implementation
of VideoEncoderFactory::QueryVideoEncoder.

The next step is to delete almost all downstream implementations of that method,
since the only classes that have to implement it are the few factories that
produce "internal source" encoders, e.g., for Chromium remoting.

Bug: None
Change-Id: I1f0dbf0d302933004ebdc779460cb2cb3a894e02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179520
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31844}
diff --git a/api/test/video/function_video_encoder_factory.h b/api/test/video/function_video_encoder_factory.h
index 40a187a..a452eee 100644
--- a/api/test/video/function_video_encoder_factory.h
+++ b/api/test/video/function_video_encoder_factory.h
@@ -43,14 +43,6 @@
     return {};
   }
 
-  CodecInfo QueryVideoEncoder(
-      const SdpVideoFormat& /* format */) const override {
-    CodecInfo codec_info;
-    codec_info.is_hardware_accelerated = false;
-    codec_info.has_internal_source = false;
-    return codec_info;
-  }
-
   std::unique_ptr<VideoEncoder> CreateVideoEncoder(
       const SdpVideoFormat& format) override {
     return create_(format);
diff --git a/api/video_codecs/builtin_video_encoder_factory.cc b/api/video_codecs/builtin_video_encoder_factory.cc
index 6888daa..2f722a4 100644
--- a/api/video_codecs/builtin_video_encoder_factory.cc
+++ b/api/video_codecs/builtin_video_encoder_factory.cc
@@ -50,8 +50,6 @@
     RTC_DCHECK(IsFormatSupported(
         internal_encoder_factory_->GetSupportedFormats(), format));
     VideoEncoderFactory::CodecInfo info;
-    info.has_internal_source = false;
-    info.is_hardware_accelerated = false;
     return info;
   }
 
diff --git a/api/video_codecs/video_encoder_factory.h b/api/video_codecs/video_encoder_factory.h
index c396090..0a3c1ae 100644
--- a/api/video_codecs/video_encoder_factory.h
+++ b/api/video_codecs/video_encoder_factory.h
@@ -28,8 +28,7 @@
  public:
   // TODO(magjed): Try to get rid of this struct.
   struct CodecInfo {
-    // |is_hardware_accelerated| is true if the encoders created by this factory
-    // of the given codec will use hardware support.
+    // TODO(nisse): Unused in webrtc, delete as soon as downstream use is fixed.
     bool is_hardware_accelerated = false;
     // |has_internal_source| is true if encoders created by this factory of the
     // given codec will use internal camera sources, meaning that they don't
@@ -73,8 +72,13 @@
 
   // Returns information about how this format will be encoded. The specified
   // format must be one of the supported formats by this factory.
-  // TODO(magjed): Try to get rid of this method.
-  virtual CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const = 0;
+
+  // TODO(magjed): Try to get rid of this method. Since is_hardware_accelerated
+  // is unused, only factories producing internal source encoders (in itself a
+  // deprecated feature) needs to override this method.
+  virtual CodecInfo QueryVideoEncoder(const SdpVideoFormat& format) const {
+    return CodecInfo();
+  }
 
   // Creates a VideoEncoder for the specified format.
   virtual std::unique_ptr<VideoEncoder> CreateVideoEncoder(