|
@@ -142,7 +142,6 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
|
|
|
async rotate(request: RotateRequest) {
|
|
|
try {
|
|
|
-
|
|
|
const reply = this.sceneGrpcService.rotate(request);
|
|
|
if (!this.onSteaming) {
|
|
|
const redisMeta = await this.cacheService.rpop(
|
|
@@ -157,28 +156,28 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
console.log('mediaSrc', meta.mediaSrc);
|
|
|
|
|
|
if (meta.mediaSrc.length > 0) {
|
|
|
- const testclipPath = meta.mediaSrc.replace(
|
|
|
- '/mnt/oss/metaverse/scene/0000000001/100/',
|
|
|
- '',
|
|
|
- );
|
|
|
- console.log('testclipPath', testclipPath);
|
|
|
- // const demoPath =
|
|
|
- // this.frameCnt > 10
|
|
|
- // ? path.join(__dirname, '../ws/video/53.h264')
|
|
|
- // : path.join(__dirname, '../ws/video/2.h264');
|
|
|
- const demoPath = path.join(
|
|
|
- __dirname,
|
|
|
- `../ws/video/${testclipPath}`,
|
|
|
- );
|
|
|
- delete meta.mediaSrc;
|
|
|
- const stream: StreamFrameType = {
|
|
|
- frame: this.frameCnt,
|
|
|
- clipPath: demoPath,
|
|
|
- metaData: JSON.stringify(meta),
|
|
|
- serverTime: 754873824,
|
|
|
- DIR: 1,
|
|
|
- };
|
|
|
- this.streamService.pushFrameToSteam(stream);
|
|
|
+ // const testclipPath = meta.mediaSrc.replace(
|
|
|
+ // '/mnt/oss/metaverse/scene/0000000001/100/',
|
|
|
+ // '',
|
|
|
+ // );
|
|
|
+ // console.log('testclipPath', testclipPath);
|
|
|
+ // // const demoPath =
|
|
|
+ // // this.frameCnt > 10
|
|
|
+ // // ? path.join(__dirname, '../ws/video/53.h264')
|
|
|
+ // // : path.join(__dirname, '../ws/video/2.h264');
|
|
|
+ // const demoPath = path.join(
|
|
|
+ // __dirname,
|
|
|
+ // `../ws/video/${testclipPath}`,
|
|
|
+ // );
|
|
|
+ // delete meta.mediaSrc;
|
|
|
+ // const stream: StreamFrameType = {
|
|
|
+ // frame: this.frameCnt,
|
|
|
+ // clipPath: demoPath,
|
|
|
+ // metaData: JSON.stringify(meta),
|
|
|
+ // serverTime: 754873824,
|
|
|
+ // DIR: 3,
|
|
|
+ // };
|
|
|
+ // this.streamService.pushFrameToSteam(stream);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -248,13 +247,13 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
}
|
|
|
updateStatus() {
|
|
|
const reply = {
|
|
|
- data: { action_type: 1009, echo_msg: { echoMsg: '1652857098550' } },
|
|
|
+ data: { action_type: 1009, echo_msg: { echoMsg: Date.now() } },
|
|
|
track: false,
|
|
|
};
|
|
|
this.streamService.pushNormalDataToStream(reply);
|
|
|
}
|
|
|
|
|
|
- updateUserStatus() {
|
|
|
+ async updateUserStatus() {
|
|
|
const reply = {
|
|
|
actionType: 1024,
|
|
|
pointType: 100,
|
|
@@ -326,7 +325,20 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
code: 0,
|
|
|
msg: '',
|
|
|
};
|
|
|
- this.streamService.pushNormalDataToStream(reply);
|
|
|
+ const redisMeta = await this.cacheService.rpop(
|
|
|
+ `updateFrameMetadata:${this.user_id}`,
|
|
|
+ );
|
|
|
+ //TODO 接入redis数据
|
|
|
+ console.log('redisMeta', redisMeta);
|
|
|
+ if (redisMeta && redisMeta.length > 0) {
|
|
|
+ const meta = JSON.parse(redisMeta);
|
|
|
+ 'mediaSrc' in meta && delete meta.mediaSrc;
|
|
|
+ meta.action_type = 1024;
|
|
|
+ this.streamService.pushNormalDataToStream(meta);
|
|
|
+ } else {
|
|
|
+ this.streamService.pushNormalDataToStream(reply);
|
|
|
+ }
|
|
|
+ // this.streamService.pushNormalDataToStream(reply);
|
|
|
}
|
|
|
handleStartCountingFrame() {
|
|
|
this._frameInteval = setInterval(async () => {
|