-
-
Notifications
You must be signed in to change notification settings - Fork 237
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 setting RtpEncodingParameters for individual encodings #174
base: v3
Are you sure you want to change the base?
Conversation
parameters.encodings[idx] = { ...encoding, ...params }; | ||
}); | ||
parameters.encodings.forEach((encoding: RTCRtpEncodingParameters, idx: number) => | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. Old matching properties override the new ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way property assignment was done before. It seems to be correct:
const oldObj = { x: 1 }
const newObj = { x: 2 }
{ ...oldObj, ...newObj } // { x: 2 }
It transpiles to:
parameters.encodings[idx] = Object.assign(Object.assign({}, encoding), params[idx]);
Which also seems right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in mobile and could be wrong. I'll review in next days. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I want to re-review this, sorry for the delay, off for many weeks. |
Description
Changes
Producer::setRtpEncodingParameters
to also accept an array of RTCRtpEncodingParameters, for setting different parameters for each encoding. Passing a single RTCRtpEncodingParameters object will work as before.Usecases
I have a few uses for this - just some examples:
setMaxSpatialLayer
but reversed).scaleResolutionDownBy
depending on the current source resolution of the track.