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}
This commit is contained in:
Wei Zhou 2023-08-23 14:09:54 -07:00 committed by WebRTC LUCI CQ
parent b5dedfc856
commit b971a534e9

View file

@ -313,9 +313,7 @@ EncoderStreamFactory::CreateSimulcastOrConferenceModeScreenshareStreams(
const absl::optional<webrtc::DataRate>& experimental_min_bitrate) const { const absl::optional<webrtc::DataRate>& experimental_min_bitrate) const {
std::vector<webrtc::VideoStream> layers; std::vector<webrtc::VideoStream> layers;
const bool temporal_layers_supported = const bool temporal_layers_supported = IsTemporalLayersSupported(codec_name_);
absl::EqualsIgnoreCase(codec_name_, kVp8CodecName) ||
absl::EqualsIgnoreCase(codec_name_, kH264CodecName);
// Use legacy simulcast screenshare if conference mode is explicitly enabled // Use legacy simulcast screenshare if conference mode is explicitly enabled
// or use the regular simulcast configuration path which is generic. // or use the regular simulcast configuration path which is generic.
layers = GetSimulcastConfig(FindRequiredActiveLayers(encoder_config), layers = GetSimulcastConfig(FindRequiredActiveLayers(encoder_config),