Fix inconsistent logics to check if temporal layer is supported

In fucntion EncoderStreamFactory::CreateSimulcastOrConferenceModeScreenshareStreams, the follow code allows TL for H264.
  const bool temporal_layers_supported =
      absl::EqualsIgnoreCase(codec_name_, kVp8CodecName) ||
      absl::EqualsIgnoreCase(codec_name_, kH264CodecName);
However, the helper function IsTemporalLayersSupported does not allow TL for H264. The diff unifies the logic by using the helper function

Bug: webrtc:15442
Change-Id: I1497ccc1cd5d3715310e0485f9179bd8e6948f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317542
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40629}
diff --git a/video/config/encoder_stream_factory.cc b/video/config/encoder_stream_factory.cc
index c955602..a4e41ad 100644
--- a/video/config/encoder_stream_factory.cc
+++ b/video/config/encoder_stream_factory.cc
@@ -313,9 +313,7 @@
     const absl::optional<webrtc::DataRate>& experimental_min_bitrate) const {
   std::vector<webrtc::VideoStream> layers;
 
-  const bool temporal_layers_supported =
-      absl::EqualsIgnoreCase(codec_name_, kVp8CodecName) ||
-      absl::EqualsIgnoreCase(codec_name_, kH264CodecName);
+  const bool temporal_layers_supported = IsTemporalLayersSupported(codec_name_);
   // Use legacy simulcast screenshare if conference mode is explicitly enabled
   // or use the regular simulcast configuration path which is generic.
   layers = GetSimulcastConfig(FindRequiredActiveLayers(encoder_config),