|
@@ -712,20 +712,25 @@ export class TPCUtils {
|
712
|
712
|
* Returns a boolean indicating whether the video encoder is running in Simulcast mode, i.e., three encodings need
|
713
|
713
|
* to be configured in 4:2:1 resolution order with temporal scalability.
|
714
|
714
|
*
|
715
|
|
- * @param {CodecMimeType} codec - The video codec in use.
|
|
715
|
+ * @param {CodecMimeType} videoCodec - The video codec in use.
|
716
|
716
|
* @returns {boolean}
|
717
|
717
|
*/
|
718
|
|
- isRunningInSimulcastMode(codec) {
|
719
|
|
- return codec === CodecMimeType.VP8 // VP8 always
|
|
718
|
+ isRunningInSimulcastMode(videoCodec) {
|
|
719
|
+ if (!this.codecSettings || !this.codecSettings[videoCodec]) {
|
|
720
|
+ // If codec settings are not available, assume no simulcast
|
|
721
|
+ return false;
|
|
722
|
+ }
|
|
723
|
+
|
|
724
|
+ return videoCodec === CodecMimeType.VP8 // VP8 always
|
720
|
725
|
|
721
|
726
|
// K-SVC mode for VP9 when no scalability mode is set. Though only one outbound-rtp stream is present,
|
722
|
727
|
// three separate encodings have to be configured.
|
723
|
|
- || (!this.codecSettings[codec].scalabilityModeEnabled && codec === CodecMimeType.VP9)
|
|
728
|
+ || (!this.codecSettings[videoCodec].scalabilityModeEnabled && videoCodec === CodecMimeType.VP9)
|
724
|
729
|
|
725
|
730
|
// When scalability is enabled, always for H.264, and only when simulcast is explicitly enabled via
|
726
|
731
|
// config.js for VP9 and AV1 since full SVC is the default mode for these 2 codecs.
|
727
|
|
- || (this.codecSettings[codec].scalabilityModeEnabled
|
728
|
|
- && (codec === CodecMimeType.H264 || this.codecSettings[codec].useSimulcast));
|
|
732
|
+ || (this.codecSettings[videoCodec].scalabilityModeEnabled
|
|
733
|
+ && (videoCodec === CodecMimeType.H264 || this.codecSettings[videoCodec].useSimulcast));
|
729
|
734
|
}
|
730
|
735
|
|
731
|
736
|
/**
|