|
@@ -146,7 +146,7 @@ export class StreamService {
|
|
|
steam.on('data', (data: Buffer) => {
|
|
|
this.onSteaming.next(true);
|
|
|
|
|
|
- // console.log('data', data, data.byteLength);
|
|
|
+ // this.logger.log('data', data, data.byteLength);
|
|
|
const blockBuffStart = Buffer.alloc(this.block);
|
|
|
const packBuffer = Buffer.concat([blockBuffStart, data]);
|
|
|
|
|
@@ -167,8 +167,8 @@ export class StreamService {
|
|
|
|
|
|
// 32 bit slot
|
|
|
// statusPack.setUint32(12, buff.byteLength);
|
|
|
- // console.log('metaLen', coordBuff.byteLength);
|
|
|
- // console.log('metaLen', clipBuffer.byteLength);
|
|
|
+ // this.logger.log('metaLen', coordBuff.byteLength);
|
|
|
+ // this.logger.log('metaLen', clipBuffer.byteLength);
|
|
|
|
|
|
framePack.setUint32(0, 1437227610);
|
|
|
framePack.setUint32(12, coordBuff.byteLength); // metaLen
|
|
@@ -179,13 +179,13 @@ export class StreamService {
|
|
|
framePack.setUint32(this.block - 4, steamByteLength);
|
|
|
const isLastFrame = framePack.byteLength - this.chunk_size < 0;
|
|
|
|
|
|
- // console.log('statusPack', statusPack);
|
|
|
+ // this.logger.log('statusPack', statusPack);
|
|
|
if (this.channel && this.channel.isOpen()) {
|
|
|
this.channel.sendMessageBinary(Buffer.from(framePack.buffer));
|
|
|
}
|
|
|
steamByteLength += data.byteLength;
|
|
|
if (isLastFrame) {
|
|
|
- // console.log('isLastFrame', isLastFrame);
|
|
|
+ // this.logger.log('isLastFrame', isLastFrame);
|
|
|
// steamByteLength = 0;
|
|
|
// this.onSteaming.next(false);
|
|
|
steam.stop();
|
|
@@ -194,11 +194,13 @@ export class StreamService {
|
|
|
//TODO steam can't trigger end
|
|
|
steam.on('end', () => {
|
|
|
steamByteLength = 0;
|
|
|
- // console.log('stream end');
|
|
|
+ // this.logger.log('stream end');
|
|
|
const stop = performance.now();
|
|
|
const inMillSeconds = stop - start;
|
|
|
const rounded = Number(inMillSeconds).toFixed(3);
|
|
|
- console.log(`[timer]-当前流:${stream.clipPath}流耗时-->${rounded}ms`);
|
|
|
+ this.logger.log(
|
|
|
+ `[timer]-当前流:${stream.clipPath}流耗时-->${rounded}ms`,
|
|
|
+ );
|
|
|
if (this.onSteaming.value) {
|
|
|
this.onSteaming.next(false);
|
|
|
}
|