Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow level-id to be different in codec match #3023

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

henbos
Copy link
Contributor

@henbos henbos commented Nov 21, 2024

Fixes #3020


Preview | Diff

@henbos henbos requested a review from aboba November 21, 2024 11:51
@henbos
Copy link
Contributor Author

henbos commented Nov 21, 2024

@aboba Does this wording make sense to you?

webrtc.html Show resolved Hide resolved
webrtc.html Outdated
<code>false</code>. Two FMTP lines are the same as long as they convey the same
information, including omitting parameters with well defined defaults or using
different order. In this step, the user agent MUST consider two FMTP lines
identical if the "media format" are the same but the highest complying bitstream
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
identical if the "media format" are the same but the highest complying bitstream
identical if the "media format" is the same but the highest complying bitstream

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calling them "identical" if the information is the same but they differ is a bit confusing, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done + reworded

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text is ambiguous because not all fmtp parameters are included in the "media format" for matching purposes. As an example, the statement applies to H.265 but not H.264 where profile-level-id combines profile with level-id.

@fippo
Copy link
Contributor

fippo commented Nov 21, 2024

if you want to go this route you will also need to take care of RFC6184s level-asymmetry-allowed, no? All of this is reasonably well-defined in IETF specs though (well, not quite for HEVC) already

@henbos
Copy link
Contributor Author

henbos commented Nov 21, 2024

if you want to go this route you will also need to take care of RFC6184s level-asymmetry-allowed, no?

No this is just about the codec matching algorithm used to sanity check input to setParameters/setCodecPreferences, what is actually negotiated based on this is defined somewhere else.

As for sending the selected codec, the description is kind of vague, RTCRtpEncodingParmaters.codec just says:

Optional value selecting which codec is used for this encoding's RTP stream. If absent, the user agent can chose to use any negotiated codec.

And setParameters just says:

In parallel, configure the media stack to use parameters to transmit sender.[[SenderTrack]].

So it's just "codec used for selecting what to send", we might want to create an issue about clarifying not to send greater than the level-id that was negotiated, but that seems more like an editorial note.

@henbos
Copy link
Contributor Author

henbos commented Nov 21, 2024

not to send greater than the level-id

We might want to update getParameters().encodings[i].codec to match the level-id that you find in getParamters().codecs though? Separate issue though because that is the same as what happens with setCodecPreferences() today

<p>
If either (but not both) of <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}}
and <var>second</var>.{{RTCRtpCodec/sdpFmtpLine}} are [= map/exist | missing =],
or if they both [=map/exist=] and <var>first</var>.{{RTCRtpCodec/sdpFmtpLine}}
is different from <var>second</var>.{{RTCRtpCodec/sdpFmtpLine}}, return
<code>false</code>.
<code>false</code>. Two FMTP lines are the same as long as they convey the same
information, including omitting parameters with well defined defaults or using
Copy link
Contributor Author

@henbos henbos Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change "information" to "media format", which is codec specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to align spec language with CL :)

"difftype": "modify",
"id": 51,
"pr": 3023,
"testUpdates": "not-testable"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remote SDP is testable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codec negotiation and level IDs
5 participants