@@ -169,7 +169,6 @@ class pipeline {
169
169
if ( decoderSupport . supported ) {
170
170
this . decoder . configure ( decoderSupport . config ) ;
171
171
self . postMessage ( { text : 'Decoder successfully configured:\n' + JSON . stringify ( decoderSupport . config ) } ) ;
172
- // self.postMessage({text: 'Decoder state: ' + JSON.stringify(this.decoder.state)});
173
172
} else {
174
173
self . postMessage ( { severity : 'fatal' , text : 'Config not supported:\n' + JSON . stringify ( decoderSupport . config ) } ) ;
175
174
}
@@ -179,7 +178,6 @@ class pipeline {
179
178
} )
180
179
} else {
181
180
try {
182
- // self.postMessage({text: 'size: ' + chunk.byteLength + ' seq: ' + chunk.seqNo + ' kf: ' + chunk.keyframeIndex + ' delta: ' + chunk.deltaframeIndex + ' dur: ' + chunk.duration + ' ts: ' + chunk.timestamp + ' ssrc: ' + chunk.ssrc + ' pt: ' + chunk.pt + ' tid: ' + chunk.temporalLayerId + ' type: ' + chunk.type});
183
181
const queue = this . decoder . decodeQueueSize ;
184
182
decqueue_update ( queue ) ;
185
183
const before = performance . now ( ) ;
@@ -208,9 +206,8 @@ class pipeline {
208
206
this . encoder = encoder = new VideoEncoder ( {
209
207
output : ( chunk , cfg ) => {
210
208
if ( cfg . decoderConfig ) {
211
- // self.postMessage({text: 'Decoder reconfig!'});
212
209
const decoderConfig = JSON . stringify ( cfg . decoderConfig ) ;
213
- // self.postMessage({text: 'Configuration: ' + decoderConfig});
210
+ self . postMessage ( { text : 'Configuration: ' + decoderConfig } ) ;
214
211
const configChunk =
215
212
{
216
213
type : "config" ,
@@ -248,7 +245,6 @@ class pipeline {
248
245
if ( encoderSupport . supported ) {
249
246
this . encoder . configure ( encoderSupport . config ) ;
250
247
self . postMessage ( { text : 'Encoder successfully configured:\n' + JSON . stringify ( encoderSupport . config ) } ) ;
251
- // self.postMessage({text: 'Encoder state: ' + JSON.stringify(this.encoder.state)});
252
248
} else {
253
249
self . postMessage ( { severity : 'fatal' , text : 'Config not supported:\n' + JSON . stringify ( encoderSupport . config ) } ) ;
254
250
}
@@ -264,9 +260,6 @@ class pipeline {
264
260
this . frameCounter ++ ;
265
261
try {
266
262
if ( this . encoder . state != "closed" ) {
267
- if ( this . frameCounter % 20 == 0 ) {
268
- // self.postMessage({text: 'Encoded 20 frames'});
269
- }
270
263
const queue = this . encoder . encodeQueueSize ;
271
264
encqueue_update ( queue ) ;
272
265
const before = performance . now ( ) ;
@@ -296,17 +289,14 @@ class pipeline {
296
289
if ( stopped ) return ;
297
290
stopped = true ;
298
291
this . stopped = true ;
299
- self . postMessage ( { severity : 'fatal' , text : 'stop() called' } ) ;
300
- // TODO: There might be a more elegant way of closing a stream, or other
301
- // events to listen for.
292
+ self . postMessage ( { text : 'stop() called' } ) ;
302
293
if ( encoder . state != "closed" ) encoder . close ( ) ;
303
294
if ( decoder . state != "closed" ) decoder . close ( ) ;
304
- self . postMessage ( { severity : 'fatal' , text : 'stop(): frame, encoder and decoder closed' } ) ;
295
+ self . postMessage ( { text : 'stop(): frame, encoder and decoder closed' } ) ;
305
296
return ;
306
297
}
307
298
308
- async start ( )
309
- {
299
+ async start ( ) {
310
300
if ( stopped ) return ;
311
301
started = true ;
312
302
let duplexStream , readStream , writeStream ;
0 commit comments