|
@@ -25,7 +25,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;
|
|
@@ -60,6 +60,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
private walkingSub: any;
|
|
|
private joystickSub: any;
|
|
|
private clickQueueSub: any;
|
|
|
+ private _rotateCurrentFame = -1;
|
|
|
|
|
|
private streamServiceSub: any;
|
|
|
// private roRequestQueue: RxQueue = new DelayQueue(20);
|
|
@@ -296,8 +297,6 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
} else {
|
|
|
// 正常rotate
|
|
|
redisMeta = await this.rotateService.seqExeRotate(request);
|
|
|
- //this.logger.log(redisMeta);
|
|
|
- //debugger;
|
|
|
}
|
|
|
|
|
|
if (redisMeta && 'mediaSrc' in redisMeta) {
|
|
@@ -678,14 +677,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(
|
|
@@ -860,19 +859,28 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
this.rotateframeCnt += 1;
|
|
|
|
|
|
stream.frame = this.rotateframeCnt;
|
|
|
- stream.DIR = this.rotateFirstIDR ? 1 : 3;
|
|
|
+ this._rotateCurrentFame = this.rotateframeCnt;
|
|
|
+
|
|
|
+ const IDRflag = this._rotateCurrentFame % 5 === 0 ? 1 : 3;
|
|
|
+ this.logger.log(
|
|
|
+ `当前rotate ,mainframeCnt:${this.frameCnt.getValue()}, rotateframeCnt:${
|
|
|
+ this.rotateframeCnt
|
|
|
+ } IDRflag:${IDRflag}`,
|
|
|
+ );
|
|
|
+ stream.DIR = this.rotateFirstIDR ? 1 : IDRflag;
|
|
|
+
|
|
|
if (this.rotateFirstIDR) {
|
|
|
this.rotateFirstIDR = false;
|
|
|
}
|
|
|
|
|
|
this.logger.log(
|
|
|
'[media-rotate]: ' +
|
|
|
- ', frame: ' +
|
|
|
- stream.frame +
|
|
|
- ', rotateframeCnt: ' +
|
|
|
- this.rotateframeCnt +
|
|
|
- ', clipPath: ' +
|
|
|
- stream.clipPath,
|
|
|
+ ', frame: ' +
|
|
|
+ stream.frame +
|
|
|
+ ', rotateframeCnt: ' +
|
|
|
+ this.rotateframeCnt +
|
|
|
+ ', clipPath: ' +
|
|
|
+ stream.clipPath,
|
|
|
// stream.metaData,
|
|
|
);
|
|
|
// this.logger.log(
|
|
@@ -942,7 +950,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,
|