@@ -21,6 +21,7 @@ const logger = getLogger('rtc:JitsiRemoteTrack');
2121const ort = require ( 'onnxruntime-web' ) ;
2222
2323ort . env . wasm . wasmPaths = '/libs/dist/' ;
24+ ort . env . wasm . numThreads = 1 ;
2425
2526let ttfmTrackerAudioAttached = false ;
2627let ttfmTrackerVideoAttached = false ;
@@ -31,9 +32,15 @@ export let decodingSession = null;
3132 */
3233async function loadDecoder ( ) {
3334 try {
34- decodingSession = await ort . InferenceSession . create ( '/libs/models/Decoder.onnx' , { freeDimensionOverrides : {
35- batch : 1 ,
36- } } ) ;
35+ decodingSession = await ort . InferenceSession . create ( '/libs/models/Decoder.onnx' ,
36+ {
37+ executionProviders : [ 'wasm' ] ,
38+ freeDimensionOverrides : {
39+ batch : 1 ,
40+ }
41+ }
42+ ) ;
43+ console . info ( 'Decoder model has been loaded' ) ;
3744 } catch ( error ) {
3845 console . error ( 'Decoder model could not be loaded!: ' , error ) ;
3946 }
@@ -442,11 +449,6 @@ export default class JitsiRemoteTrack extends JitsiTrack {
442449 * @param {* } videoTrack
443450 * @param {* } canvasDecoded
444451 */
445- applyONNXDecoder ( videoTrack , canvasDecoded , muted ) ; /**
446- * Does the decoding phase of the incoming streams
447- * @param {* } videoTrack
448- * @param {* } canvasDecoded
449- */
450452 applyONNXDecoder ( videoTrack , canvasDecoded , muted ) {
451453 // Frame-grabber to catch frames from the incoming stream
452454 const imageCapture = new ImageCapture ( videoTrack ) ;
@@ -464,6 +466,8 @@ export default class JitsiRemoteTrack extends JitsiTrack {
464466 // Capturing a frame and painting it into the aux canvas
465467 const frame = await imageCapture . grabFrame ( ) ;
466468 // Getting the current size of the incoming stream
469+ // const width = videoTrack.getSettings().width;
470+ // const height = videoTrack.getSettings().height;
467471 const width = frame . width ;
468472 const height = frame . height ;
469473
0 commit comments