|
@@ -38,7 +38,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
private rotateService: RotateService,
|
|
|
private moveService: MoveService,
|
|
|
private getRouterService: GetRouterService, // @InjectQueue('rotate') private rotateQueue: Queue, // @InjectQueue('walking') private walkingQueue: Queue,
|
|
|
- ) { }
|
|
|
+ ) {}
|
|
|
@Client(grpcClientOptions) private readonly client: ClientGrpc;
|
|
|
|
|
|
public _frameInteval: NodeJS.Timeout;
|
|
@@ -287,7 +287,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
const rounded = Number(inMillSeconds).toFixed(3);
|
|
|
this.logger.log(
|
|
|
`[timer]-rotate-入队列前: ${rounded}ms -->` +
|
|
|
- JSON.stringify(stream),
|
|
|
+ JSON.stringify(stream),
|
|
|
);
|
|
|
if (!this.stopRotated) {
|
|
|
await this.seqExehandleRotateStream(stream);
|
|
@@ -326,6 +326,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
// 在未开始前开始
|
|
|
if (!this.onRotating.value) {
|
|
|
this._rotateStartFame.next(this.frameCnt.value);
|
|
|
+ console.log('旋转开始记录帧:::--->', this._rotateStartFame.value);
|
|
|
}
|
|
|
|
|
|
this.onRotating.next(true);
|
|
@@ -336,12 +337,14 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
stream.DIR = this.rotateFirstIDR ? 1 : IDRflag;
|
|
|
|
|
|
console.log(
|
|
|
- '[旋转信息:::info--->]:clipPath: %s, frameCnt: %s,_rotateCountFame: %s, stream.frame %s , IDRflag: %s',
|
|
|
+ '[旋转信息:::info--->]:clipPath: %s, main-frameCnt: %s, stream.frame %s ,_rotateStartFame: %s, _rotateCountFame: %s, IDRflag: %s',
|
|
|
stream.clipPath,
|
|
|
// this._rotateStartFame.value,
|
|
|
this.frameCnt.value,
|
|
|
- this._rotateCountFame,
|
|
|
stream.frame,
|
|
|
+ this._rotateStartFame.value,
|
|
|
+ this._rotateCountFame,
|
|
|
+
|
|
|
// this.rotateframeCnt,
|
|
|
IDRflag,
|
|
|
);
|
|
@@ -479,16 +482,16 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
const playerAngle = newUserStates.playerState.player.angle;
|
|
|
this.logger.log(
|
|
|
'stop-data-0' +
|
|
|
- 'trace_id: ' +
|
|
|
- trace_id +
|
|
|
- 'userId:' +
|
|
|
- userId +
|
|
|
- 'breakPointId :' +
|
|
|
- breakPointId +
|
|
|
- 'cameraAngle :' +
|
|
|
- JSON.stringify(cameraAngle) +
|
|
|
- 'playerAngle: ' +
|
|
|
- JSON.stringify(playerAngle),
|
|
|
+ 'trace_id: ' +
|
|
|
+ trace_id +
|
|
|
+ 'userId:' +
|
|
|
+ userId +
|
|
|
+ 'breakPointId :' +
|
|
|
+ breakPointId +
|
|
|
+ 'cameraAngle :' +
|
|
|
+ JSON.stringify(cameraAngle) +
|
|
|
+ 'playerAngle: ' +
|
|
|
+ JSON.stringify(playerAngle),
|
|
|
);
|
|
|
//debugger;
|
|
|
console.log('moveService.stop-1:' + breakPointId);
|
|
@@ -691,15 +694,15 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
console.log('进入1 - searchRoad');
|
|
|
this.logger.log(
|
|
|
'handleWalking-users' +
|
|
|
- JSON.stringify(this.moveService.users) +
|
|
|
- ' this.user_id: ' +
|
|
|
- this.user_id,
|
|
|
+ JSON.stringify(this.moveService.users) +
|
|
|
+ ' this.user_id: ' +
|
|
|
+ this.user_id,
|
|
|
);
|
|
|
this.logger.log(
|
|
|
'handleWalking-currentUser' +
|
|
|
- JSON.stringify(user) +
|
|
|
- ' this.user_id: ' +
|
|
|
- this.user_id,
|
|
|
+ JSON.stringify(user) +
|
|
|
+ ' this.user_id: ' +
|
|
|
+ this.user_id,
|
|
|
);
|
|
|
console.log('path-start' + user.breakPointId);
|
|
|
|
|
@@ -754,16 +757,16 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
if (seqs?.length) {
|
|
|
this.logger.log(
|
|
|
'walking --队列总览:' +
|
|
|
- ' 总段数: ' +
|
|
|
- walkingRes.length +
|
|
|
- ' 镜头帧数:' +
|
|
|
- walkingRes[0].length +
|
|
|
- ' 行走段数:' +
|
|
|
- (walkingRes[0]?.length
|
|
|
- ? walkingRes.length - 1
|
|
|
- : walkingRes.length) +
|
|
|
- ' 队列总帧数:' +
|
|
|
- seqs.length,
|
|
|
+ ' 总段数: ' +
|
|
|
+ walkingRes.length +
|
|
|
+ ' 镜头帧数:' +
|
|
|
+ walkingRes[0].length +
|
|
|
+ ' 行走段数:' +
|
|
|
+ (walkingRes[0]?.length
|
|
|
+ ? walkingRes.length - 1
|
|
|
+ : walkingRes.length) +
|
|
|
+ ' 队列总帧数:' +
|
|
|
+ seqs.length,
|
|
|
);
|
|
|
const stop = performance.now();
|
|
|
const inMillSeconds = stop - start;
|
|
@@ -818,7 +821,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
//console.log('joystickRes有mediaSrc', joystickRes.mediaSrc);
|
|
|
console.log(
|
|
|
'handlejoystick-angle->相机角度-------------------------:' +
|
|
|
- joystickRes['newUserStates'][0].playerState.camera.angle.yaw,
|
|
|
+ joystickRes['newUserStates'][0].playerState.camera.angle.yaw,
|
|
|
);
|
|
|
let streamData: StreamFrameType | StreamMetaType;
|
|
|
|
|
@@ -853,8 +856,8 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
const hasPush = hasMedia
|
|
|
? await this.streamService.pushFrameToSteam(streamData as StreamFrameType)
|
|
|
: await this.streamService.pushMetaDataToSteam(
|
|
|
- streamData as StreamMetaType,
|
|
|
- );
|
|
|
+ streamData as StreamMetaType,
|
|
|
+ );
|
|
|
|
|
|
if (hasPush.done) {
|
|
|
this.isJoystickHasStream = true;
|
|
@@ -955,7 +958,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
const joystickRes = await this.moveService.seqExeJoystick(request);
|
|
|
this.logger.log(
|
|
|
'joystick-breakPointId:' +
|
|
|
- this.moveService.users[this.user_id].breakPointId,
|
|
|
+ this.moveService.users[this.user_id].breakPointId,
|
|
|
);
|
|
|
// 有数据 [0]是rotate数据,[1-infinity]是walking数据
|
|
|
//this.logger.log('joystickRes', JSON.stringify(joystickRes));
|
|
@@ -1037,14 +1040,14 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
};
|
|
|
this.logger.log(
|
|
|
'[media-move]: ' +
|
|
|
- ', moveframeCnt: ' +
|
|
|
- this.moveframeCnt +
|
|
|
- ', clipPath: ' +
|
|
|
- stream.clipPath +
|
|
|
- ', mType: ' +
|
|
|
- stream.mType +
|
|
|
- ', DIR: ' +
|
|
|
- stream.DIR,
|
|
|
+ ', moveframeCnt: ' +
|
|
|
+ this.moveframeCnt +
|
|
|
+ ', clipPath: ' +
|
|
|
+ stream.clipPath +
|
|
|
+ ', mType: ' +
|
|
|
+ stream.mType +
|
|
|
+ ', DIR: ' +
|
|
|
+ stream.DIR,
|
|
|
// stream.metaData,
|
|
|
);
|
|
|
this.logger.log(
|
|
@@ -1292,12 +1295,12 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
this.logger.log('frame', frame);
|
|
|
console.log(
|
|
|
'mock' +
|
|
|
- ' maxMessageSize: ' +
|
|
|
- this.channel.maxMessageSize() +
|
|
|
- ' bytesReceived: ' +
|
|
|
- this.peer.bytesReceived() +
|
|
|
- ' bytesSent: ' +
|
|
|
- this.peer.bytesSent(),
|
|
|
+ ' maxMessageSize: ' +
|
|
|
+ this.channel.maxMessageSize() +
|
|
|
+ ' bytesReceived: ' +
|
|
|
+ this.peer.bytesReceived() +
|
|
|
+ ' bytesSent: ' +
|
|
|
+ this.peer.bytesSent(),
|
|
|
' state: ' + this.peer.state(),
|
|
|
);
|
|
|
if (frame === 1) {
|
|
@@ -1319,7 +1322,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
delete redisData.mediaSrc;
|
|
|
this.logger.log(
|
|
|
`user:${this.user_id}:first render stream` +
|
|
|
- JSON.stringify({ path: clipPath, meta: redisData }),
|
|
|
+ JSON.stringify({ path: clipPath, meta: redisData }),
|
|
|
);
|
|
|
const status = await this.pushFirstRender(
|
|
|
clipPath,
|
|
@@ -1347,17 +1350,17 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
|
|
|
console.log(
|
|
|
'空白流条件-->:' +
|
|
|
- isOk +
|
|
|
- ' onMoving: ' +
|
|
|
- this.onMoving.value +
|
|
|
- ' onRotating: ' +
|
|
|
- this.onRotating.value +
|
|
|
- ' onJoysticking: ' +
|
|
|
- this.onJoysticking.value +
|
|
|
- ' onSteaming: ' +
|
|
|
- this.onSteaming +
|
|
|
- ' firstRender: ' +
|
|
|
- this.firstRender,
|
|
|
+ isOk +
|
|
|
+ ' onMoving: ' +
|
|
|
+ this.onMoving.value +
|
|
|
+ ' onRotating: ' +
|
|
|
+ this.onRotating.value +
|
|
|
+ ' onJoysticking: ' +
|
|
|
+ this.onJoysticking.value +
|
|
|
+ ' onSteaming: ' +
|
|
|
+ this.onSteaming +
|
|
|
+ ' firstRender: ' +
|
|
|
+ this.firstRender,
|
|
|
);
|
|
|
}
|
|
|
|