decord/source/stores/VideoStreamStore.tsx

196 lines
5.5 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10727
// Function ID: 10728
2026-07-29 08:29:29 +00:00
// Name: makeTimeoutKey
2026-08-25 06:04:03 +00:00
// Dependencies: [676, 4444, 589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-25 06:04:03 +00:00
// Module 10727 (makeTimeoutKey)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import initializeDefault from "initialize" /* 589 */;
import ME from "ME" /* 676 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-08-25 06:04:03 +00:00
import DesktopSources from "DesktopSources" /* 4444 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
function makeTimeoutKey(arg0, arg1) {
return "" + arg0 + ":" + arg1;
2026-07-20 16:05:17 +00:00
}
function clearUser(arg0, arg1) {
2026-07-29 08:29:29 +00:00
let tmp4 = arg2;
2026-07-20 16:05:17 +00:00
if (arg2 === undefined) {
2026-07-29 08:29:29 +00:00
tmp4 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[arg0]) {
2026-07-29 08:29:29 +00:00
let tmp19 = arg1;
let tmp6 = arg1;
if (arg1 == null) {
tmp6 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (null != tmp5[tmp6]) {
2026-07-20 16:05:17 +00:00
const _Object = Object;
const values = Object.values(MediaEngineContextTypes);
2026-07-29 08:29:29 +00:00
const iter = values[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp11 = nextResult;
let tmp12 = tmp4 !== nextResult && null != tmp4;
if (!tmp12) {
let tmp13 = nextResult;
delete tmp[tmp2];
let tmp14 = closure_5;
let tmp16 = tmp4;
2026-07-23 10:11:24 +00:00
let tmp15 = makeTimeoutKey;
2026-07-29 08:29:29 +00:00
if (tmp4 == null) {
tmp16 = nextResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp15Result = tmp15(tmp16, arg0);
delete tmp3[tmp2];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp19 == null) {
tmp19 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap[arg0][tmp19] = tmp7;
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-24 06:08:38 +00:00
const NULL_STRING_GUILD_ID = ME.NULL_STRING_GUILD_ID;
const MediaEngineContextTypes = DesktopSources.MediaEngineContextTypes;
2026-07-29 08:29:29 +00:00
let c2 = null;
let c3 = null;
let closure_4 = {};
let closure_5 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class VideoStreamStore extends Store {
}
const prototype = VideoStreamStore.prototype;
prototype["getStreamId"] = function getStreamId(arg0, arg1) {
let DEFAULT = arg2;
if (arg2 === undefined) {
DEFAULT = MediaEngineContextTypes.DEFAULT;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let streamId;
if (dependencyMap[arg0] != null) {
let tmp4 = arg1;
if (arg1 == null) {
tmp4 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2[tmp4] != null) {
if (tmp5[DEFAULT] != null) {
streamId = tmp6.streamId;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
return streamId;
};
prototype["getUserStreamData"] = function getUserStreamData(userId, guildId, STREAM) {
let DEFAULT = STREAM;
if (STREAM === undefined) {
DEFAULT = MediaEngineContextTypes.DEFAULT;
}
let tmp3;
if (dependencyMap[userId] != null) {
let tmp4 = guildId;
if (guildId == null) {
tmp4 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2[tmp4] != null) {
tmp3 = tmp5[DEFAULT];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
return tmp3;
};
prototype["getTimedoutVideos"] = function getTimedoutVideos() {
return closure_5;
};
prototype["getTimedoutVideo"] = function getTimedoutVideo(arg0, arg1) {
return dependencyMap2["" + arg0 + ":" + arg1];
};
VideoStreamStore.displayName = "VideoStreamStore";
2026-08-24 06:08:38 +00:00
const videoStreamStore = new VideoStreamStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen(user) {
const id = user.user.id;
const sessionId = user.sessionId;
},
OVERLAY_INITIALIZE: function handleOverlayInitialize(user) {
const id = user.user.id;
const sessionId = user.sessionId;
},
RTC_CONNECTION_VIDEO: function handleVideo(arg0) {
({ userId, guildId, streamId, context } = arg0);
if (null != streamId) {
2026-07-23 10:11:24 +00:00
if (!(userId in dependencyMap)) {
dependencyMap[userId] = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tmp8 = guildId;
2026-07-29 08:29:29 +00:00
if (guildId == null) {
2026-07-23 10:11:24 +00:00
tmp8 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = dependencyMap[userId][tmp8];
2026-07-29 08:29:29 +00:00
if (obj == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
2026-07-29 08:29:29 +00:00
let tmp10 = guildId;
if (guildId == null) {
tmp10 = NULL_STRING_GUILD_ID;
2026-07-20 16:05:17 +00:00
}
obj = {};
const merged = Object.assign(obj);
2026-07-29 08:29:29 +00:00
obj = { streamId: null };
obj[0] = streamId;
2026-07-20 16:05:17 +00:00
obj[context] = obj;
2026-07-29 08:29:29 +00:00
dependencyMap[userId][tmp10] = obj;
const _HermesInternal = HermesInternal;
const combined = "" + context + ":" + userId;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
} else {
clearUser(userId, guildId, context);
}
},
VOICE_STATE_UPDATES: function handleVoiceStateUpdates(voiceStates) {
voiceStates = voiceStates.voiceStates;
return voiceStates.reduce((arg0, arg1) => {
({ userId, channelId, guildId } = arg1);
if (null == channelId) {
2026-07-29 08:29:29 +00:00
if (userId === closure_2) {
if (tmp !== closure_3) {
2026-07-20 16:05:17 +00:00
return arg0;
} else {
2026-07-29 08:29:29 +00:00
const table = {};
2026-08-24 06:08:38 +00:00
closure_5 = {};
2026-07-20 16:05:17 +00:00
}
}
return true;
}
if (null == channelId) {
let tmp5;
2026-07-29 08:29:29 +00:00
if (table[userId] != null) {
2026-07-20 16:05:17 +00:00
let tmp6 = guildId;
2026-07-29 08:29:29 +00:00
if (guildId == null) {
tmp6 = closure_0;
2026-07-20 16:05:17 +00:00
}
tmp5 = tmp4[tmp6];
}
if (null != tmp5) {
2026-07-29 08:29:29 +00:00
callback(userId, guildId);
2026-07-20 16:05:17 +00:00
}
}
return arg0;
}, false);
},
VIDEO_STREAM_READY_TIMEOUT: function handleVideoStreamReadyTimeout(arg0) {
({ userId, mediaContext } = arg0);
({ videoStreamId, streamKey } = arg0);
2026-07-29 08:29:29 +00:00
closure_5["" + mediaContext + ":" + userId] = { videoStreamId, userId, streamKey, mediaContext };
2026-07-20 16:05:17 +00:00
},
CLEAR_VIDEO_STREAM_READY_TIMEOUT: function handleClearVideoStreamTimeout(arg0) {
2026-07-29 08:29:29 +00:00
if (null == dependencyMap2["" + arg0.mediaContext + ":" + arg0.userId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
});
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("stores/VideoStreamStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default videoStreamStore;