File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ webrtc-sys : patch
3+ livekit-ffi : patch
4+ libwebrtc : patch
5+ livekit : patch
6+ ---
7+
8+ # Fix H.264 codec matching
Original file line number Diff line number Diff line change @@ -106,6 +106,27 @@ std::unique_ptr<webrtc::VideoDecoder> VideoDecoderFactory::Create(
106106 }
107107 }
108108
109+ // IsSameCodec treats H.264 packetization-modes as distinct codecs, so when
110+ // the SFU sends mode=0 but the platform factory only advertises mode=1 the
111+ // strict match above fails. Retry with the factory's packetization-mode so
112+ // only that parameter is relaxed while the profile-level-id check is kept.
113+ if (absl::EqualsIgnoreCase (format.name , cricket::kH264CodecName )) {
114+ for (const auto & factory : factories_) {
115+ for (const auto & sf : factory->GetSupportedFormats ()) {
116+ if (!absl::EqualsIgnoreCase (sf.name , cricket::kH264CodecName ))
117+ continue ;
118+ auto adjusted = format;
119+ auto it = sf.parameters .find (" packetization-mode" );
120+ if (it != sf.parameters .end ())
121+ adjusted.parameters [" packetization-mode" ] = it->second ;
122+ else
123+ adjusted.parameters .erase (" packetization-mode" );
124+ if (sf.IsSameCodec (adjusted))
125+ return factory->Create (env, adjusted);
126+ }
127+ }
128+ }
129+
109130 if (absl::EqualsIgnoreCase (format.name , cricket::kVp8CodecName ))
110131 return webrtc::CreateVp8Decoder (env);
111132 if (absl::EqualsIgnoreCase (format.name , cricket::kVp9CodecName ))
You can’t perform that action at this time.
0 commit comments