Repository navigation
Advertise pass-through video formats without requiring a local real e… - #1452
stephen-derosa wants to merge 1 commit into
Conversation
Changeset incompleteThis PR's changeset is missing version bumps for packages that are affected by the change. The following packages still require a bump:
Already covered:
A package must be bumped when its own files change, and whenever a package it depends on is bumped (so downstream consumers get a matching release). Click here to create a changeset for the missing packages The link pre-populates a changeset file with If this change doesn't require a version bump, add the |
| for (const auto& format : backend_factory.factory->GetSupportedFormats()) { | ||
| const bool codec_available = std::any_of( | ||
| formats.begin(), formats.begin() + real_format_count, | ||
| [&](const webrtc::SdpVideoFormat& existing) { | ||
| return IsSameCodecName(existing.name, format.name); | ||
| }); | ||
| if (codec_available) { | ||
| formats.push_back(format); | ||
| } | ||
| formats.push_back(format); |
There was a problem hiding this comment.
🟡 Raw senders negotiate unusable codecs
GetSupportedFormats advertises pass-through-only codecs to raw senders. Untagged encoder creation excludes PreEncoded, so negotiation succeeds but the sender cannot encode.
Learn more
Encoder capabilities apply to every sender created by this peer connection factory. They do not carry the sender's later VideoEncoderBackend choice. These added formats are also untagged, while Create deliberately excludes PreEncoded from automatic fallback. The factory therefore promises support for formats that ordinary raw senders cannot instantiate.
Example: On a desktop without HEVC encoding, the factory advertises H.265. A raw sender can negotiate H.265 from that capability, but untagged Create skips the pass-through factory and returns null instead of an encoder.
Recommended fix: Preserve pass-through-only codecs without exposing them as ordinary encoder capabilities. Associate them with explicit PreEncoded selection before codec negotiation, or add sender-level capability filtering so only pre-encoded publications advertise them. Keep raw sender capabilities limited to formats accepted by untagged Create.
Was this helpful? React with 👍 or 👎 to provide feedback.
…ncoder A pre-encoded publisher supplies its own bitstream, so it does not need a local encoder for its codec. GetSupportedFormats() previously dropped pass-through formats for codecs no real encoder factory advertised, which made pre-encoded H.265 publishes fail silently on machines without a hardware HEVC encoder: H265 never appeared in the SDP offer, the sender negotiated a different codec, and PassthroughVideoEncoder then rejected every frame with "frame codec does not match sender codec" while captureFrame kept reporting frames as accepted. Advertising the pass-through formats unconditionally is safe because the pass-through backend is never selected automatically - it is excluded from automatic fallback and only used on an explicit publish request - and Create() already fails loudly rather than falling back to a real encoder for a pre-encoded sender. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6f5e1f2 to
8e61b89
Compare
|
closing in favor of #1451 |
No description provided.