@ikonai/sdk 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{audio-playback-worker-YOW1Tosq.js → audio-playback-worker-DPybcm1k.js} +174 -154
- package/assets/{protocol-worker-BnPqA34K.js → protocol-worker-DIKCgk1A.js} +69 -73
- package/assets/{video-capture-worker-y4Nlx7f9.js → video-capture-worker-DP3lFDjq.js} +62 -62
- package/assets/{video-playback-worker-CRGdbDmu.js → video-playback-worker-qauTQ7Et.js} +260 -240
- package/index.js +739 -719
- package/package.json +1 -1
|
@@ -7,31 +7,31 @@ function Z(t) {
|
|
|
7
7
|
const e = nt(t), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
8
8
|
if (e.length < 27)
|
|
9
9
|
throw new Error("Protocol payload too short");
|
|
10
|
-
const i = r.getUint32(0, !0), n = r.getUint32(4, !0), E = r.getUint32(8, !0),
|
|
11
|
-
if (27 +
|
|
10
|
+
const i = r.getUint32(0, !0), n = r.getUint32(4, !0), E = r.getUint32(8, !0), a = r.getUint32(12, !0), s = r.getUint32(16, !0), I = r.getUint32(20, !0), C = r.getUint8(24), N = r.getUint8(25), U = r.getUint8(26);
|
|
11
|
+
if (27 + I * 4 > e.length)
|
|
12
12
|
throw new Error("Protocol header exceeds payload length");
|
|
13
|
-
const
|
|
13
|
+
const A = [];
|
|
14
14
|
let R = 27;
|
|
15
|
-
for (let h = 0; h <
|
|
16
|
-
|
|
15
|
+
for (let h = 0; h < I; h++)
|
|
16
|
+
A.push(r.getUint32(R, !0)), R += 4;
|
|
17
17
|
return {
|
|
18
18
|
length: i,
|
|
19
19
|
opcode: n,
|
|
20
20
|
senderId: E,
|
|
21
|
-
trackId:
|
|
21
|
+
trackId: a,
|
|
22
22
|
sequenceId: s,
|
|
23
|
-
targetIds:
|
|
23
|
+
targetIds: A,
|
|
24
24
|
payloadVersion: C,
|
|
25
25
|
payloadType: N,
|
|
26
26
|
flags: U
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function b(t, e, r, i, n) {
|
|
30
|
-
const E = n?.trackId ?? 0,
|
|
31
|
-
|
|
30
|
+
const E = n?.trackId ?? 0, a = n?.sequenceId ?? 0, s = n?.flags ?? 0, I = n?.targetIds ?? [], C = n?.payloadType ?? 8, N = 27 + I.length * 4, U = N + e.length, u = new Uint8Array(U), A = new DataView(u.buffer);
|
|
31
|
+
A.setUint32(0, U, !0), A.setUint32(4, t >>> 0, !0), A.setUint32(8, i >>> 0, !0), A.setUint32(12, E >>> 0, !0), A.setUint32(16, a >>> 0, !0), A.setUint32(20, I.length >>> 0, !0), A.setUint8(24, r & 255), A.setUint8(25, C & 255), A.setUint8(26, s & 255);
|
|
32
32
|
let R = 27;
|
|
33
|
-
for (let h = 0; h <
|
|
34
|
-
|
|
33
|
+
for (let h = 0; h < I.length; h++)
|
|
34
|
+
A.setUint32(R, I[h] >>> 0, !0), R += 4;
|
|
35
35
|
return u.set(e, N), u;
|
|
36
36
|
}
|
|
37
37
|
var w = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(w || {});
|
|
@@ -93,8 +93,8 @@ class L {
|
|
|
93
93
|
writeDictionaryField(e, r, i, n) {
|
|
94
94
|
const E = new H(r, i);
|
|
95
95
|
n(E);
|
|
96
|
-
const
|
|
97
|
-
this.writeVariableField(e, 10,
|
|
96
|
+
const a = E.finish();
|
|
97
|
+
this.writeVariableField(e, 10, a);
|
|
98
98
|
}
|
|
99
99
|
finish() {
|
|
100
100
|
return this.closed || (this.buffer.writeByte(tt), this.closed = !0, this.cached = this.buffer.toUint8Array()), this.cached;
|
|
@@ -442,8 +442,8 @@ class _ {
|
|
|
442
442
|
const r = e.replace(/-/g, "");
|
|
443
443
|
if (r.length !== 32)
|
|
444
444
|
throw new Error("Guid string must be 32 hex characters");
|
|
445
|
-
const i = new Uint8Array(16), n = _.parseHexSlice(r, 0, 8), E = _.parseHexSlice(r, 8, 4),
|
|
446
|
-
_.writeUInt32LE(i, 0, n), _.writeUInt16LE(i, 4, E), _.writeUInt16LE(i, 6,
|
|
445
|
+
const i = new Uint8Array(16), n = _.parseHexSlice(r, 0, 8), E = _.parseHexSlice(r, 8, 4), a = _.parseHexSlice(r, 12, 4);
|
|
446
|
+
_.writeUInt32LE(i, 0, n), _.writeUInt16LE(i, 4, E), _.writeUInt16LE(i, 6, a);
|
|
447
447
|
for (let s = 0; s < 8; s++)
|
|
448
448
|
i[8 + s] = _.parseHexSlice(r, 16 + s * 2, 2);
|
|
449
449
|
return new _(i);
|
|
@@ -572,21 +572,21 @@ function d(t) {
|
|
|
572
572
|
function nt(t) {
|
|
573
573
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
574
574
|
}
|
|
575
|
-
var A = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(A || {}), v = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT = 524297] = "ANALYTICS_DEVTOOLS_CONSOLE_OUTPUT", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(v || {});
|
|
576
|
-
const k = 1, Et = 8388609, _t = 164808083,
|
|
575
|
+
var T = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(T || {}), v = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(v || {});
|
|
576
|
+
const k = 1, Et = 8388609, _t = 164808083, It = 1368629611, at = 2739413426, st = 2768375929, At = 2950031986, Tt = 3284746250, Nt = 4065070594;
|
|
577
577
|
function ht(t) {
|
|
578
578
|
const e = {};
|
|
579
579
|
return Ct(e), t && Object.assign(e, t), e;
|
|
580
580
|
}
|
|
581
581
|
function Ct(t) {
|
|
582
|
-
return t.Description = "", t.Codec =
|
|
582
|
+
return t.Description = "", t.Codec = T.H264, t.Width = 0, t.Height = 0, t.Framerate = 30, t.Bitrate = 0, t.IsHardwareAccelerated = !1, t;
|
|
583
583
|
}
|
|
584
584
|
function ut(t) {
|
|
585
585
|
const e = new L(k);
|
|
586
586
|
return lt(t, e), e.finish();
|
|
587
587
|
}
|
|
588
588
|
function lt(t, e) {
|
|
589
|
-
e.writeInt32Field(_t, t.Framerate | 0), e.writeStringField(
|
|
589
|
+
e.writeInt32Field(_t, t.Framerate | 0), e.writeStringField(It, t.Description), e.writeBoolField(at, t.IsHardwareAccelerated), e.writeInt32Field(st, t.Bitrate | 0), e.writeInt32Field(At, t.Height | 0), e.writeInt32Field(Tt, t.Codec), e.writeInt32Field(Nt, t.Width | 0);
|
|
590
590
|
}
|
|
591
591
|
function Ut(t, e, r) {
|
|
592
592
|
const i = ut(t);
|
|
@@ -602,12 +602,12 @@ function Dt(t) {
|
|
|
602
602
|
}
|
|
603
603
|
function ct(t) {
|
|
604
604
|
const e = new L(W);
|
|
605
|
-
return
|
|
605
|
+
return Pt(t, e), e.finish();
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function Pt(t, e) {
|
|
608
608
|
e.writeUInt64Field(ot, t.TimestampInUs), e.writeUInt32Field(ft, t.DurationInUs >>> 0), e.writeBinaryField(St, t.Data), e.writeBoolField(wt, t.IsKey), e.writeInt32Field(yt, t.FrameNumber | 0);
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Ot(t, e, r) {
|
|
611
611
|
const i = ct(t);
|
|
612
612
|
return b(Rt, i, W, e, r);
|
|
613
613
|
}
|
|
@@ -673,7 +673,7 @@ const K = ["h264", "vp8", "vp9", "av1"], mt = [
|
|
|
673
673
|
// 360p
|
|
674
674
|
], bt = 0.1, Ht = 30, dt = 5e4, Kt = 5e5, vt = 8e6, kt = 8, Wt = 3, g = (t) => self.postMessage(t);
|
|
675
675
|
let l = null, o = null;
|
|
676
|
-
function
|
|
676
|
+
function P(t, e) {
|
|
677
677
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
678
678
|
g({ type: "error", captureId: e, error: { name: r.name, message: r.message, stack: r.stack } });
|
|
679
679
|
}
|
|
@@ -691,18 +691,18 @@ function Yt(t) {
|
|
|
691
691
|
return Array.from(r);
|
|
692
692
|
}
|
|
693
693
|
function xt(t) {
|
|
694
|
-
return t === "h264" ?
|
|
694
|
+
return t === "h264" ? T.H264 : t === "vp8" ? T.Vp8 : t === "vp9" ? T.Vp9 : t === "av1" ? T.Av1 : T.Unknown;
|
|
695
695
|
}
|
|
696
696
|
const Xt = {
|
|
697
|
-
[
|
|
698
|
-
[
|
|
699
|
-
[
|
|
700
|
-
[
|
|
701
|
-
[
|
|
697
|
+
[T.Unknown]: [],
|
|
698
|
+
[T.H264]: X,
|
|
699
|
+
[T.Vp8]: [Gt],
|
|
700
|
+
[T.Vp9]: $,
|
|
701
|
+
[T.Av1]: j
|
|
702
702
|
};
|
|
703
703
|
function $t(t, e, r, i) {
|
|
704
|
-
const n = t * e, E = bt * (r / Ht),
|
|
705
|
-
return Math.max(dt, Math.floor(i ?? Math.max(Kt, Math.min(
|
|
704
|
+
const n = t * e, E = bt * (r / Ht), a = Math.floor(n * E);
|
|
705
|
+
return Math.max(dt, Math.floor(i ?? Math.max(Kt, Math.min(a, vt))));
|
|
706
706
|
}
|
|
707
707
|
function jt(t, e) {
|
|
708
708
|
const r = [{ width: t, height: e }];
|
|
@@ -710,7 +710,7 @@ function jt(t, e) {
|
|
|
710
710
|
(i.width < t || i.height < e) && (r.some((n) => n.width === i.width && n.height === i.height) || r.push(i));
|
|
711
711
|
return r;
|
|
712
712
|
}
|
|
713
|
-
async function Qt(t, e, r, i, n, E,
|
|
713
|
+
async function Qt(t, e, r, i, n, E, a) {
|
|
714
714
|
const s = {
|
|
715
715
|
codec: e,
|
|
716
716
|
width: r,
|
|
@@ -718,38 +718,38 @@ async function Qt(t, e, r, i, n, E, I) {
|
|
|
718
718
|
bitrate: n,
|
|
719
719
|
framerate: E,
|
|
720
720
|
latencyMode: "realtime",
|
|
721
|
-
...t ===
|
|
721
|
+
...t === T.H264 ? { avc: { format: "annexb" } } : {}
|
|
722
722
|
};
|
|
723
723
|
if (typeof VideoEncoder?.isConfigSupported != "function")
|
|
724
724
|
return null;
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
725
|
+
if (a) {
|
|
726
|
+
const I = { ...s, hardwareAcceleration: a };
|
|
727
727
|
try {
|
|
728
|
-
const C = await VideoEncoder.isConfigSupported(
|
|
728
|
+
const C = await VideoEncoder.isConfigSupported(I);
|
|
729
729
|
if (C.supported) {
|
|
730
|
-
const N = C.config ??
|
|
730
|
+
const N = C.config ?? I;
|
|
731
731
|
return { config: N, isHardwareAccelerated: N.hardwareAcceleration === "prefer-hardware" };
|
|
732
732
|
}
|
|
733
733
|
} catch {
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
try {
|
|
737
|
-
const
|
|
738
|
-
if (
|
|
739
|
-
return { config:
|
|
737
|
+
const I = await VideoEncoder.isConfigSupported(s);
|
|
738
|
+
if (I.supported)
|
|
739
|
+
return { config: I.config ?? s, isHardwareAccelerated: !1 };
|
|
740
740
|
} catch {
|
|
741
741
|
}
|
|
742
742
|
return null;
|
|
743
743
|
}
|
|
744
744
|
async function qt(t, e, r) {
|
|
745
|
-
const i = Math.max(1, Math.floor(r?.framerate ?? x)), n = Yt(r?.preferredCodecs),
|
|
746
|
-
for (const
|
|
747
|
-
const C = $t(
|
|
748
|
-
for (const N of
|
|
745
|
+
const i = Math.max(1, Math.floor(r?.framerate ?? x)), n = Yt(r?.preferredCodecs), a = r?.hardwareAcceleration === "preferSoftware" ? ["prefer-software", "prefer-hardware", void 0] : ["prefer-hardware", "prefer-software", void 0], s = jt(t, e);
|
|
746
|
+
for (const I of s) {
|
|
747
|
+
const C = $t(I.width, I.height, i, r?.bitrate);
|
|
748
|
+
for (const N of a)
|
|
749
749
|
for (const U of n) {
|
|
750
|
-
const u = xt(U),
|
|
751
|
-
for (const R of
|
|
752
|
-
const h = await Qt(u, R,
|
|
750
|
+
const u = xt(U), A = Xt[u] ?? [];
|
|
751
|
+
for (const R of A) {
|
|
752
|
+
const h = await Qt(u, R, I.width, I.height, C, i, N);
|
|
753
753
|
if (h)
|
|
754
754
|
return { codec: u, config: h.config, isHardwareAccelerated: h.isHardwareAccelerated };
|
|
755
755
|
}
|
|
@@ -792,7 +792,7 @@ function te(t, e) {
|
|
|
792
792
|
const r = t.forceKeyframe || t.frameCounter > 0 && t.frameCounter % t.keyFrameIntervalFrames === 0;
|
|
793
793
|
t.forceKeyframe = !1, t.encoder.encode(e, { keyFrame: r });
|
|
794
794
|
} catch (r) {
|
|
795
|
-
|
|
795
|
+
P(r, t.captureId), t.forceKeyframe = !0;
|
|
796
796
|
} finally {
|
|
797
797
|
try {
|
|
798
798
|
e.close();
|
|
@@ -810,7 +810,7 @@ async function ee(t) {
|
|
|
810
810
|
r && te(t, r);
|
|
811
811
|
}
|
|
812
812
|
} catch (e) {
|
|
813
|
-
t.stopped ||
|
|
813
|
+
t.stopped || P(e, t.captureId);
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
async function re(t) {
|
|
@@ -818,7 +818,7 @@ async function re(t) {
|
|
|
818
818
|
throw new Error("Video capture worker missing send port");
|
|
819
819
|
if (f.get(t.captureId))
|
|
820
820
|
return;
|
|
821
|
-
const r = Math.max(1, Math.floor(t.width)), i = Math.max(1, Math.floor(t.height)), n = await qt(r, i, t.options), E = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? Mt)),
|
|
821
|
+
const r = Math.max(1, Math.floor(t.width)), i = Math.max(1, Math.floor(t.height)), n = await qt(r, i, t.options), E = Math.max(1, Math.floor(t.options?.keyFrameIntervalFrames ?? Mt)), a = n.config.width ?? r, s = n.config.height ?? i, I = n.config.framerate ?? x, C = n.config.bitrate ?? 0, N = t.trackSettings?.frameRate, U = N ?? I, u = new VideoEncoder({
|
|
822
822
|
output: (S) => {
|
|
823
823
|
const c = f.get(t.captureId);
|
|
824
824
|
if (!c || c.stopped)
|
|
@@ -831,25 +831,25 @@ async function re(t) {
|
|
|
831
831
|
IsKey: S.type === "key",
|
|
832
832
|
TimestampInUs: BigInt(Math.max(0, Math.round(S.timestamp ?? 0))),
|
|
833
833
|
DurationInUs: Math.max(0, Math.round(S.duration ?? 0))
|
|
834
|
-
}), z =
|
|
834
|
+
}), z = Ot(q, c.senderId, { trackId: c.trackId });
|
|
835
835
|
Zt(G), m(z);
|
|
836
836
|
},
|
|
837
837
|
error: (S) => {
|
|
838
|
-
|
|
838
|
+
P(S, t.captureId);
|
|
839
839
|
}
|
|
840
840
|
});
|
|
841
841
|
u.configure(n.config);
|
|
842
|
-
const
|
|
842
|
+
const A = n.isHardwareAccelerated ? "hardware" : "software", R = N !== void 0 ? `${Math.round(U)}fps (track)` : `${Math.round(I)}fps (configured)`;
|
|
843
843
|
g({
|
|
844
844
|
type: "log",
|
|
845
|
-
message: `Encoder configured: codec=${n.config.codec}, ${
|
|
845
|
+
message: `Encoder configured: codec=${n.config.codec}, ${a}x${s}@${R}, bitrate=${C}bps, hw=${A}`
|
|
846
846
|
});
|
|
847
|
-
const h = t.readable.getReader(),
|
|
847
|
+
const h = t.readable.getReader(), O = {
|
|
848
848
|
captureId: t.captureId,
|
|
849
849
|
kind: t.kind,
|
|
850
850
|
senderId: t.senderId,
|
|
851
851
|
trackId: t.trackId,
|
|
852
|
-
width:
|
|
852
|
+
width: a,
|
|
853
853
|
height: s,
|
|
854
854
|
codec: n.codec,
|
|
855
855
|
encoder: u,
|
|
@@ -861,12 +861,12 @@ async function re(t) {
|
|
|
861
861
|
stopped: !1,
|
|
862
862
|
isHardwareAccelerated: n.isHardwareAccelerated
|
|
863
863
|
};
|
|
864
|
-
f.set(t.captureId,
|
|
864
|
+
f.set(t.captureId, O), M.set(t.trackId, t.captureId), m(
|
|
865
865
|
Ut(
|
|
866
866
|
ht({
|
|
867
867
|
Description: `${t.kind}:${t.captureId}`,
|
|
868
|
-
Codec:
|
|
869
|
-
Width:
|
|
868
|
+
Codec: O.codec,
|
|
869
|
+
Width: a,
|
|
870
870
|
Height: s,
|
|
871
871
|
Framerate: U,
|
|
872
872
|
Bitrate: C,
|
|
@@ -875,7 +875,7 @@ async function re(t) {
|
|
|
875
875
|
t.senderId,
|
|
876
876
|
{ trackId: t.trackId }
|
|
877
877
|
)
|
|
878
|
-
), g({ type: "started", captureId: t.captureId, codec:
|
|
878
|
+
), g({ type: "started", captureId: t.captureId, codec: O.codec, width: a, height: s }), ee(O);
|
|
879
879
|
}
|
|
880
880
|
async function Q(t) {
|
|
881
881
|
const e = f.get(t);
|
|
@@ -952,11 +952,11 @@ self.addEventListener("message", (t) => {
|
|
|
952
952
|
return;
|
|
953
953
|
}
|
|
954
954
|
if (e.type === "start") {
|
|
955
|
-
re(e).catch((r) =>
|
|
955
|
+
re(e).catch((r) => P(r, e.captureId));
|
|
956
956
|
return;
|
|
957
957
|
}
|
|
958
958
|
if (e.type === "stop") {
|
|
959
|
-
Q(e.captureId).catch((r) =>
|
|
959
|
+
Q(e.captureId).catch((r) => P(r, e.captureId));
|
|
960
960
|
return;
|
|
961
961
|
}
|
|
962
962
|
e.type === "dispose" && ne();
|