File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,20 @@ std::unique_ptr<webrtc::VideoDecoder> VideoDecoderFactory::Create(
106106 }
107107 }
108108
109+ // Platform HW decoders (VideoToolbox, MediaCodec) can decode any H.264
110+ // stream regardless of packetization-mode. IsSameCodec treats different
111+ // packetization-modes as distinct codecs, so when the SFU sends mode=0 but
112+ // the platform factory only advertises mode=1 the strict match above fails.
113+ // Retry with a relaxed name-only check before falling through to software.
114+ if (absl::EqualsIgnoreCase (format.name , cricket::kH264CodecName )) {
115+ for (const auto & factory : factories_) {
116+ for (const auto & sf : factory->GetSupportedFormats ()) {
117+ if (absl::EqualsIgnoreCase (sf.name , cricket::kH264CodecName ))
118+ return factory->Create (env, format);
119+ }
120+ }
121+ }
122+
109123 if (absl::EqualsIgnoreCase (format.name , cricket::kVp8CodecName ))
110124 return webrtc::CreateVp8Decoder (env);
111125 if (absl::EqualsIgnoreCase (format.name , cricket::kVp9CodecName ))
You can’t perform that action at this time.
0 commit comments