github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/mediaperceptionprivate/bindings/ffi_bindings.ts (about) 1 import { importModule, Application, heap, Pointer } from "@ffi"; 2 3 importModule("plat/js/webext/mediaperceptionprivate", (A: Application) => { 4 const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser; 5 6 return { 7 "store_AudioSpectrogram": (ptr: Pointer, ref: heap.Ref<any>) => { 8 const x = A.H.get<any>(ref); 9 10 if (typeof x === "undefined") { 11 A.store.Bool(ptr + 4, false); 12 A.store.Ref(ptr + 0, undefined); 13 } else { 14 A.store.Bool(ptr + 4, true); 15 A.store.Ref(ptr + 0, x["values"]); 16 } 17 }, 18 "load_AudioSpectrogram": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 19 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 20 21 x["values"] = A.load.Ref(ptr + 0, undefined); 22 return create === A.H.TRUE ? A.H.push(x) : ref; 23 }, 24 25 "store_AudioHumanPresenceDetection": (ptr: Pointer, ref: heap.Ref<any>) => { 26 const x = A.H.get<any>(ref); 27 28 if (typeof x === "undefined") { 29 A.store.Bool(ptr + 22, false); 30 A.store.Bool(ptr + 21, false); 31 A.store.Float64(ptr + 0, 0); 32 33 A.store.Bool(ptr + 8 + 4, false); 34 A.store.Ref(ptr + 8 + 0, undefined); 35 36 A.store.Bool(ptr + 16 + 4, false); 37 A.store.Ref(ptr + 16 + 0, undefined); 38 } else { 39 A.store.Bool(ptr + 22, true); 40 A.store.Bool(ptr + 21, "humanPresenceLikelihood" in x ? true : false); 41 A.store.Float64( 42 ptr + 0, 43 x["humanPresenceLikelihood"] === undefined ? 0 : (x["humanPresenceLikelihood"] as number) 44 ); 45 46 if (typeof x["noiseSpectrogram"] === "undefined") { 47 A.store.Bool(ptr + 8 + 4, false); 48 A.store.Ref(ptr + 8 + 0, undefined); 49 } else { 50 A.store.Bool(ptr + 8 + 4, true); 51 A.store.Ref(ptr + 8 + 0, x["noiseSpectrogram"]["values"]); 52 } 53 54 if (typeof x["frameSpectrogram"] === "undefined") { 55 A.store.Bool(ptr + 16 + 4, false); 56 A.store.Ref(ptr + 16 + 0, undefined); 57 } else { 58 A.store.Bool(ptr + 16 + 4, true); 59 A.store.Ref(ptr + 16 + 0, x["frameSpectrogram"]["values"]); 60 } 61 } 62 }, 63 "load_AudioHumanPresenceDetection": ( 64 ptr: Pointer, 65 create: heap.Ref<boolean>, 66 ref: heap.Ref<any> 67 ): heap.Ref<any> => { 68 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 69 70 if (A.load.Bool(ptr + 21)) { 71 x["humanPresenceLikelihood"] = A.load.Float64(ptr + 0); 72 } else { 73 delete x["humanPresenceLikelihood"]; 74 } 75 if (A.load.Bool(ptr + 8 + 4)) { 76 x["noiseSpectrogram"] = {}; 77 x["noiseSpectrogram"]["values"] = A.load.Ref(ptr + 8 + 0, undefined); 78 } else { 79 delete x["noiseSpectrogram"]; 80 } 81 if (A.load.Bool(ptr + 16 + 4)) { 82 x["frameSpectrogram"] = {}; 83 x["frameSpectrogram"]["values"] = A.load.Ref(ptr + 16 + 0, undefined); 84 } else { 85 delete x["frameSpectrogram"]; 86 } 87 return create === A.H.TRUE ? A.H.push(x) : ref; 88 }, 89 90 "store_AudioLocalization": (ptr: Pointer, ref: heap.Ref<any>) => { 91 const x = A.H.get<any>(ref); 92 93 if (typeof x === "undefined") { 94 A.store.Bool(ptr + 13, false); 95 A.store.Bool(ptr + 12, false); 96 A.store.Float64(ptr + 0, 0); 97 A.store.Ref(ptr + 8, undefined); 98 } else { 99 A.store.Bool(ptr + 13, true); 100 A.store.Bool(ptr + 12, "azimuthRadians" in x ? true : false); 101 A.store.Float64(ptr + 0, x["azimuthRadians"] === undefined ? 0 : (x["azimuthRadians"] as number)); 102 A.store.Ref(ptr + 8, x["azimuthScores"]); 103 } 104 }, 105 "load_AudioLocalization": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 106 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 107 108 if (A.load.Bool(ptr + 12)) { 109 x["azimuthRadians"] = A.load.Float64(ptr + 0); 110 } else { 111 delete x["azimuthRadians"]; 112 } 113 x["azimuthScores"] = A.load.Ref(ptr + 8, undefined); 114 return create === A.H.TRUE ? A.H.push(x) : ref; 115 }, 116 "constof_HotwordType": (ref: heap.Ref<string>): number => { 117 const idx = ["UNKNOWN_TYPE", "OK_GOOGLE"].indexOf(A.H.get(ref)); 118 return idx < 0 ? 0 : idx + 1; 119 }, 120 121 "store_Hotword": (ptr: Pointer, ref: heap.Ref<any>) => { 122 const x = A.H.get<any>(ref); 123 124 if (typeof x === "undefined") { 125 A.store.Bool(ptr + 37, false); 126 A.store.Bool(ptr + 32, false); 127 A.store.Int32(ptr + 0, 0); 128 A.store.Enum(ptr + 4, -1); 129 A.store.Bool(ptr + 33, false); 130 A.store.Int32(ptr + 8, 0); 131 A.store.Bool(ptr + 34, false); 132 A.store.Int32(ptr + 12, 0); 133 A.store.Bool(ptr + 35, false); 134 A.store.Int32(ptr + 16, 0); 135 A.store.Bool(ptr + 36, false); 136 A.store.Float64(ptr + 24, 0); 137 } else { 138 A.store.Bool(ptr + 37, true); 139 A.store.Bool(ptr + 32, "id" in x ? true : false); 140 A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number)); 141 A.store.Enum(ptr + 4, ["UNKNOWN_TYPE", "OK_GOOGLE"].indexOf(x["type"] as string)); 142 A.store.Bool(ptr + 33, "frameId" in x ? true : false); 143 A.store.Int32(ptr + 8, x["frameId"] === undefined ? 0 : (x["frameId"] as number)); 144 A.store.Bool(ptr + 34, "startTimestampMs" in x ? true : false); 145 A.store.Int32(ptr + 12, x["startTimestampMs"] === undefined ? 0 : (x["startTimestampMs"] as number)); 146 A.store.Bool(ptr + 35, "endTimestampMs" in x ? true : false); 147 A.store.Int32(ptr + 16, x["endTimestampMs"] === undefined ? 0 : (x["endTimestampMs"] as number)); 148 A.store.Bool(ptr + 36, "confidence" in x ? true : false); 149 A.store.Float64(ptr + 24, x["confidence"] === undefined ? 0 : (x["confidence"] as number)); 150 } 151 }, 152 "load_Hotword": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 153 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 154 155 if (A.load.Bool(ptr + 32)) { 156 x["id"] = A.load.Int32(ptr + 0); 157 } else { 158 delete x["id"]; 159 } 160 x["type"] = A.load.Enum(ptr + 4, ["UNKNOWN_TYPE", "OK_GOOGLE"]); 161 if (A.load.Bool(ptr + 33)) { 162 x["frameId"] = A.load.Int32(ptr + 8); 163 } else { 164 delete x["frameId"]; 165 } 166 if (A.load.Bool(ptr + 34)) { 167 x["startTimestampMs"] = A.load.Int32(ptr + 12); 168 } else { 169 delete x["startTimestampMs"]; 170 } 171 if (A.load.Bool(ptr + 35)) { 172 x["endTimestampMs"] = A.load.Int32(ptr + 16); 173 } else { 174 delete x["endTimestampMs"]; 175 } 176 if (A.load.Bool(ptr + 36)) { 177 x["confidence"] = A.load.Float64(ptr + 24); 178 } else { 179 delete x["confidence"]; 180 } 181 return create === A.H.TRUE ? A.H.push(x) : ref; 182 }, 183 184 "store_HotwordDetection": (ptr: Pointer, ref: heap.Ref<any>) => { 185 const x = A.H.get<any>(ref); 186 187 if (typeof x === "undefined") { 188 A.store.Bool(ptr + 4, false); 189 A.store.Ref(ptr + 0, undefined); 190 } else { 191 A.store.Bool(ptr + 4, true); 192 A.store.Ref(ptr + 0, x["hotwords"]); 193 } 194 }, 195 "load_HotwordDetection": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 196 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 197 198 x["hotwords"] = A.load.Ref(ptr + 0, undefined); 199 return create === A.H.TRUE ? A.H.push(x) : ref; 200 }, 201 202 "store_AudioPerception": (ptr: Pointer, ref: heap.Ref<any>) => { 203 const x = A.H.get<any>(ref); 204 205 if (typeof x === "undefined") { 206 A.store.Bool(ptr + 54, false); 207 A.store.Bool(ptr + 53, false); 208 A.store.Float64(ptr + 0, 0); 209 210 A.store.Bool(ptr + 8 + 13, false); 211 A.store.Bool(ptr + 8 + 12, false); 212 A.store.Float64(ptr + 8 + 0, 0); 213 A.store.Ref(ptr + 8 + 8, undefined); 214 215 A.store.Bool(ptr + 24 + 22, false); 216 A.store.Bool(ptr + 24 + 21, false); 217 A.store.Float64(ptr + 24 + 0, 0); 218 219 A.store.Bool(ptr + 24 + 8 + 4, false); 220 A.store.Ref(ptr + 24 + 8 + 0, undefined); 221 222 A.store.Bool(ptr + 24 + 16 + 4, false); 223 A.store.Ref(ptr + 24 + 16 + 0, undefined); 224 225 A.store.Bool(ptr + 48 + 4, false); 226 A.store.Ref(ptr + 48 + 0, undefined); 227 } else { 228 A.store.Bool(ptr + 54, true); 229 A.store.Bool(ptr + 53, "timestampUs" in x ? true : false); 230 A.store.Float64(ptr + 0, x["timestampUs"] === undefined ? 0 : (x["timestampUs"] as number)); 231 232 if (typeof x["audioLocalization"] === "undefined") { 233 A.store.Bool(ptr + 8 + 13, false); 234 A.store.Bool(ptr + 8 + 12, false); 235 A.store.Float64(ptr + 8 + 0, 0); 236 A.store.Ref(ptr + 8 + 8, undefined); 237 } else { 238 A.store.Bool(ptr + 8 + 13, true); 239 A.store.Bool(ptr + 8 + 12, "azimuthRadians" in x["audioLocalization"] ? true : false); 240 A.store.Float64( 241 ptr + 8 + 0, 242 x["audioLocalization"]["azimuthRadians"] === undefined 243 ? 0 244 : (x["audioLocalization"]["azimuthRadians"] as number) 245 ); 246 A.store.Ref(ptr + 8 + 8, x["audioLocalization"]["azimuthScores"]); 247 } 248 249 if (typeof x["audioHumanPresenceDetection"] === "undefined") { 250 A.store.Bool(ptr + 24 + 22, false); 251 A.store.Bool(ptr + 24 + 21, false); 252 A.store.Float64(ptr + 24 + 0, 0); 253 254 A.store.Bool(ptr + 24 + 8 + 4, false); 255 A.store.Ref(ptr + 24 + 8 + 0, undefined); 256 257 A.store.Bool(ptr + 24 + 16 + 4, false); 258 A.store.Ref(ptr + 24 + 16 + 0, undefined); 259 } else { 260 A.store.Bool(ptr + 24 + 22, true); 261 A.store.Bool(ptr + 24 + 21, "humanPresenceLikelihood" in x["audioHumanPresenceDetection"] ? true : false); 262 A.store.Float64( 263 ptr + 24 + 0, 264 x["audioHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 265 ? 0 266 : (x["audioHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 267 ); 268 269 if (typeof x["audioHumanPresenceDetection"]["noiseSpectrogram"] === "undefined") { 270 A.store.Bool(ptr + 24 + 8 + 4, false); 271 A.store.Ref(ptr + 24 + 8 + 0, undefined); 272 } else { 273 A.store.Bool(ptr + 24 + 8 + 4, true); 274 A.store.Ref(ptr + 24 + 8 + 0, x["audioHumanPresenceDetection"]["noiseSpectrogram"]["values"]); 275 } 276 277 if (typeof x["audioHumanPresenceDetection"]["frameSpectrogram"] === "undefined") { 278 A.store.Bool(ptr + 24 + 16 + 4, false); 279 A.store.Ref(ptr + 24 + 16 + 0, undefined); 280 } else { 281 A.store.Bool(ptr + 24 + 16 + 4, true); 282 A.store.Ref(ptr + 24 + 16 + 0, x["audioHumanPresenceDetection"]["frameSpectrogram"]["values"]); 283 } 284 } 285 286 if (typeof x["hotwordDetection"] === "undefined") { 287 A.store.Bool(ptr + 48 + 4, false); 288 A.store.Ref(ptr + 48 + 0, undefined); 289 } else { 290 A.store.Bool(ptr + 48 + 4, true); 291 A.store.Ref(ptr + 48 + 0, x["hotwordDetection"]["hotwords"]); 292 } 293 } 294 }, 295 "load_AudioPerception": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 296 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 297 298 if (A.load.Bool(ptr + 53)) { 299 x["timestampUs"] = A.load.Float64(ptr + 0); 300 } else { 301 delete x["timestampUs"]; 302 } 303 if (A.load.Bool(ptr + 8 + 13)) { 304 x["audioLocalization"] = {}; 305 if (A.load.Bool(ptr + 8 + 12)) { 306 x["audioLocalization"]["azimuthRadians"] = A.load.Float64(ptr + 8 + 0); 307 } else { 308 delete x["audioLocalization"]["azimuthRadians"]; 309 } 310 x["audioLocalization"]["azimuthScores"] = A.load.Ref(ptr + 8 + 8, undefined); 311 } else { 312 delete x["audioLocalization"]; 313 } 314 if (A.load.Bool(ptr + 24 + 22)) { 315 x["audioHumanPresenceDetection"] = {}; 316 if (A.load.Bool(ptr + 24 + 21)) { 317 x["audioHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64(ptr + 24 + 0); 318 } else { 319 delete x["audioHumanPresenceDetection"]["humanPresenceLikelihood"]; 320 } 321 if (A.load.Bool(ptr + 24 + 8 + 4)) { 322 x["audioHumanPresenceDetection"]["noiseSpectrogram"] = {}; 323 x["audioHumanPresenceDetection"]["noiseSpectrogram"]["values"] = A.load.Ref(ptr + 24 + 8 + 0, undefined); 324 } else { 325 delete x["audioHumanPresenceDetection"]["noiseSpectrogram"]; 326 } 327 if (A.load.Bool(ptr + 24 + 16 + 4)) { 328 x["audioHumanPresenceDetection"]["frameSpectrogram"] = {}; 329 x["audioHumanPresenceDetection"]["frameSpectrogram"]["values"] = A.load.Ref(ptr + 24 + 16 + 0, undefined); 330 } else { 331 delete x["audioHumanPresenceDetection"]["frameSpectrogram"]; 332 } 333 } else { 334 delete x["audioHumanPresenceDetection"]; 335 } 336 if (A.load.Bool(ptr + 48 + 4)) { 337 x["hotwordDetection"] = {}; 338 x["hotwordDetection"]["hotwords"] = A.load.Ref(ptr + 48 + 0, undefined); 339 } else { 340 delete x["hotwordDetection"]; 341 } 342 return create === A.H.TRUE ? A.H.push(x) : ref; 343 }, 344 345 "store_AudioVisualHumanPresenceDetection": (ptr: Pointer, ref: heap.Ref<any>) => { 346 const x = A.H.get<any>(ref); 347 348 if (typeof x === "undefined") { 349 A.store.Bool(ptr + 9, false); 350 A.store.Bool(ptr + 8, false); 351 A.store.Float64(ptr + 0, 0); 352 } else { 353 A.store.Bool(ptr + 9, true); 354 A.store.Bool(ptr + 8, "humanPresenceLikelihood" in x ? true : false); 355 A.store.Float64( 356 ptr + 0, 357 x["humanPresenceLikelihood"] === undefined ? 0 : (x["humanPresenceLikelihood"] as number) 358 ); 359 } 360 }, 361 "load_AudioVisualHumanPresenceDetection": ( 362 ptr: Pointer, 363 create: heap.Ref<boolean>, 364 ref: heap.Ref<any> 365 ): heap.Ref<any> => { 366 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 367 368 if (A.load.Bool(ptr + 8)) { 369 x["humanPresenceLikelihood"] = A.load.Float64(ptr + 0); 370 } else { 371 delete x["humanPresenceLikelihood"]; 372 } 373 return create === A.H.TRUE ? A.H.push(x) : ref; 374 }, 375 376 "store_AudioVisualPerception": (ptr: Pointer, ref: heap.Ref<any>) => { 377 const x = A.H.get<any>(ref); 378 379 if (typeof x === "undefined") { 380 A.store.Bool(ptr + 19, false); 381 A.store.Bool(ptr + 18, false); 382 A.store.Float64(ptr + 0, 0); 383 384 A.store.Bool(ptr + 8 + 9, false); 385 A.store.Bool(ptr + 8 + 8, false); 386 A.store.Float64(ptr + 8 + 0, 0); 387 } else { 388 A.store.Bool(ptr + 19, true); 389 A.store.Bool(ptr + 18, "timestampUs" in x ? true : false); 390 A.store.Float64(ptr + 0, x["timestampUs"] === undefined ? 0 : (x["timestampUs"] as number)); 391 392 if (typeof x["audioVisualHumanPresenceDetection"] === "undefined") { 393 A.store.Bool(ptr + 8 + 9, false); 394 A.store.Bool(ptr + 8 + 8, false); 395 A.store.Float64(ptr + 8 + 0, 0); 396 } else { 397 A.store.Bool(ptr + 8 + 9, true); 398 A.store.Bool(ptr + 8 + 8, "humanPresenceLikelihood" in x["audioVisualHumanPresenceDetection"] ? true : false); 399 A.store.Float64( 400 ptr + 8 + 0, 401 x["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 402 ? 0 403 : (x["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 404 ); 405 } 406 } 407 }, 408 "load_AudioVisualPerception": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 409 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 410 411 if (A.load.Bool(ptr + 18)) { 412 x["timestampUs"] = A.load.Float64(ptr + 0); 413 } else { 414 delete x["timestampUs"]; 415 } 416 if (A.load.Bool(ptr + 8 + 9)) { 417 x["audioVisualHumanPresenceDetection"] = {}; 418 if (A.load.Bool(ptr + 8 + 8)) { 419 x["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64(ptr + 8 + 0); 420 } else { 421 delete x["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"]; 422 } 423 } else { 424 delete x["audioVisualHumanPresenceDetection"]; 425 } 426 return create === A.H.TRUE ? A.H.push(x) : ref; 427 }, 428 429 "store_Point": (ptr: Pointer, ref: heap.Ref<any>) => { 430 const x = A.H.get<any>(ref); 431 432 if (typeof x === "undefined") { 433 A.store.Bool(ptr + 18, false); 434 A.store.Bool(ptr + 16, false); 435 A.store.Float64(ptr + 0, 0); 436 A.store.Bool(ptr + 17, false); 437 A.store.Float64(ptr + 8, 0); 438 } else { 439 A.store.Bool(ptr + 18, true); 440 A.store.Bool(ptr + 16, "x" in x ? true : false); 441 A.store.Float64(ptr + 0, x["x"] === undefined ? 0 : (x["x"] as number)); 442 A.store.Bool(ptr + 17, "y" in x ? true : false); 443 A.store.Float64(ptr + 8, x["y"] === undefined ? 0 : (x["y"] as number)); 444 } 445 }, 446 "load_Point": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 447 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 448 449 if (A.load.Bool(ptr + 16)) { 450 x["x"] = A.load.Float64(ptr + 0); 451 } else { 452 delete x["x"]; 453 } 454 if (A.load.Bool(ptr + 17)) { 455 x["y"] = A.load.Float64(ptr + 8); 456 } else { 457 delete x["y"]; 458 } 459 return create === A.H.TRUE ? A.H.push(x) : ref; 460 }, 461 462 "store_BoundingBox": (ptr: Pointer, ref: heap.Ref<any>) => { 463 const x = A.H.get<any>(ref); 464 465 if (typeof x === "undefined") { 466 A.store.Bool(ptr + 52, false); 467 A.store.Bool(ptr + 51, false); 468 A.store.Bool(ptr + 0, false); 469 470 A.store.Bool(ptr + 8 + 18, false); 471 A.store.Bool(ptr + 8 + 16, false); 472 A.store.Float64(ptr + 8 + 0, 0); 473 A.store.Bool(ptr + 8 + 17, false); 474 A.store.Float64(ptr + 8 + 8, 0); 475 476 A.store.Bool(ptr + 32 + 18, false); 477 A.store.Bool(ptr + 32 + 16, false); 478 A.store.Float64(ptr + 32 + 0, 0); 479 A.store.Bool(ptr + 32 + 17, false); 480 A.store.Float64(ptr + 32 + 8, 0); 481 } else { 482 A.store.Bool(ptr + 52, true); 483 A.store.Bool(ptr + 51, "normalized" in x ? true : false); 484 A.store.Bool(ptr + 0, x["normalized"] ? true : false); 485 486 if (typeof x["topLeft"] === "undefined") { 487 A.store.Bool(ptr + 8 + 18, false); 488 A.store.Bool(ptr + 8 + 16, false); 489 A.store.Float64(ptr + 8 + 0, 0); 490 A.store.Bool(ptr + 8 + 17, false); 491 A.store.Float64(ptr + 8 + 8, 0); 492 } else { 493 A.store.Bool(ptr + 8 + 18, true); 494 A.store.Bool(ptr + 8 + 16, "x" in x["topLeft"] ? true : false); 495 A.store.Float64(ptr + 8 + 0, x["topLeft"]["x"] === undefined ? 0 : (x["topLeft"]["x"] as number)); 496 A.store.Bool(ptr + 8 + 17, "y" in x["topLeft"] ? true : false); 497 A.store.Float64(ptr + 8 + 8, x["topLeft"]["y"] === undefined ? 0 : (x["topLeft"]["y"] as number)); 498 } 499 500 if (typeof x["bottomRight"] === "undefined") { 501 A.store.Bool(ptr + 32 + 18, false); 502 A.store.Bool(ptr + 32 + 16, false); 503 A.store.Float64(ptr + 32 + 0, 0); 504 A.store.Bool(ptr + 32 + 17, false); 505 A.store.Float64(ptr + 32 + 8, 0); 506 } else { 507 A.store.Bool(ptr + 32 + 18, true); 508 A.store.Bool(ptr + 32 + 16, "x" in x["bottomRight"] ? true : false); 509 A.store.Float64(ptr + 32 + 0, x["bottomRight"]["x"] === undefined ? 0 : (x["bottomRight"]["x"] as number)); 510 A.store.Bool(ptr + 32 + 17, "y" in x["bottomRight"] ? true : false); 511 A.store.Float64(ptr + 32 + 8, x["bottomRight"]["y"] === undefined ? 0 : (x["bottomRight"]["y"] as number)); 512 } 513 } 514 }, 515 "load_BoundingBox": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 516 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 517 518 if (A.load.Bool(ptr + 51)) { 519 x["normalized"] = A.load.Bool(ptr + 0); 520 } else { 521 delete x["normalized"]; 522 } 523 if (A.load.Bool(ptr + 8 + 18)) { 524 x["topLeft"] = {}; 525 if (A.load.Bool(ptr + 8 + 16)) { 526 x["topLeft"]["x"] = A.load.Float64(ptr + 8 + 0); 527 } else { 528 delete x["topLeft"]["x"]; 529 } 530 if (A.load.Bool(ptr + 8 + 17)) { 531 x["topLeft"]["y"] = A.load.Float64(ptr + 8 + 8); 532 } else { 533 delete x["topLeft"]["y"]; 534 } 535 } else { 536 delete x["topLeft"]; 537 } 538 if (A.load.Bool(ptr + 32 + 18)) { 539 x["bottomRight"] = {}; 540 if (A.load.Bool(ptr + 32 + 16)) { 541 x["bottomRight"]["x"] = A.load.Float64(ptr + 32 + 0); 542 } else { 543 delete x["bottomRight"]["x"]; 544 } 545 if (A.load.Bool(ptr + 32 + 17)) { 546 x["bottomRight"]["y"] = A.load.Float64(ptr + 32 + 8); 547 } else { 548 delete x["bottomRight"]["y"]; 549 } 550 } else { 551 delete x["bottomRight"]; 552 } 553 return create === A.H.TRUE ? A.H.push(x) : ref; 554 }, 555 "constof_ComponentType": (ref: heap.Ref<string>): number => { 556 const idx = ["LIGHT", "FULL"].indexOf(A.H.get(ref)); 557 return idx < 0 ? 0 : idx + 1; 558 }, 559 560 "store_Component": (ptr: Pointer, ref: heap.Ref<any>) => { 561 const x = A.H.get<any>(ref); 562 563 if (typeof x === "undefined") { 564 A.store.Bool(ptr + 4, false); 565 A.store.Enum(ptr + 0, -1); 566 } else { 567 A.store.Bool(ptr + 4, true); 568 A.store.Enum(ptr + 0, ["LIGHT", "FULL"].indexOf(x["type"] as string)); 569 } 570 }, 571 "load_Component": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 572 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 573 574 x["type"] = A.load.Enum(ptr + 0, ["LIGHT", "FULL"]); 575 return create === A.H.TRUE ? A.H.push(x) : ref; 576 }, 577 "constof_ComponentInstallationError": (ref: heap.Ref<string>): number => { 578 const idx = [ 579 "UNKNOWN_COMPONENT", 580 "INSTALL_FAILURE", 581 "MOUNT_FAILURE", 582 "COMPATIBILITY_CHECK_FAILED", 583 "NOT_FOUND", 584 ].indexOf(A.H.get(ref)); 585 return idx < 0 ? 0 : idx + 1; 586 }, 587 "constof_ComponentStatus": (ref: heap.Ref<string>): number => { 588 const idx = ["UNKNOWN", "INSTALLED", "FAILED_TO_INSTALL"].indexOf(A.H.get(ref)); 589 return idx < 0 ? 0 : idx + 1; 590 }, 591 592 "store_ComponentState": (ptr: Pointer, ref: heap.Ref<any>) => { 593 const x = A.H.get<any>(ref); 594 595 if (typeof x === "undefined") { 596 A.store.Bool(ptr + 12, false); 597 A.store.Enum(ptr + 0, -1); 598 A.store.Ref(ptr + 4, undefined); 599 A.store.Enum(ptr + 8, -1); 600 } else { 601 A.store.Bool(ptr + 12, true); 602 A.store.Enum(ptr + 0, ["UNKNOWN", "INSTALLED", "FAILED_TO_INSTALL"].indexOf(x["status"] as string)); 603 A.store.Ref(ptr + 4, x["version"]); 604 A.store.Enum( 605 ptr + 8, 606 ["UNKNOWN_COMPONENT", "INSTALL_FAILURE", "MOUNT_FAILURE", "COMPATIBILITY_CHECK_FAILED", "NOT_FOUND"].indexOf( 607 x["installationErrorCode"] as string 608 ) 609 ); 610 } 611 }, 612 "load_ComponentState": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 613 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 614 615 x["status"] = A.load.Enum(ptr + 0, ["UNKNOWN", "INSTALLED", "FAILED_TO_INSTALL"]); 616 x["version"] = A.load.Ref(ptr + 4, undefined); 617 x["installationErrorCode"] = A.load.Enum(ptr + 8, [ 618 "UNKNOWN_COMPONENT", 619 "INSTALL_FAILURE", 620 "MOUNT_FAILURE", 621 "COMPATIBILITY_CHECK_FAILED", 622 "NOT_FOUND", 623 ]); 624 return create === A.H.TRUE ? A.H.push(x) : ref; 625 }, 626 "constof_ServiceError": (ref: heap.Ref<string>): number => { 627 const idx = [ 628 "SERVICE_UNREACHABLE", 629 "SERVICE_NOT_RUNNING", 630 "SERVICE_BUSY_LAUNCHING", 631 "SERVICE_NOT_INSTALLED", 632 "MOJO_CONNECTION_FAILURE", 633 ].indexOf(A.H.get(ref)); 634 return idx < 0 ? 0 : idx + 1; 635 }, 636 "constof_EntityType": (ref: heap.Ref<string>): number => { 637 const idx = ["UNSPECIFIED", "FACE", "PERSON", "MOTION_REGION", "LABELED_REGION"].indexOf(A.H.get(ref)); 638 return idx < 0 ? 0 : idx + 1; 639 }, 640 "constof_DistanceUnits": (ref: heap.Ref<string>): number => { 641 const idx = ["UNSPECIFIED", "METERS", "PIXELS"].indexOf(A.H.get(ref)); 642 return idx < 0 ? 0 : idx + 1; 643 }, 644 645 "store_Distance": (ptr: Pointer, ref: heap.Ref<any>) => { 646 const x = A.H.get<any>(ref); 647 648 if (typeof x === "undefined") { 649 A.store.Bool(ptr + 17, false); 650 A.store.Enum(ptr + 0, -1); 651 A.store.Bool(ptr + 16, false); 652 A.store.Float64(ptr + 8, 0); 653 } else { 654 A.store.Bool(ptr + 17, true); 655 A.store.Enum(ptr + 0, ["UNSPECIFIED", "METERS", "PIXELS"].indexOf(x["units"] as string)); 656 A.store.Bool(ptr + 16, "magnitude" in x ? true : false); 657 A.store.Float64(ptr + 8, x["magnitude"] === undefined ? 0 : (x["magnitude"] as number)); 658 } 659 }, 660 "load_Distance": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 661 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 662 663 x["units"] = A.load.Enum(ptr + 0, ["UNSPECIFIED", "METERS", "PIXELS"]); 664 if (A.load.Bool(ptr + 16)) { 665 x["magnitude"] = A.load.Float64(ptr + 8); 666 } else { 667 delete x["magnitude"]; 668 } 669 return create === A.H.TRUE ? A.H.push(x) : ref; 670 }, 671 672 "store_Entity": (ptr: Pointer, ref: heap.Ref<any>) => { 673 const x = A.H.get<any>(ref); 674 675 if (typeof x === "undefined") { 676 A.store.Bool(ptr + 100, false); 677 A.store.Bool(ptr + 98, false); 678 A.store.Int32(ptr + 0, 0); 679 A.store.Enum(ptr + 4, -1); 680 A.store.Ref(ptr + 8, undefined); 681 682 A.store.Bool(ptr + 16 + 52, false); 683 A.store.Bool(ptr + 16 + 51, false); 684 A.store.Bool(ptr + 16 + 0, false); 685 686 A.store.Bool(ptr + 16 + 8 + 18, false); 687 A.store.Bool(ptr + 16 + 8 + 16, false); 688 A.store.Float64(ptr + 16 + 8 + 0, 0); 689 A.store.Bool(ptr + 16 + 8 + 17, false); 690 A.store.Float64(ptr + 16 + 8 + 8, 0); 691 692 A.store.Bool(ptr + 16 + 32 + 18, false); 693 A.store.Bool(ptr + 16 + 32 + 16, false); 694 A.store.Float64(ptr + 16 + 32 + 0, 0); 695 A.store.Bool(ptr + 16 + 32 + 17, false); 696 A.store.Float64(ptr + 16 + 32 + 8, 0); 697 A.store.Bool(ptr + 99, false); 698 A.store.Float64(ptr + 72, 0); 699 700 A.store.Bool(ptr + 80 + 17, false); 701 A.store.Enum(ptr + 80 + 0, -1); 702 A.store.Bool(ptr + 80 + 16, false); 703 A.store.Float64(ptr + 80 + 8, 0); 704 } else { 705 A.store.Bool(ptr + 100, true); 706 A.store.Bool(ptr + 98, "id" in x ? true : false); 707 A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number)); 708 A.store.Enum( 709 ptr + 4, 710 ["UNSPECIFIED", "FACE", "PERSON", "MOTION_REGION", "LABELED_REGION"].indexOf(x["type"] as string) 711 ); 712 A.store.Ref(ptr + 8, x["entityLabel"]); 713 714 if (typeof x["boundingBox"] === "undefined") { 715 A.store.Bool(ptr + 16 + 52, false); 716 A.store.Bool(ptr + 16 + 51, false); 717 A.store.Bool(ptr + 16 + 0, false); 718 719 A.store.Bool(ptr + 16 + 8 + 18, false); 720 A.store.Bool(ptr + 16 + 8 + 16, false); 721 A.store.Float64(ptr + 16 + 8 + 0, 0); 722 A.store.Bool(ptr + 16 + 8 + 17, false); 723 A.store.Float64(ptr + 16 + 8 + 8, 0); 724 725 A.store.Bool(ptr + 16 + 32 + 18, false); 726 A.store.Bool(ptr + 16 + 32 + 16, false); 727 A.store.Float64(ptr + 16 + 32 + 0, 0); 728 A.store.Bool(ptr + 16 + 32 + 17, false); 729 A.store.Float64(ptr + 16 + 32 + 8, 0); 730 } else { 731 A.store.Bool(ptr + 16 + 52, true); 732 A.store.Bool(ptr + 16 + 51, "normalized" in x["boundingBox"] ? true : false); 733 A.store.Bool(ptr + 16 + 0, x["boundingBox"]["normalized"] ? true : false); 734 735 if (typeof x["boundingBox"]["topLeft"] === "undefined") { 736 A.store.Bool(ptr + 16 + 8 + 18, false); 737 A.store.Bool(ptr + 16 + 8 + 16, false); 738 A.store.Float64(ptr + 16 + 8 + 0, 0); 739 A.store.Bool(ptr + 16 + 8 + 17, false); 740 A.store.Float64(ptr + 16 + 8 + 8, 0); 741 } else { 742 A.store.Bool(ptr + 16 + 8 + 18, true); 743 A.store.Bool(ptr + 16 + 8 + 16, "x" in x["boundingBox"]["topLeft"] ? true : false); 744 A.store.Float64( 745 ptr + 16 + 8 + 0, 746 x["boundingBox"]["topLeft"]["x"] === undefined ? 0 : (x["boundingBox"]["topLeft"]["x"] as number) 747 ); 748 A.store.Bool(ptr + 16 + 8 + 17, "y" in x["boundingBox"]["topLeft"] ? true : false); 749 A.store.Float64( 750 ptr + 16 + 8 + 8, 751 x["boundingBox"]["topLeft"]["y"] === undefined ? 0 : (x["boundingBox"]["topLeft"]["y"] as number) 752 ); 753 } 754 755 if (typeof x["boundingBox"]["bottomRight"] === "undefined") { 756 A.store.Bool(ptr + 16 + 32 + 18, false); 757 A.store.Bool(ptr + 16 + 32 + 16, false); 758 A.store.Float64(ptr + 16 + 32 + 0, 0); 759 A.store.Bool(ptr + 16 + 32 + 17, false); 760 A.store.Float64(ptr + 16 + 32 + 8, 0); 761 } else { 762 A.store.Bool(ptr + 16 + 32 + 18, true); 763 A.store.Bool(ptr + 16 + 32 + 16, "x" in x["boundingBox"]["bottomRight"] ? true : false); 764 A.store.Float64( 765 ptr + 16 + 32 + 0, 766 x["boundingBox"]["bottomRight"]["x"] === undefined ? 0 : (x["boundingBox"]["bottomRight"]["x"] as number) 767 ); 768 A.store.Bool(ptr + 16 + 32 + 17, "y" in x["boundingBox"]["bottomRight"] ? true : false); 769 A.store.Float64( 770 ptr + 16 + 32 + 8, 771 x["boundingBox"]["bottomRight"]["y"] === undefined ? 0 : (x["boundingBox"]["bottomRight"]["y"] as number) 772 ); 773 } 774 } 775 A.store.Bool(ptr + 99, "confidence" in x ? true : false); 776 A.store.Float64(ptr + 72, x["confidence"] === undefined ? 0 : (x["confidence"] as number)); 777 778 if (typeof x["depth"] === "undefined") { 779 A.store.Bool(ptr + 80 + 17, false); 780 A.store.Enum(ptr + 80 + 0, -1); 781 A.store.Bool(ptr + 80 + 16, false); 782 A.store.Float64(ptr + 80 + 8, 0); 783 } else { 784 A.store.Bool(ptr + 80 + 17, true); 785 A.store.Enum(ptr + 80 + 0, ["UNSPECIFIED", "METERS", "PIXELS"].indexOf(x["depth"]["units"] as string)); 786 A.store.Bool(ptr + 80 + 16, "magnitude" in x["depth"] ? true : false); 787 A.store.Float64( 788 ptr + 80 + 8, 789 x["depth"]["magnitude"] === undefined ? 0 : (x["depth"]["magnitude"] as number) 790 ); 791 } 792 } 793 }, 794 "load_Entity": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 795 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 796 797 if (A.load.Bool(ptr + 98)) { 798 x["id"] = A.load.Int32(ptr + 0); 799 } else { 800 delete x["id"]; 801 } 802 x["type"] = A.load.Enum(ptr + 4, ["UNSPECIFIED", "FACE", "PERSON", "MOTION_REGION", "LABELED_REGION"]); 803 x["entityLabel"] = A.load.Ref(ptr + 8, undefined); 804 if (A.load.Bool(ptr + 16 + 52)) { 805 x["boundingBox"] = {}; 806 if (A.load.Bool(ptr + 16 + 51)) { 807 x["boundingBox"]["normalized"] = A.load.Bool(ptr + 16 + 0); 808 } else { 809 delete x["boundingBox"]["normalized"]; 810 } 811 if (A.load.Bool(ptr + 16 + 8 + 18)) { 812 x["boundingBox"]["topLeft"] = {}; 813 if (A.load.Bool(ptr + 16 + 8 + 16)) { 814 x["boundingBox"]["topLeft"]["x"] = A.load.Float64(ptr + 16 + 8 + 0); 815 } else { 816 delete x["boundingBox"]["topLeft"]["x"]; 817 } 818 if (A.load.Bool(ptr + 16 + 8 + 17)) { 819 x["boundingBox"]["topLeft"]["y"] = A.load.Float64(ptr + 16 + 8 + 8); 820 } else { 821 delete x["boundingBox"]["topLeft"]["y"]; 822 } 823 } else { 824 delete x["boundingBox"]["topLeft"]; 825 } 826 if (A.load.Bool(ptr + 16 + 32 + 18)) { 827 x["boundingBox"]["bottomRight"] = {}; 828 if (A.load.Bool(ptr + 16 + 32 + 16)) { 829 x["boundingBox"]["bottomRight"]["x"] = A.load.Float64(ptr + 16 + 32 + 0); 830 } else { 831 delete x["boundingBox"]["bottomRight"]["x"]; 832 } 833 if (A.load.Bool(ptr + 16 + 32 + 17)) { 834 x["boundingBox"]["bottomRight"]["y"] = A.load.Float64(ptr + 16 + 32 + 8); 835 } else { 836 delete x["boundingBox"]["bottomRight"]["y"]; 837 } 838 } else { 839 delete x["boundingBox"]["bottomRight"]; 840 } 841 } else { 842 delete x["boundingBox"]; 843 } 844 if (A.load.Bool(ptr + 99)) { 845 x["confidence"] = A.load.Float64(ptr + 72); 846 } else { 847 delete x["confidence"]; 848 } 849 if (A.load.Bool(ptr + 80 + 17)) { 850 x["depth"] = {}; 851 x["depth"]["units"] = A.load.Enum(ptr + 80 + 0, ["UNSPECIFIED", "METERS", "PIXELS"]); 852 if (A.load.Bool(ptr + 80 + 16)) { 853 x["depth"]["magnitude"] = A.load.Float64(ptr + 80 + 8); 854 } else { 855 delete x["depth"]["magnitude"]; 856 } 857 } else { 858 delete x["depth"]; 859 } 860 return create === A.H.TRUE ? A.H.push(x) : ref; 861 }, 862 863 "store_PacketLatency": (ptr: Pointer, ref: heap.Ref<any>) => { 864 const x = A.H.get<any>(ref); 865 866 if (typeof x === "undefined") { 867 A.store.Bool(ptr + 9, false); 868 A.store.Ref(ptr + 0, undefined); 869 A.store.Bool(ptr + 8, false); 870 A.store.Int32(ptr + 4, 0); 871 } else { 872 A.store.Bool(ptr + 9, true); 873 A.store.Ref(ptr + 0, x["packetLabel"]); 874 A.store.Bool(ptr + 8, "latencyUsec" in x ? true : false); 875 A.store.Int32(ptr + 4, x["latencyUsec"] === undefined ? 0 : (x["latencyUsec"] as number)); 876 } 877 }, 878 "load_PacketLatency": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 879 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 880 881 x["packetLabel"] = A.load.Ref(ptr + 0, undefined); 882 if (A.load.Bool(ptr + 8)) { 883 x["latencyUsec"] = A.load.Int32(ptr + 4); 884 } else { 885 delete x["latencyUsec"]; 886 } 887 return create === A.H.TRUE ? A.H.push(x) : ref; 888 }, 889 "constof_LightCondition": (ref: heap.Ref<string>): number => { 890 const idx = ["UNSPECIFIED", "NO_CHANGE", "TURNED_ON", "TURNED_OFF", "DIMMER", "BRIGHTER", "BLACK_FRAME"].indexOf( 891 A.H.get(ref) 892 ); 893 return idx < 0 ? 0 : idx + 1; 894 }, 895 896 "store_VideoHumanPresenceDetection": (ptr: Pointer, ref: heap.Ref<any>) => { 897 const x = A.H.get<any>(ref); 898 899 if (typeof x === "undefined") { 900 A.store.Bool(ptr + 35, false); 901 A.store.Bool(ptr + 32, false); 902 A.store.Float64(ptr + 0, 0); 903 A.store.Bool(ptr + 33, false); 904 A.store.Float64(ptr + 8, 0); 905 A.store.Enum(ptr + 16, -1); 906 A.store.Bool(ptr + 34, false); 907 A.store.Float64(ptr + 24, 0); 908 } else { 909 A.store.Bool(ptr + 35, true); 910 A.store.Bool(ptr + 32, "humanPresenceLikelihood" in x ? true : false); 911 A.store.Float64( 912 ptr + 0, 913 x["humanPresenceLikelihood"] === undefined ? 0 : (x["humanPresenceLikelihood"] as number) 914 ); 915 A.store.Bool(ptr + 33, "motionDetectedLikelihood" in x ? true : false); 916 A.store.Float64( 917 ptr + 8, 918 x["motionDetectedLikelihood"] === undefined ? 0 : (x["motionDetectedLikelihood"] as number) 919 ); 920 A.store.Enum( 921 ptr + 16, 922 ["UNSPECIFIED", "NO_CHANGE", "TURNED_ON", "TURNED_OFF", "DIMMER", "BRIGHTER", "BLACK_FRAME"].indexOf( 923 x["lightCondition"] as string 924 ) 925 ); 926 A.store.Bool(ptr + 34, "lightConditionLikelihood" in x ? true : false); 927 A.store.Float64( 928 ptr + 24, 929 x["lightConditionLikelihood"] === undefined ? 0 : (x["lightConditionLikelihood"] as number) 930 ); 931 } 932 }, 933 "load_VideoHumanPresenceDetection": ( 934 ptr: Pointer, 935 create: heap.Ref<boolean>, 936 ref: heap.Ref<any> 937 ): heap.Ref<any> => { 938 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 939 940 if (A.load.Bool(ptr + 32)) { 941 x["humanPresenceLikelihood"] = A.load.Float64(ptr + 0); 942 } else { 943 delete x["humanPresenceLikelihood"]; 944 } 945 if (A.load.Bool(ptr + 33)) { 946 x["motionDetectedLikelihood"] = A.load.Float64(ptr + 8); 947 } else { 948 delete x["motionDetectedLikelihood"]; 949 } 950 x["lightCondition"] = A.load.Enum(ptr + 16, [ 951 "UNSPECIFIED", 952 "NO_CHANGE", 953 "TURNED_ON", 954 "TURNED_OFF", 955 "DIMMER", 956 "BRIGHTER", 957 "BLACK_FRAME", 958 ]); 959 if (A.load.Bool(ptr + 34)) { 960 x["lightConditionLikelihood"] = A.load.Float64(ptr + 24); 961 } else { 962 delete x["lightConditionLikelihood"]; 963 } 964 return create === A.H.TRUE ? A.H.push(x) : ref; 965 }, 966 "constof_FramePerceptionType": (ref: heap.Ref<string>): number => { 967 const idx = ["UNKNOWN_TYPE", "FACE_DETECTION", "PERSON_DETECTION", "MOTION_DETECTION"].indexOf(A.H.get(ref)); 968 return idx < 0 ? 0 : idx + 1; 969 }, 970 971 "store_FramePerception": (ptr: Pointer, ref: heap.Ref<any>) => { 972 const x = A.H.get<any>(ref); 973 974 if (typeof x === "undefined") { 975 A.store.Bool(ptr + 76, false); 976 A.store.Bool(ptr + 72, false); 977 A.store.Int32(ptr + 0, 0); 978 A.store.Bool(ptr + 73, false); 979 A.store.Int32(ptr + 4, 0); 980 A.store.Bool(ptr + 74, false); 981 A.store.Int32(ptr + 8, 0); 982 A.store.Bool(ptr + 75, false); 983 A.store.Float64(ptr + 16, 0); 984 A.store.Ref(ptr + 24, undefined); 985 A.store.Ref(ptr + 28, undefined); 986 987 A.store.Bool(ptr + 32 + 35, false); 988 A.store.Bool(ptr + 32 + 32, false); 989 A.store.Float64(ptr + 32 + 0, 0); 990 A.store.Bool(ptr + 32 + 33, false); 991 A.store.Float64(ptr + 32 + 8, 0); 992 A.store.Enum(ptr + 32 + 16, -1); 993 A.store.Bool(ptr + 32 + 34, false); 994 A.store.Float64(ptr + 32 + 24, 0); 995 A.store.Ref(ptr + 68, undefined); 996 } else { 997 A.store.Bool(ptr + 76, true); 998 A.store.Bool(ptr + 72, "frameId" in x ? true : false); 999 A.store.Int32(ptr + 0, x["frameId"] === undefined ? 0 : (x["frameId"] as number)); 1000 A.store.Bool(ptr + 73, "frameWidthInPx" in x ? true : false); 1001 A.store.Int32(ptr + 4, x["frameWidthInPx"] === undefined ? 0 : (x["frameWidthInPx"] as number)); 1002 A.store.Bool(ptr + 74, "frameHeightInPx" in x ? true : false); 1003 A.store.Int32(ptr + 8, x["frameHeightInPx"] === undefined ? 0 : (x["frameHeightInPx"] as number)); 1004 A.store.Bool(ptr + 75, "timestamp" in x ? true : false); 1005 A.store.Float64(ptr + 16, x["timestamp"] === undefined ? 0 : (x["timestamp"] as number)); 1006 A.store.Ref(ptr + 24, x["entities"]); 1007 A.store.Ref(ptr + 28, x["packetLatency"]); 1008 1009 if (typeof x["videoHumanPresenceDetection"] === "undefined") { 1010 A.store.Bool(ptr + 32 + 35, false); 1011 A.store.Bool(ptr + 32 + 32, false); 1012 A.store.Float64(ptr + 32 + 0, 0); 1013 A.store.Bool(ptr + 32 + 33, false); 1014 A.store.Float64(ptr + 32 + 8, 0); 1015 A.store.Enum(ptr + 32 + 16, -1); 1016 A.store.Bool(ptr + 32 + 34, false); 1017 A.store.Float64(ptr + 32 + 24, 0); 1018 } else { 1019 A.store.Bool(ptr + 32 + 35, true); 1020 A.store.Bool(ptr + 32 + 32, "humanPresenceLikelihood" in x["videoHumanPresenceDetection"] ? true : false); 1021 A.store.Float64( 1022 ptr + 32 + 0, 1023 x["videoHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 1024 ? 0 1025 : (x["videoHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 1026 ); 1027 A.store.Bool(ptr + 32 + 33, "motionDetectedLikelihood" in x["videoHumanPresenceDetection"] ? true : false); 1028 A.store.Float64( 1029 ptr + 32 + 8, 1030 x["videoHumanPresenceDetection"]["motionDetectedLikelihood"] === undefined 1031 ? 0 1032 : (x["videoHumanPresenceDetection"]["motionDetectedLikelihood"] as number) 1033 ); 1034 A.store.Enum( 1035 ptr + 32 + 16, 1036 ["UNSPECIFIED", "NO_CHANGE", "TURNED_ON", "TURNED_OFF", "DIMMER", "BRIGHTER", "BLACK_FRAME"].indexOf( 1037 x["videoHumanPresenceDetection"]["lightCondition"] as string 1038 ) 1039 ); 1040 A.store.Bool(ptr + 32 + 34, "lightConditionLikelihood" in x["videoHumanPresenceDetection"] ? true : false); 1041 A.store.Float64( 1042 ptr + 32 + 24, 1043 x["videoHumanPresenceDetection"]["lightConditionLikelihood"] === undefined 1044 ? 0 1045 : (x["videoHumanPresenceDetection"]["lightConditionLikelihood"] as number) 1046 ); 1047 } 1048 A.store.Ref(ptr + 68, x["framePerceptionTypes"]); 1049 } 1050 }, 1051 "load_FramePerception": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1052 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1053 1054 if (A.load.Bool(ptr + 72)) { 1055 x["frameId"] = A.load.Int32(ptr + 0); 1056 } else { 1057 delete x["frameId"]; 1058 } 1059 if (A.load.Bool(ptr + 73)) { 1060 x["frameWidthInPx"] = A.load.Int32(ptr + 4); 1061 } else { 1062 delete x["frameWidthInPx"]; 1063 } 1064 if (A.load.Bool(ptr + 74)) { 1065 x["frameHeightInPx"] = A.load.Int32(ptr + 8); 1066 } else { 1067 delete x["frameHeightInPx"]; 1068 } 1069 if (A.load.Bool(ptr + 75)) { 1070 x["timestamp"] = A.load.Float64(ptr + 16); 1071 } else { 1072 delete x["timestamp"]; 1073 } 1074 x["entities"] = A.load.Ref(ptr + 24, undefined); 1075 x["packetLatency"] = A.load.Ref(ptr + 28, undefined); 1076 if (A.load.Bool(ptr + 32 + 35)) { 1077 x["videoHumanPresenceDetection"] = {}; 1078 if (A.load.Bool(ptr + 32 + 32)) { 1079 x["videoHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64(ptr + 32 + 0); 1080 } else { 1081 delete x["videoHumanPresenceDetection"]["humanPresenceLikelihood"]; 1082 } 1083 if (A.load.Bool(ptr + 32 + 33)) { 1084 x["videoHumanPresenceDetection"]["motionDetectedLikelihood"] = A.load.Float64(ptr + 32 + 8); 1085 } else { 1086 delete x["videoHumanPresenceDetection"]["motionDetectedLikelihood"]; 1087 } 1088 x["videoHumanPresenceDetection"]["lightCondition"] = A.load.Enum(ptr + 32 + 16, [ 1089 "UNSPECIFIED", 1090 "NO_CHANGE", 1091 "TURNED_ON", 1092 "TURNED_OFF", 1093 "DIMMER", 1094 "BRIGHTER", 1095 "BLACK_FRAME", 1096 ]); 1097 if (A.load.Bool(ptr + 32 + 34)) { 1098 x["videoHumanPresenceDetection"]["lightConditionLikelihood"] = A.load.Float64(ptr + 32 + 24); 1099 } else { 1100 delete x["videoHumanPresenceDetection"]["lightConditionLikelihood"]; 1101 } 1102 } else { 1103 delete x["videoHumanPresenceDetection"]; 1104 } 1105 x["framePerceptionTypes"] = A.load.Ref(ptr + 68, undefined); 1106 return create === A.H.TRUE ? A.H.push(x) : ref; 1107 }, 1108 "constof_ImageFormat": (ref: heap.Ref<string>): number => { 1109 const idx = ["RAW", "PNG", "JPEG"].indexOf(A.H.get(ref)); 1110 return idx < 0 ? 0 : idx + 1; 1111 }, 1112 1113 "store_ImageFrame": (ptr: Pointer, ref: heap.Ref<any>) => { 1114 const x = A.H.get<any>(ref); 1115 1116 if (typeof x === "undefined") { 1117 A.store.Bool(ptr + 23, false); 1118 A.store.Bool(ptr + 20, false); 1119 A.store.Int32(ptr + 0, 0); 1120 A.store.Bool(ptr + 21, false); 1121 A.store.Int32(ptr + 4, 0); 1122 A.store.Enum(ptr + 8, -1); 1123 A.store.Bool(ptr + 22, false); 1124 A.store.Int32(ptr + 12, 0); 1125 A.store.Ref(ptr + 16, undefined); 1126 } else { 1127 A.store.Bool(ptr + 23, true); 1128 A.store.Bool(ptr + 20, "width" in x ? true : false); 1129 A.store.Int32(ptr + 0, x["width"] === undefined ? 0 : (x["width"] as number)); 1130 A.store.Bool(ptr + 21, "height" in x ? true : false); 1131 A.store.Int32(ptr + 4, x["height"] === undefined ? 0 : (x["height"] as number)); 1132 A.store.Enum(ptr + 8, ["RAW", "PNG", "JPEG"].indexOf(x["format"] as string)); 1133 A.store.Bool(ptr + 22, "dataLength" in x ? true : false); 1134 A.store.Int32(ptr + 12, x["dataLength"] === undefined ? 0 : (x["dataLength"] as number)); 1135 A.store.Ref(ptr + 16, x["frame"]); 1136 } 1137 }, 1138 "load_ImageFrame": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1139 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1140 1141 if (A.load.Bool(ptr + 20)) { 1142 x["width"] = A.load.Int32(ptr + 0); 1143 } else { 1144 delete x["width"]; 1145 } 1146 if (A.load.Bool(ptr + 21)) { 1147 x["height"] = A.load.Int32(ptr + 4); 1148 } else { 1149 delete x["height"]; 1150 } 1151 x["format"] = A.load.Enum(ptr + 8, ["RAW", "PNG", "JPEG"]); 1152 if (A.load.Bool(ptr + 22)) { 1153 x["dataLength"] = A.load.Int32(ptr + 12); 1154 } else { 1155 delete x["dataLength"]; 1156 } 1157 x["frame"] = A.load.Ref(ptr + 16, undefined); 1158 return create === A.H.TRUE ? A.H.push(x) : ref; 1159 }, 1160 1161 "store_Metadata": (ptr: Pointer, ref: heap.Ref<any>) => { 1162 const x = A.H.get<any>(ref); 1163 1164 if (typeof x === "undefined") { 1165 A.store.Bool(ptr + 4, false); 1166 A.store.Ref(ptr + 0, undefined); 1167 } else { 1168 A.store.Bool(ptr + 4, true); 1169 A.store.Ref(ptr + 0, x["visualExperienceControllerVersion"]); 1170 } 1171 }, 1172 "load_Metadata": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1173 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1174 1175 x["visualExperienceControllerVersion"] = A.load.Ref(ptr + 0, undefined); 1176 return create === A.H.TRUE ? A.H.push(x) : ref; 1177 }, 1178 1179 "store_PerceptionSample": (ptr: Pointer, ref: heap.Ref<any>) => { 1180 const x = A.H.get<any>(ref); 1181 1182 if (typeof x === "undefined") { 1183 A.store.Bool(ptr + 185, false); 1184 1185 A.store.Bool(ptr + 0 + 76, false); 1186 A.store.Bool(ptr + 0 + 72, false); 1187 A.store.Int32(ptr + 0 + 0, 0); 1188 A.store.Bool(ptr + 0 + 73, false); 1189 A.store.Int32(ptr + 0 + 4, 0); 1190 A.store.Bool(ptr + 0 + 74, false); 1191 A.store.Int32(ptr + 0 + 8, 0); 1192 A.store.Bool(ptr + 0 + 75, false); 1193 A.store.Float64(ptr + 0 + 16, 0); 1194 A.store.Ref(ptr + 0 + 24, undefined); 1195 A.store.Ref(ptr + 0 + 28, undefined); 1196 1197 A.store.Bool(ptr + 0 + 32 + 35, false); 1198 A.store.Bool(ptr + 0 + 32 + 32, false); 1199 A.store.Float64(ptr + 0 + 32 + 0, 0); 1200 A.store.Bool(ptr + 0 + 32 + 33, false); 1201 A.store.Float64(ptr + 0 + 32 + 8, 0); 1202 A.store.Enum(ptr + 0 + 32 + 16, -1); 1203 A.store.Bool(ptr + 0 + 32 + 34, false); 1204 A.store.Float64(ptr + 0 + 32 + 24, 0); 1205 A.store.Ref(ptr + 0 + 68, undefined); 1206 1207 A.store.Bool(ptr + 80 + 23, false); 1208 A.store.Bool(ptr + 80 + 20, false); 1209 A.store.Int32(ptr + 80 + 0, 0); 1210 A.store.Bool(ptr + 80 + 21, false); 1211 A.store.Int32(ptr + 80 + 4, 0); 1212 A.store.Enum(ptr + 80 + 8, -1); 1213 A.store.Bool(ptr + 80 + 22, false); 1214 A.store.Int32(ptr + 80 + 12, 0); 1215 A.store.Ref(ptr + 80 + 16, undefined); 1216 1217 A.store.Bool(ptr + 104 + 54, false); 1218 A.store.Bool(ptr + 104 + 53, false); 1219 A.store.Float64(ptr + 104 + 0, 0); 1220 1221 A.store.Bool(ptr + 104 + 8 + 13, false); 1222 A.store.Bool(ptr + 104 + 8 + 12, false); 1223 A.store.Float64(ptr + 104 + 8 + 0, 0); 1224 A.store.Ref(ptr + 104 + 8 + 8, undefined); 1225 1226 A.store.Bool(ptr + 104 + 24 + 22, false); 1227 A.store.Bool(ptr + 104 + 24 + 21, false); 1228 A.store.Float64(ptr + 104 + 24 + 0, 0); 1229 1230 A.store.Bool(ptr + 104 + 24 + 8 + 4, false); 1231 A.store.Ref(ptr + 104 + 24 + 8 + 0, undefined); 1232 1233 A.store.Bool(ptr + 104 + 24 + 16 + 4, false); 1234 A.store.Ref(ptr + 104 + 24 + 16 + 0, undefined); 1235 1236 A.store.Bool(ptr + 104 + 48 + 4, false); 1237 A.store.Ref(ptr + 104 + 48 + 0, undefined); 1238 1239 A.store.Bool(ptr + 160 + 19, false); 1240 A.store.Bool(ptr + 160 + 18, false); 1241 A.store.Float64(ptr + 160 + 0, 0); 1242 1243 A.store.Bool(ptr + 160 + 8 + 9, false); 1244 A.store.Bool(ptr + 160 + 8 + 8, false); 1245 A.store.Float64(ptr + 160 + 8 + 0, 0); 1246 1247 A.store.Bool(ptr + 180 + 4, false); 1248 A.store.Ref(ptr + 180 + 0, undefined); 1249 } else { 1250 A.store.Bool(ptr + 185, true); 1251 1252 if (typeof x["framePerception"] === "undefined") { 1253 A.store.Bool(ptr + 0 + 76, false); 1254 A.store.Bool(ptr + 0 + 72, false); 1255 A.store.Int32(ptr + 0 + 0, 0); 1256 A.store.Bool(ptr + 0 + 73, false); 1257 A.store.Int32(ptr + 0 + 4, 0); 1258 A.store.Bool(ptr + 0 + 74, false); 1259 A.store.Int32(ptr + 0 + 8, 0); 1260 A.store.Bool(ptr + 0 + 75, false); 1261 A.store.Float64(ptr + 0 + 16, 0); 1262 A.store.Ref(ptr + 0 + 24, undefined); 1263 A.store.Ref(ptr + 0 + 28, undefined); 1264 1265 A.store.Bool(ptr + 0 + 32 + 35, false); 1266 A.store.Bool(ptr + 0 + 32 + 32, false); 1267 A.store.Float64(ptr + 0 + 32 + 0, 0); 1268 A.store.Bool(ptr + 0 + 32 + 33, false); 1269 A.store.Float64(ptr + 0 + 32 + 8, 0); 1270 A.store.Enum(ptr + 0 + 32 + 16, -1); 1271 A.store.Bool(ptr + 0 + 32 + 34, false); 1272 A.store.Float64(ptr + 0 + 32 + 24, 0); 1273 A.store.Ref(ptr + 0 + 68, undefined); 1274 } else { 1275 A.store.Bool(ptr + 0 + 76, true); 1276 A.store.Bool(ptr + 0 + 72, "frameId" in x["framePerception"] ? true : false); 1277 A.store.Int32( 1278 ptr + 0 + 0, 1279 x["framePerception"]["frameId"] === undefined ? 0 : (x["framePerception"]["frameId"] as number) 1280 ); 1281 A.store.Bool(ptr + 0 + 73, "frameWidthInPx" in x["framePerception"] ? true : false); 1282 A.store.Int32( 1283 ptr + 0 + 4, 1284 x["framePerception"]["frameWidthInPx"] === undefined 1285 ? 0 1286 : (x["framePerception"]["frameWidthInPx"] as number) 1287 ); 1288 A.store.Bool(ptr + 0 + 74, "frameHeightInPx" in x["framePerception"] ? true : false); 1289 A.store.Int32( 1290 ptr + 0 + 8, 1291 x["framePerception"]["frameHeightInPx"] === undefined 1292 ? 0 1293 : (x["framePerception"]["frameHeightInPx"] as number) 1294 ); 1295 A.store.Bool(ptr + 0 + 75, "timestamp" in x["framePerception"] ? true : false); 1296 A.store.Float64( 1297 ptr + 0 + 16, 1298 x["framePerception"]["timestamp"] === undefined ? 0 : (x["framePerception"]["timestamp"] as number) 1299 ); 1300 A.store.Ref(ptr + 0 + 24, x["framePerception"]["entities"]); 1301 A.store.Ref(ptr + 0 + 28, x["framePerception"]["packetLatency"]); 1302 1303 if (typeof x["framePerception"]["videoHumanPresenceDetection"] === "undefined") { 1304 A.store.Bool(ptr + 0 + 32 + 35, false); 1305 A.store.Bool(ptr + 0 + 32 + 32, false); 1306 A.store.Float64(ptr + 0 + 32 + 0, 0); 1307 A.store.Bool(ptr + 0 + 32 + 33, false); 1308 A.store.Float64(ptr + 0 + 32 + 8, 0); 1309 A.store.Enum(ptr + 0 + 32 + 16, -1); 1310 A.store.Bool(ptr + 0 + 32 + 34, false); 1311 A.store.Float64(ptr + 0 + 32 + 24, 0); 1312 } else { 1313 A.store.Bool(ptr + 0 + 32 + 35, true); 1314 A.store.Bool( 1315 ptr + 0 + 32 + 32, 1316 "humanPresenceLikelihood" in x["framePerception"]["videoHumanPresenceDetection"] ? true : false 1317 ); 1318 A.store.Float64( 1319 ptr + 0 + 32 + 0, 1320 x["framePerception"]["videoHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 1321 ? 0 1322 : (x["framePerception"]["videoHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 1323 ); 1324 A.store.Bool( 1325 ptr + 0 + 32 + 33, 1326 "motionDetectedLikelihood" in x["framePerception"]["videoHumanPresenceDetection"] ? true : false 1327 ); 1328 A.store.Float64( 1329 ptr + 0 + 32 + 8, 1330 x["framePerception"]["videoHumanPresenceDetection"]["motionDetectedLikelihood"] === undefined 1331 ? 0 1332 : (x["framePerception"]["videoHumanPresenceDetection"]["motionDetectedLikelihood"] as number) 1333 ); 1334 A.store.Enum( 1335 ptr + 0 + 32 + 16, 1336 ["UNSPECIFIED", "NO_CHANGE", "TURNED_ON", "TURNED_OFF", "DIMMER", "BRIGHTER", "BLACK_FRAME"].indexOf( 1337 x["framePerception"]["videoHumanPresenceDetection"]["lightCondition"] as string 1338 ) 1339 ); 1340 A.store.Bool( 1341 ptr + 0 + 32 + 34, 1342 "lightConditionLikelihood" in x["framePerception"]["videoHumanPresenceDetection"] ? true : false 1343 ); 1344 A.store.Float64( 1345 ptr + 0 + 32 + 24, 1346 x["framePerception"]["videoHumanPresenceDetection"]["lightConditionLikelihood"] === undefined 1347 ? 0 1348 : (x["framePerception"]["videoHumanPresenceDetection"]["lightConditionLikelihood"] as number) 1349 ); 1350 } 1351 A.store.Ref(ptr + 0 + 68, x["framePerception"]["framePerceptionTypes"]); 1352 } 1353 1354 if (typeof x["imageFrame"] === "undefined") { 1355 A.store.Bool(ptr + 80 + 23, false); 1356 A.store.Bool(ptr + 80 + 20, false); 1357 A.store.Int32(ptr + 80 + 0, 0); 1358 A.store.Bool(ptr + 80 + 21, false); 1359 A.store.Int32(ptr + 80 + 4, 0); 1360 A.store.Enum(ptr + 80 + 8, -1); 1361 A.store.Bool(ptr + 80 + 22, false); 1362 A.store.Int32(ptr + 80 + 12, 0); 1363 A.store.Ref(ptr + 80 + 16, undefined); 1364 } else { 1365 A.store.Bool(ptr + 80 + 23, true); 1366 A.store.Bool(ptr + 80 + 20, "width" in x["imageFrame"] ? true : false); 1367 A.store.Int32( 1368 ptr + 80 + 0, 1369 x["imageFrame"]["width"] === undefined ? 0 : (x["imageFrame"]["width"] as number) 1370 ); 1371 A.store.Bool(ptr + 80 + 21, "height" in x["imageFrame"] ? true : false); 1372 A.store.Int32( 1373 ptr + 80 + 4, 1374 x["imageFrame"]["height"] === undefined ? 0 : (x["imageFrame"]["height"] as number) 1375 ); 1376 A.store.Enum(ptr + 80 + 8, ["RAW", "PNG", "JPEG"].indexOf(x["imageFrame"]["format"] as string)); 1377 A.store.Bool(ptr + 80 + 22, "dataLength" in x["imageFrame"] ? true : false); 1378 A.store.Int32( 1379 ptr + 80 + 12, 1380 x["imageFrame"]["dataLength"] === undefined ? 0 : (x["imageFrame"]["dataLength"] as number) 1381 ); 1382 A.store.Ref(ptr + 80 + 16, x["imageFrame"]["frame"]); 1383 } 1384 1385 if (typeof x["audioPerception"] === "undefined") { 1386 A.store.Bool(ptr + 104 + 54, false); 1387 A.store.Bool(ptr + 104 + 53, false); 1388 A.store.Float64(ptr + 104 + 0, 0); 1389 1390 A.store.Bool(ptr + 104 + 8 + 13, false); 1391 A.store.Bool(ptr + 104 + 8 + 12, false); 1392 A.store.Float64(ptr + 104 + 8 + 0, 0); 1393 A.store.Ref(ptr + 104 + 8 + 8, undefined); 1394 1395 A.store.Bool(ptr + 104 + 24 + 22, false); 1396 A.store.Bool(ptr + 104 + 24 + 21, false); 1397 A.store.Float64(ptr + 104 + 24 + 0, 0); 1398 1399 A.store.Bool(ptr + 104 + 24 + 8 + 4, false); 1400 A.store.Ref(ptr + 104 + 24 + 8 + 0, undefined); 1401 1402 A.store.Bool(ptr + 104 + 24 + 16 + 4, false); 1403 A.store.Ref(ptr + 104 + 24 + 16 + 0, undefined); 1404 1405 A.store.Bool(ptr + 104 + 48 + 4, false); 1406 A.store.Ref(ptr + 104 + 48 + 0, undefined); 1407 } else { 1408 A.store.Bool(ptr + 104 + 54, true); 1409 A.store.Bool(ptr + 104 + 53, "timestampUs" in x["audioPerception"] ? true : false); 1410 A.store.Float64( 1411 ptr + 104 + 0, 1412 x["audioPerception"]["timestampUs"] === undefined ? 0 : (x["audioPerception"]["timestampUs"] as number) 1413 ); 1414 1415 if (typeof x["audioPerception"]["audioLocalization"] === "undefined") { 1416 A.store.Bool(ptr + 104 + 8 + 13, false); 1417 A.store.Bool(ptr + 104 + 8 + 12, false); 1418 A.store.Float64(ptr + 104 + 8 + 0, 0); 1419 A.store.Ref(ptr + 104 + 8 + 8, undefined); 1420 } else { 1421 A.store.Bool(ptr + 104 + 8 + 13, true); 1422 A.store.Bool( 1423 ptr + 104 + 8 + 12, 1424 "azimuthRadians" in x["audioPerception"]["audioLocalization"] ? true : false 1425 ); 1426 A.store.Float64( 1427 ptr + 104 + 8 + 0, 1428 x["audioPerception"]["audioLocalization"]["azimuthRadians"] === undefined 1429 ? 0 1430 : (x["audioPerception"]["audioLocalization"]["azimuthRadians"] as number) 1431 ); 1432 A.store.Ref(ptr + 104 + 8 + 8, x["audioPerception"]["audioLocalization"]["azimuthScores"]); 1433 } 1434 1435 if (typeof x["audioPerception"]["audioHumanPresenceDetection"] === "undefined") { 1436 A.store.Bool(ptr + 104 + 24 + 22, false); 1437 A.store.Bool(ptr + 104 + 24 + 21, false); 1438 A.store.Float64(ptr + 104 + 24 + 0, 0); 1439 1440 A.store.Bool(ptr + 104 + 24 + 8 + 4, false); 1441 A.store.Ref(ptr + 104 + 24 + 8 + 0, undefined); 1442 1443 A.store.Bool(ptr + 104 + 24 + 16 + 4, false); 1444 A.store.Ref(ptr + 104 + 24 + 16 + 0, undefined); 1445 } else { 1446 A.store.Bool(ptr + 104 + 24 + 22, true); 1447 A.store.Bool( 1448 ptr + 104 + 24 + 21, 1449 "humanPresenceLikelihood" in x["audioPerception"]["audioHumanPresenceDetection"] ? true : false 1450 ); 1451 A.store.Float64( 1452 ptr + 104 + 24 + 0, 1453 x["audioPerception"]["audioHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 1454 ? 0 1455 : (x["audioPerception"]["audioHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 1456 ); 1457 1458 if (typeof x["audioPerception"]["audioHumanPresenceDetection"]["noiseSpectrogram"] === "undefined") { 1459 A.store.Bool(ptr + 104 + 24 + 8 + 4, false); 1460 A.store.Ref(ptr + 104 + 24 + 8 + 0, undefined); 1461 } else { 1462 A.store.Bool(ptr + 104 + 24 + 8 + 4, true); 1463 A.store.Ref( 1464 ptr + 104 + 24 + 8 + 0, 1465 x["audioPerception"]["audioHumanPresenceDetection"]["noiseSpectrogram"]["values"] 1466 ); 1467 } 1468 1469 if (typeof x["audioPerception"]["audioHumanPresenceDetection"]["frameSpectrogram"] === "undefined") { 1470 A.store.Bool(ptr + 104 + 24 + 16 + 4, false); 1471 A.store.Ref(ptr + 104 + 24 + 16 + 0, undefined); 1472 } else { 1473 A.store.Bool(ptr + 104 + 24 + 16 + 4, true); 1474 A.store.Ref( 1475 ptr + 104 + 24 + 16 + 0, 1476 x["audioPerception"]["audioHumanPresenceDetection"]["frameSpectrogram"]["values"] 1477 ); 1478 } 1479 } 1480 1481 if (typeof x["audioPerception"]["hotwordDetection"] === "undefined") { 1482 A.store.Bool(ptr + 104 + 48 + 4, false); 1483 A.store.Ref(ptr + 104 + 48 + 0, undefined); 1484 } else { 1485 A.store.Bool(ptr + 104 + 48 + 4, true); 1486 A.store.Ref(ptr + 104 + 48 + 0, x["audioPerception"]["hotwordDetection"]["hotwords"]); 1487 } 1488 } 1489 1490 if (typeof x["audioVisualPerception"] === "undefined") { 1491 A.store.Bool(ptr + 160 + 19, false); 1492 A.store.Bool(ptr + 160 + 18, false); 1493 A.store.Float64(ptr + 160 + 0, 0); 1494 1495 A.store.Bool(ptr + 160 + 8 + 9, false); 1496 A.store.Bool(ptr + 160 + 8 + 8, false); 1497 A.store.Float64(ptr + 160 + 8 + 0, 0); 1498 } else { 1499 A.store.Bool(ptr + 160 + 19, true); 1500 A.store.Bool(ptr + 160 + 18, "timestampUs" in x["audioVisualPerception"] ? true : false); 1501 A.store.Float64( 1502 ptr + 160 + 0, 1503 x["audioVisualPerception"]["timestampUs"] === undefined 1504 ? 0 1505 : (x["audioVisualPerception"]["timestampUs"] as number) 1506 ); 1507 1508 if (typeof x["audioVisualPerception"]["audioVisualHumanPresenceDetection"] === "undefined") { 1509 A.store.Bool(ptr + 160 + 8 + 9, false); 1510 A.store.Bool(ptr + 160 + 8 + 8, false); 1511 A.store.Float64(ptr + 160 + 8 + 0, 0); 1512 } else { 1513 A.store.Bool(ptr + 160 + 8 + 9, true); 1514 A.store.Bool( 1515 ptr + 160 + 8 + 8, 1516 "humanPresenceLikelihood" in x["audioVisualPerception"]["audioVisualHumanPresenceDetection"] 1517 ? true 1518 : false 1519 ); 1520 A.store.Float64( 1521 ptr + 160 + 8 + 0, 1522 x["audioVisualPerception"]["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] === undefined 1523 ? 0 1524 : (x["audioVisualPerception"]["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] as number) 1525 ); 1526 } 1527 } 1528 1529 if (typeof x["metadata"] === "undefined") { 1530 A.store.Bool(ptr + 180 + 4, false); 1531 A.store.Ref(ptr + 180 + 0, undefined); 1532 } else { 1533 A.store.Bool(ptr + 180 + 4, true); 1534 A.store.Ref(ptr + 180 + 0, x["metadata"]["visualExperienceControllerVersion"]); 1535 } 1536 } 1537 }, 1538 "load_PerceptionSample": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1539 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1540 1541 if (A.load.Bool(ptr + 0 + 76)) { 1542 x["framePerception"] = {}; 1543 if (A.load.Bool(ptr + 0 + 72)) { 1544 x["framePerception"]["frameId"] = A.load.Int32(ptr + 0 + 0); 1545 } else { 1546 delete x["framePerception"]["frameId"]; 1547 } 1548 if (A.load.Bool(ptr + 0 + 73)) { 1549 x["framePerception"]["frameWidthInPx"] = A.load.Int32(ptr + 0 + 4); 1550 } else { 1551 delete x["framePerception"]["frameWidthInPx"]; 1552 } 1553 if (A.load.Bool(ptr + 0 + 74)) { 1554 x["framePerception"]["frameHeightInPx"] = A.load.Int32(ptr + 0 + 8); 1555 } else { 1556 delete x["framePerception"]["frameHeightInPx"]; 1557 } 1558 if (A.load.Bool(ptr + 0 + 75)) { 1559 x["framePerception"]["timestamp"] = A.load.Float64(ptr + 0 + 16); 1560 } else { 1561 delete x["framePerception"]["timestamp"]; 1562 } 1563 x["framePerception"]["entities"] = A.load.Ref(ptr + 0 + 24, undefined); 1564 x["framePerception"]["packetLatency"] = A.load.Ref(ptr + 0 + 28, undefined); 1565 if (A.load.Bool(ptr + 0 + 32 + 35)) { 1566 x["framePerception"]["videoHumanPresenceDetection"] = {}; 1567 if (A.load.Bool(ptr + 0 + 32 + 32)) { 1568 x["framePerception"]["videoHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64( 1569 ptr + 0 + 32 + 0 1570 ); 1571 } else { 1572 delete x["framePerception"]["videoHumanPresenceDetection"]["humanPresenceLikelihood"]; 1573 } 1574 if (A.load.Bool(ptr + 0 + 32 + 33)) { 1575 x["framePerception"]["videoHumanPresenceDetection"]["motionDetectedLikelihood"] = A.load.Float64( 1576 ptr + 0 + 32 + 8 1577 ); 1578 } else { 1579 delete x["framePerception"]["videoHumanPresenceDetection"]["motionDetectedLikelihood"]; 1580 } 1581 x["framePerception"]["videoHumanPresenceDetection"]["lightCondition"] = A.load.Enum(ptr + 0 + 32 + 16, [ 1582 "UNSPECIFIED", 1583 "NO_CHANGE", 1584 "TURNED_ON", 1585 "TURNED_OFF", 1586 "DIMMER", 1587 "BRIGHTER", 1588 "BLACK_FRAME", 1589 ]); 1590 if (A.load.Bool(ptr + 0 + 32 + 34)) { 1591 x["framePerception"]["videoHumanPresenceDetection"]["lightConditionLikelihood"] = A.load.Float64( 1592 ptr + 0 + 32 + 24 1593 ); 1594 } else { 1595 delete x["framePerception"]["videoHumanPresenceDetection"]["lightConditionLikelihood"]; 1596 } 1597 } else { 1598 delete x["framePerception"]["videoHumanPresenceDetection"]; 1599 } 1600 x["framePerception"]["framePerceptionTypes"] = A.load.Ref(ptr + 0 + 68, undefined); 1601 } else { 1602 delete x["framePerception"]; 1603 } 1604 if (A.load.Bool(ptr + 80 + 23)) { 1605 x["imageFrame"] = {}; 1606 if (A.load.Bool(ptr + 80 + 20)) { 1607 x["imageFrame"]["width"] = A.load.Int32(ptr + 80 + 0); 1608 } else { 1609 delete x["imageFrame"]["width"]; 1610 } 1611 if (A.load.Bool(ptr + 80 + 21)) { 1612 x["imageFrame"]["height"] = A.load.Int32(ptr + 80 + 4); 1613 } else { 1614 delete x["imageFrame"]["height"]; 1615 } 1616 x["imageFrame"]["format"] = A.load.Enum(ptr + 80 + 8, ["RAW", "PNG", "JPEG"]); 1617 if (A.load.Bool(ptr + 80 + 22)) { 1618 x["imageFrame"]["dataLength"] = A.load.Int32(ptr + 80 + 12); 1619 } else { 1620 delete x["imageFrame"]["dataLength"]; 1621 } 1622 x["imageFrame"]["frame"] = A.load.Ref(ptr + 80 + 16, undefined); 1623 } else { 1624 delete x["imageFrame"]; 1625 } 1626 if (A.load.Bool(ptr + 104 + 54)) { 1627 x["audioPerception"] = {}; 1628 if (A.load.Bool(ptr + 104 + 53)) { 1629 x["audioPerception"]["timestampUs"] = A.load.Float64(ptr + 104 + 0); 1630 } else { 1631 delete x["audioPerception"]["timestampUs"]; 1632 } 1633 if (A.load.Bool(ptr + 104 + 8 + 13)) { 1634 x["audioPerception"]["audioLocalization"] = {}; 1635 if (A.load.Bool(ptr + 104 + 8 + 12)) { 1636 x["audioPerception"]["audioLocalization"]["azimuthRadians"] = A.load.Float64(ptr + 104 + 8 + 0); 1637 } else { 1638 delete x["audioPerception"]["audioLocalization"]["azimuthRadians"]; 1639 } 1640 x["audioPerception"]["audioLocalization"]["azimuthScores"] = A.load.Ref(ptr + 104 + 8 + 8, undefined); 1641 } else { 1642 delete x["audioPerception"]["audioLocalization"]; 1643 } 1644 if (A.load.Bool(ptr + 104 + 24 + 22)) { 1645 x["audioPerception"]["audioHumanPresenceDetection"] = {}; 1646 if (A.load.Bool(ptr + 104 + 24 + 21)) { 1647 x["audioPerception"]["audioHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64( 1648 ptr + 104 + 24 + 0 1649 ); 1650 } else { 1651 delete x["audioPerception"]["audioHumanPresenceDetection"]["humanPresenceLikelihood"]; 1652 } 1653 if (A.load.Bool(ptr + 104 + 24 + 8 + 4)) { 1654 x["audioPerception"]["audioHumanPresenceDetection"]["noiseSpectrogram"] = {}; 1655 x["audioPerception"]["audioHumanPresenceDetection"]["noiseSpectrogram"]["values"] = A.load.Ref( 1656 ptr + 104 + 24 + 8 + 0, 1657 undefined 1658 ); 1659 } else { 1660 delete x["audioPerception"]["audioHumanPresenceDetection"]["noiseSpectrogram"]; 1661 } 1662 if (A.load.Bool(ptr + 104 + 24 + 16 + 4)) { 1663 x["audioPerception"]["audioHumanPresenceDetection"]["frameSpectrogram"] = {}; 1664 x["audioPerception"]["audioHumanPresenceDetection"]["frameSpectrogram"]["values"] = A.load.Ref( 1665 ptr + 104 + 24 + 16 + 0, 1666 undefined 1667 ); 1668 } else { 1669 delete x["audioPerception"]["audioHumanPresenceDetection"]["frameSpectrogram"]; 1670 } 1671 } else { 1672 delete x["audioPerception"]["audioHumanPresenceDetection"]; 1673 } 1674 if (A.load.Bool(ptr + 104 + 48 + 4)) { 1675 x["audioPerception"]["hotwordDetection"] = {}; 1676 x["audioPerception"]["hotwordDetection"]["hotwords"] = A.load.Ref(ptr + 104 + 48 + 0, undefined); 1677 } else { 1678 delete x["audioPerception"]["hotwordDetection"]; 1679 } 1680 } else { 1681 delete x["audioPerception"]; 1682 } 1683 if (A.load.Bool(ptr + 160 + 19)) { 1684 x["audioVisualPerception"] = {}; 1685 if (A.load.Bool(ptr + 160 + 18)) { 1686 x["audioVisualPerception"]["timestampUs"] = A.load.Float64(ptr + 160 + 0); 1687 } else { 1688 delete x["audioVisualPerception"]["timestampUs"]; 1689 } 1690 if (A.load.Bool(ptr + 160 + 8 + 9)) { 1691 x["audioVisualPerception"]["audioVisualHumanPresenceDetection"] = {}; 1692 if (A.load.Bool(ptr + 160 + 8 + 8)) { 1693 x["audioVisualPerception"]["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"] = A.load.Float64( 1694 ptr + 160 + 8 + 0 1695 ); 1696 } else { 1697 delete x["audioVisualPerception"]["audioVisualHumanPresenceDetection"]["humanPresenceLikelihood"]; 1698 } 1699 } else { 1700 delete x["audioVisualPerception"]["audioVisualHumanPresenceDetection"]; 1701 } 1702 } else { 1703 delete x["audioVisualPerception"]; 1704 } 1705 if (A.load.Bool(ptr + 180 + 4)) { 1706 x["metadata"] = {}; 1707 x["metadata"]["visualExperienceControllerVersion"] = A.load.Ref(ptr + 180 + 0, undefined); 1708 } else { 1709 delete x["metadata"]; 1710 } 1711 return create === A.H.TRUE ? A.H.push(x) : ref; 1712 }, 1713 1714 "store_Diagnostics": (ptr: Pointer, ref: heap.Ref<any>) => { 1715 const x = A.H.get<any>(ref); 1716 1717 if (typeof x === "undefined") { 1718 A.store.Bool(ptr + 8, false); 1719 A.store.Enum(ptr + 0, -1); 1720 A.store.Ref(ptr + 4, undefined); 1721 } else { 1722 A.store.Bool(ptr + 8, true); 1723 A.store.Enum( 1724 ptr + 0, 1725 [ 1726 "SERVICE_UNREACHABLE", 1727 "SERVICE_NOT_RUNNING", 1728 "SERVICE_BUSY_LAUNCHING", 1729 "SERVICE_NOT_INSTALLED", 1730 "MOJO_CONNECTION_FAILURE", 1731 ].indexOf(x["serviceError"] as string) 1732 ); 1733 A.store.Ref(ptr + 4, x["perceptionSamples"]); 1734 } 1735 }, 1736 "load_Diagnostics": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1737 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1738 1739 x["serviceError"] = A.load.Enum(ptr + 0, [ 1740 "SERVICE_UNREACHABLE", 1741 "SERVICE_NOT_RUNNING", 1742 "SERVICE_BUSY_LAUNCHING", 1743 "SERVICE_NOT_INSTALLED", 1744 "MOJO_CONNECTION_FAILURE", 1745 ]); 1746 x["perceptionSamples"] = A.load.Ref(ptr + 4, undefined); 1747 return create === A.H.TRUE ? A.H.push(x) : ref; 1748 }, 1749 "constof_Feature": (ref: heap.Ref<string>): number => { 1750 const idx = [ 1751 "AUTOZOOM", 1752 "HOTWORD_DETECTION", 1753 "OCCUPANCY_DETECTION", 1754 "EDGE_EMBEDDINGS", 1755 "SOFTWARE_CROPPING", 1756 ].indexOf(A.H.get(ref)); 1757 return idx < 0 ? 0 : idx + 1; 1758 }, 1759 1760 "store_MediaPerception": (ptr: Pointer, ref: heap.Ref<any>) => { 1761 const x = A.H.get<any>(ref); 1762 1763 if (typeof x === "undefined") { 1764 A.store.Bool(ptr + 26, false); 1765 A.store.Bool(ptr + 25, false); 1766 A.store.Float64(ptr + 0, 0); 1767 A.store.Ref(ptr + 8, undefined); 1768 A.store.Ref(ptr + 12, undefined); 1769 A.store.Ref(ptr + 16, undefined); 1770 1771 A.store.Bool(ptr + 20 + 4, false); 1772 A.store.Ref(ptr + 20 + 0, undefined); 1773 } else { 1774 A.store.Bool(ptr + 26, true); 1775 A.store.Bool(ptr + 25, "timestamp" in x ? true : false); 1776 A.store.Float64(ptr + 0, x["timestamp"] === undefined ? 0 : (x["timestamp"] as number)); 1777 A.store.Ref(ptr + 8, x["framePerceptions"]); 1778 A.store.Ref(ptr + 12, x["audioPerceptions"]); 1779 A.store.Ref(ptr + 16, x["audioVisualPerceptions"]); 1780 1781 if (typeof x["metadata"] === "undefined") { 1782 A.store.Bool(ptr + 20 + 4, false); 1783 A.store.Ref(ptr + 20 + 0, undefined); 1784 } else { 1785 A.store.Bool(ptr + 20 + 4, true); 1786 A.store.Ref(ptr + 20 + 0, x["metadata"]["visualExperienceControllerVersion"]); 1787 } 1788 } 1789 }, 1790 "load_MediaPerception": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1791 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1792 1793 if (A.load.Bool(ptr + 25)) { 1794 x["timestamp"] = A.load.Float64(ptr + 0); 1795 } else { 1796 delete x["timestamp"]; 1797 } 1798 x["framePerceptions"] = A.load.Ref(ptr + 8, undefined); 1799 x["audioPerceptions"] = A.load.Ref(ptr + 12, undefined); 1800 x["audioVisualPerceptions"] = A.load.Ref(ptr + 16, undefined); 1801 if (A.load.Bool(ptr + 20 + 4)) { 1802 x["metadata"] = {}; 1803 x["metadata"]["visualExperienceControllerVersion"] = A.load.Ref(ptr + 20 + 0, undefined); 1804 } else { 1805 delete x["metadata"]; 1806 } 1807 return create === A.H.TRUE ? A.H.push(x) : ref; 1808 }, 1809 1810 "store_NamedTemplateArgument": (ptr: Pointer, ref: heap.Ref<any>) => { 1811 const x = A.H.get<any>(ref); 1812 1813 if (typeof x === "undefined") { 1814 A.store.Bool(ptr + 8, false); 1815 A.store.Ref(ptr + 0, undefined); 1816 A.store.Ref(ptr + 4, undefined); 1817 } else { 1818 A.store.Bool(ptr + 8, true); 1819 A.store.Ref(ptr + 0, x["name"]); 1820 A.store.Ref(ptr + 4, x["value"]); 1821 } 1822 }, 1823 "load_NamedTemplateArgument": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1824 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1825 1826 x["name"] = A.load.Ref(ptr + 0, undefined); 1827 x["value"] = A.load.Ref(ptr + 4, undefined); 1828 return create === A.H.TRUE ? A.H.push(x) : ref; 1829 }, 1830 "constof_ProcessStatus": (ref: heap.Ref<string>): number => { 1831 const idx = ["UNKNOWN", "STARTED", "STOPPED", "SERVICE_ERROR"].indexOf(A.H.get(ref)); 1832 return idx < 0 ? 0 : idx + 1; 1833 }, 1834 1835 "store_ProcessState": (ptr: Pointer, ref: heap.Ref<any>) => { 1836 const x = A.H.get<any>(ref); 1837 1838 if (typeof x === "undefined") { 1839 A.store.Bool(ptr + 8, false); 1840 A.store.Enum(ptr + 0, -1); 1841 A.store.Enum(ptr + 4, -1); 1842 } else { 1843 A.store.Bool(ptr + 8, true); 1844 A.store.Enum(ptr + 0, ["UNKNOWN", "STARTED", "STOPPED", "SERVICE_ERROR"].indexOf(x["status"] as string)); 1845 A.store.Enum( 1846 ptr + 4, 1847 [ 1848 "SERVICE_UNREACHABLE", 1849 "SERVICE_NOT_RUNNING", 1850 "SERVICE_BUSY_LAUNCHING", 1851 "SERVICE_NOT_INSTALLED", 1852 "MOJO_CONNECTION_FAILURE", 1853 ].indexOf(x["serviceError"] as string) 1854 ); 1855 } 1856 }, 1857 "load_ProcessState": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1858 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1859 1860 x["status"] = A.load.Enum(ptr + 0, ["UNKNOWN", "STARTED", "STOPPED", "SERVICE_ERROR"]); 1861 x["serviceError"] = A.load.Enum(ptr + 4, [ 1862 "SERVICE_UNREACHABLE", 1863 "SERVICE_NOT_RUNNING", 1864 "SERVICE_BUSY_LAUNCHING", 1865 "SERVICE_NOT_INSTALLED", 1866 "MOJO_CONNECTION_FAILURE", 1867 ]); 1868 return create === A.H.TRUE ? A.H.push(x) : ref; 1869 }, 1870 "constof_Status": (ref: heap.Ref<string>): number => { 1871 const idx = [ 1872 "UNINITIALIZED", 1873 "STARTED", 1874 "RUNNING", 1875 "SUSPENDED", 1876 "RESTARTING", 1877 "STOPPED", 1878 "SERVICE_ERROR", 1879 ].indexOf(A.H.get(ref)); 1880 return idx < 0 ? 0 : idx + 1; 1881 }, 1882 1883 "store_VideoStreamParam": (ptr: Pointer, ref: heap.Ref<any>) => { 1884 const x = A.H.get<any>(ref); 1885 1886 if (typeof x === "undefined") { 1887 A.store.Bool(ptr + 19, false); 1888 A.store.Ref(ptr + 0, undefined); 1889 A.store.Bool(ptr + 16, false); 1890 A.store.Int32(ptr + 4, 0); 1891 A.store.Bool(ptr + 17, false); 1892 A.store.Int32(ptr + 8, 0); 1893 A.store.Bool(ptr + 18, false); 1894 A.store.Int32(ptr + 12, 0); 1895 } else { 1896 A.store.Bool(ptr + 19, true); 1897 A.store.Ref(ptr + 0, x["id"]); 1898 A.store.Bool(ptr + 16, "width" in x ? true : false); 1899 A.store.Int32(ptr + 4, x["width"] === undefined ? 0 : (x["width"] as number)); 1900 A.store.Bool(ptr + 17, "height" in x ? true : false); 1901 A.store.Int32(ptr + 8, x["height"] === undefined ? 0 : (x["height"] as number)); 1902 A.store.Bool(ptr + 18, "frameRate" in x ? true : false); 1903 A.store.Int32(ptr + 12, x["frameRate"] === undefined ? 0 : (x["frameRate"] as number)); 1904 } 1905 }, 1906 "load_VideoStreamParam": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 1907 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 1908 1909 x["id"] = A.load.Ref(ptr + 0, undefined); 1910 if (A.load.Bool(ptr + 16)) { 1911 x["width"] = A.load.Int32(ptr + 4); 1912 } else { 1913 delete x["width"]; 1914 } 1915 if (A.load.Bool(ptr + 17)) { 1916 x["height"] = A.load.Int32(ptr + 8); 1917 } else { 1918 delete x["height"]; 1919 } 1920 if (A.load.Bool(ptr + 18)) { 1921 x["frameRate"] = A.load.Int32(ptr + 12); 1922 } else { 1923 delete x["frameRate"]; 1924 } 1925 return create === A.H.TRUE ? A.H.push(x) : ref; 1926 }, 1927 1928 "store_Whiteboard": (ptr: Pointer, ref: heap.Ref<any>) => { 1929 const x = A.H.get<any>(ref); 1930 1931 if (typeof x === "undefined") { 1932 A.store.Bool(ptr + 105, false); 1933 1934 A.store.Bool(ptr + 0 + 18, false); 1935 A.store.Bool(ptr + 0 + 16, false); 1936 A.store.Float64(ptr + 0 + 0, 0); 1937 A.store.Bool(ptr + 0 + 17, false); 1938 A.store.Float64(ptr + 0 + 8, 0); 1939 1940 A.store.Bool(ptr + 24 + 18, false); 1941 A.store.Bool(ptr + 24 + 16, false); 1942 A.store.Float64(ptr + 24 + 0, 0); 1943 A.store.Bool(ptr + 24 + 17, false); 1944 A.store.Float64(ptr + 24 + 8, 0); 1945 1946 A.store.Bool(ptr + 48 + 18, false); 1947 A.store.Bool(ptr + 48 + 16, false); 1948 A.store.Float64(ptr + 48 + 0, 0); 1949 A.store.Bool(ptr + 48 + 17, false); 1950 A.store.Float64(ptr + 48 + 8, 0); 1951 1952 A.store.Bool(ptr + 72 + 18, false); 1953 A.store.Bool(ptr + 72 + 16, false); 1954 A.store.Float64(ptr + 72 + 0, 0); 1955 A.store.Bool(ptr + 72 + 17, false); 1956 A.store.Float64(ptr + 72 + 8, 0); 1957 A.store.Bool(ptr + 104, false); 1958 A.store.Float64(ptr + 96, 0); 1959 } else { 1960 A.store.Bool(ptr + 105, true); 1961 1962 if (typeof x["topLeft"] === "undefined") { 1963 A.store.Bool(ptr + 0 + 18, false); 1964 A.store.Bool(ptr + 0 + 16, false); 1965 A.store.Float64(ptr + 0 + 0, 0); 1966 A.store.Bool(ptr + 0 + 17, false); 1967 A.store.Float64(ptr + 0 + 8, 0); 1968 } else { 1969 A.store.Bool(ptr + 0 + 18, true); 1970 A.store.Bool(ptr + 0 + 16, "x" in x["topLeft"] ? true : false); 1971 A.store.Float64(ptr + 0 + 0, x["topLeft"]["x"] === undefined ? 0 : (x["topLeft"]["x"] as number)); 1972 A.store.Bool(ptr + 0 + 17, "y" in x["topLeft"] ? true : false); 1973 A.store.Float64(ptr + 0 + 8, x["topLeft"]["y"] === undefined ? 0 : (x["topLeft"]["y"] as number)); 1974 } 1975 1976 if (typeof x["topRight"] === "undefined") { 1977 A.store.Bool(ptr + 24 + 18, false); 1978 A.store.Bool(ptr + 24 + 16, false); 1979 A.store.Float64(ptr + 24 + 0, 0); 1980 A.store.Bool(ptr + 24 + 17, false); 1981 A.store.Float64(ptr + 24 + 8, 0); 1982 } else { 1983 A.store.Bool(ptr + 24 + 18, true); 1984 A.store.Bool(ptr + 24 + 16, "x" in x["topRight"] ? true : false); 1985 A.store.Float64(ptr + 24 + 0, x["topRight"]["x"] === undefined ? 0 : (x["topRight"]["x"] as number)); 1986 A.store.Bool(ptr + 24 + 17, "y" in x["topRight"] ? true : false); 1987 A.store.Float64(ptr + 24 + 8, x["topRight"]["y"] === undefined ? 0 : (x["topRight"]["y"] as number)); 1988 } 1989 1990 if (typeof x["bottomLeft"] === "undefined") { 1991 A.store.Bool(ptr + 48 + 18, false); 1992 A.store.Bool(ptr + 48 + 16, false); 1993 A.store.Float64(ptr + 48 + 0, 0); 1994 A.store.Bool(ptr + 48 + 17, false); 1995 A.store.Float64(ptr + 48 + 8, 0); 1996 } else { 1997 A.store.Bool(ptr + 48 + 18, true); 1998 A.store.Bool(ptr + 48 + 16, "x" in x["bottomLeft"] ? true : false); 1999 A.store.Float64(ptr + 48 + 0, x["bottomLeft"]["x"] === undefined ? 0 : (x["bottomLeft"]["x"] as number)); 2000 A.store.Bool(ptr + 48 + 17, "y" in x["bottomLeft"] ? true : false); 2001 A.store.Float64(ptr + 48 + 8, x["bottomLeft"]["y"] === undefined ? 0 : (x["bottomLeft"]["y"] as number)); 2002 } 2003 2004 if (typeof x["bottomRight"] === "undefined") { 2005 A.store.Bool(ptr + 72 + 18, false); 2006 A.store.Bool(ptr + 72 + 16, false); 2007 A.store.Float64(ptr + 72 + 0, 0); 2008 A.store.Bool(ptr + 72 + 17, false); 2009 A.store.Float64(ptr + 72 + 8, 0); 2010 } else { 2011 A.store.Bool(ptr + 72 + 18, true); 2012 A.store.Bool(ptr + 72 + 16, "x" in x["bottomRight"] ? true : false); 2013 A.store.Float64(ptr + 72 + 0, x["bottomRight"]["x"] === undefined ? 0 : (x["bottomRight"]["x"] as number)); 2014 A.store.Bool(ptr + 72 + 17, "y" in x["bottomRight"] ? true : false); 2015 A.store.Float64(ptr + 72 + 8, x["bottomRight"]["y"] === undefined ? 0 : (x["bottomRight"]["y"] as number)); 2016 } 2017 A.store.Bool(ptr + 104, "aspectRatio" in x ? true : false); 2018 A.store.Float64(ptr + 96, x["aspectRatio"] === undefined ? 0 : (x["aspectRatio"] as number)); 2019 } 2020 }, 2021 "load_Whiteboard": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 2022 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 2023 2024 if (A.load.Bool(ptr + 0 + 18)) { 2025 x["topLeft"] = {}; 2026 if (A.load.Bool(ptr + 0 + 16)) { 2027 x["topLeft"]["x"] = A.load.Float64(ptr + 0 + 0); 2028 } else { 2029 delete x["topLeft"]["x"]; 2030 } 2031 if (A.load.Bool(ptr + 0 + 17)) { 2032 x["topLeft"]["y"] = A.load.Float64(ptr + 0 + 8); 2033 } else { 2034 delete x["topLeft"]["y"]; 2035 } 2036 } else { 2037 delete x["topLeft"]; 2038 } 2039 if (A.load.Bool(ptr + 24 + 18)) { 2040 x["topRight"] = {}; 2041 if (A.load.Bool(ptr + 24 + 16)) { 2042 x["topRight"]["x"] = A.load.Float64(ptr + 24 + 0); 2043 } else { 2044 delete x["topRight"]["x"]; 2045 } 2046 if (A.load.Bool(ptr + 24 + 17)) { 2047 x["topRight"]["y"] = A.load.Float64(ptr + 24 + 8); 2048 } else { 2049 delete x["topRight"]["y"]; 2050 } 2051 } else { 2052 delete x["topRight"]; 2053 } 2054 if (A.load.Bool(ptr + 48 + 18)) { 2055 x["bottomLeft"] = {}; 2056 if (A.load.Bool(ptr + 48 + 16)) { 2057 x["bottomLeft"]["x"] = A.load.Float64(ptr + 48 + 0); 2058 } else { 2059 delete x["bottomLeft"]["x"]; 2060 } 2061 if (A.load.Bool(ptr + 48 + 17)) { 2062 x["bottomLeft"]["y"] = A.load.Float64(ptr + 48 + 8); 2063 } else { 2064 delete x["bottomLeft"]["y"]; 2065 } 2066 } else { 2067 delete x["bottomLeft"]; 2068 } 2069 if (A.load.Bool(ptr + 72 + 18)) { 2070 x["bottomRight"] = {}; 2071 if (A.load.Bool(ptr + 72 + 16)) { 2072 x["bottomRight"]["x"] = A.load.Float64(ptr + 72 + 0); 2073 } else { 2074 delete x["bottomRight"]["x"]; 2075 } 2076 if (A.load.Bool(ptr + 72 + 17)) { 2077 x["bottomRight"]["y"] = A.load.Float64(ptr + 72 + 8); 2078 } else { 2079 delete x["bottomRight"]["y"]; 2080 } 2081 } else { 2082 delete x["bottomRight"]; 2083 } 2084 if (A.load.Bool(ptr + 104)) { 2085 x["aspectRatio"] = A.load.Float64(ptr + 96); 2086 } else { 2087 delete x["aspectRatio"]; 2088 } 2089 return create === A.H.TRUE ? A.H.push(x) : ref; 2090 }, 2091 2092 "store_State": (ptr: Pointer, ref: heap.Ref<any>) => { 2093 const x = A.H.get<any>(ref); 2094 2095 if (typeof x === "undefined") { 2096 A.store.Bool(ptr + 140, false); 2097 A.store.Enum(ptr + 0, -1); 2098 A.store.Ref(ptr + 4, undefined); 2099 A.store.Enum(ptr + 8, -1); 2100 A.store.Ref(ptr + 12, undefined); 2101 A.store.Ref(ptr + 16, undefined); 2102 2103 A.store.Bool(ptr + 24 + 105, false); 2104 2105 A.store.Bool(ptr + 24 + 0 + 18, false); 2106 A.store.Bool(ptr + 24 + 0 + 16, false); 2107 A.store.Float64(ptr + 24 + 0 + 0, 0); 2108 A.store.Bool(ptr + 24 + 0 + 17, false); 2109 A.store.Float64(ptr + 24 + 0 + 8, 0); 2110 2111 A.store.Bool(ptr + 24 + 24 + 18, false); 2112 A.store.Bool(ptr + 24 + 24 + 16, false); 2113 A.store.Float64(ptr + 24 + 24 + 0, 0); 2114 A.store.Bool(ptr + 24 + 24 + 17, false); 2115 A.store.Float64(ptr + 24 + 24 + 8, 0); 2116 2117 A.store.Bool(ptr + 24 + 48 + 18, false); 2118 A.store.Bool(ptr + 24 + 48 + 16, false); 2119 A.store.Float64(ptr + 24 + 48 + 0, 0); 2120 A.store.Bool(ptr + 24 + 48 + 17, false); 2121 A.store.Float64(ptr + 24 + 48 + 8, 0); 2122 2123 A.store.Bool(ptr + 24 + 72 + 18, false); 2124 A.store.Bool(ptr + 24 + 72 + 16, false); 2125 A.store.Float64(ptr + 24 + 72 + 0, 0); 2126 A.store.Bool(ptr + 24 + 72 + 17, false); 2127 A.store.Float64(ptr + 24 + 72 + 8, 0); 2128 A.store.Bool(ptr + 24 + 104, false); 2129 A.store.Float64(ptr + 24 + 96, 0); 2130 A.store.Ref(ptr + 132, undefined); 2131 A.store.Ref(ptr + 136, undefined); 2132 } else { 2133 A.store.Bool(ptr + 140, true); 2134 A.store.Enum( 2135 ptr + 0, 2136 ["UNINITIALIZED", "STARTED", "RUNNING", "SUSPENDED", "RESTARTING", "STOPPED", "SERVICE_ERROR"].indexOf( 2137 x["status"] as string 2138 ) 2139 ); 2140 A.store.Ref(ptr + 4, x["deviceContext"]); 2141 A.store.Enum( 2142 ptr + 8, 2143 [ 2144 "SERVICE_UNREACHABLE", 2145 "SERVICE_NOT_RUNNING", 2146 "SERVICE_BUSY_LAUNCHING", 2147 "SERVICE_NOT_INSTALLED", 2148 "MOJO_CONNECTION_FAILURE", 2149 ].indexOf(x["serviceError"] as string) 2150 ); 2151 A.store.Ref(ptr + 12, x["videoStreamParam"]); 2152 A.store.Ref(ptr + 16, x["configuration"]); 2153 2154 if (typeof x["whiteboard"] === "undefined") { 2155 A.store.Bool(ptr + 24 + 105, false); 2156 2157 A.store.Bool(ptr + 24 + 0 + 18, false); 2158 A.store.Bool(ptr + 24 + 0 + 16, false); 2159 A.store.Float64(ptr + 24 + 0 + 0, 0); 2160 A.store.Bool(ptr + 24 + 0 + 17, false); 2161 A.store.Float64(ptr + 24 + 0 + 8, 0); 2162 2163 A.store.Bool(ptr + 24 + 24 + 18, false); 2164 A.store.Bool(ptr + 24 + 24 + 16, false); 2165 A.store.Float64(ptr + 24 + 24 + 0, 0); 2166 A.store.Bool(ptr + 24 + 24 + 17, false); 2167 A.store.Float64(ptr + 24 + 24 + 8, 0); 2168 2169 A.store.Bool(ptr + 24 + 48 + 18, false); 2170 A.store.Bool(ptr + 24 + 48 + 16, false); 2171 A.store.Float64(ptr + 24 + 48 + 0, 0); 2172 A.store.Bool(ptr + 24 + 48 + 17, false); 2173 A.store.Float64(ptr + 24 + 48 + 8, 0); 2174 2175 A.store.Bool(ptr + 24 + 72 + 18, false); 2176 A.store.Bool(ptr + 24 + 72 + 16, false); 2177 A.store.Float64(ptr + 24 + 72 + 0, 0); 2178 A.store.Bool(ptr + 24 + 72 + 17, false); 2179 A.store.Float64(ptr + 24 + 72 + 8, 0); 2180 A.store.Bool(ptr + 24 + 104, false); 2181 A.store.Float64(ptr + 24 + 96, 0); 2182 } else { 2183 A.store.Bool(ptr + 24 + 105, true); 2184 2185 if (typeof x["whiteboard"]["topLeft"] === "undefined") { 2186 A.store.Bool(ptr + 24 + 0 + 18, false); 2187 A.store.Bool(ptr + 24 + 0 + 16, false); 2188 A.store.Float64(ptr + 24 + 0 + 0, 0); 2189 A.store.Bool(ptr + 24 + 0 + 17, false); 2190 A.store.Float64(ptr + 24 + 0 + 8, 0); 2191 } else { 2192 A.store.Bool(ptr + 24 + 0 + 18, true); 2193 A.store.Bool(ptr + 24 + 0 + 16, "x" in x["whiteboard"]["topLeft"] ? true : false); 2194 A.store.Float64( 2195 ptr + 24 + 0 + 0, 2196 x["whiteboard"]["topLeft"]["x"] === undefined ? 0 : (x["whiteboard"]["topLeft"]["x"] as number) 2197 ); 2198 A.store.Bool(ptr + 24 + 0 + 17, "y" in x["whiteboard"]["topLeft"] ? true : false); 2199 A.store.Float64( 2200 ptr + 24 + 0 + 8, 2201 x["whiteboard"]["topLeft"]["y"] === undefined ? 0 : (x["whiteboard"]["topLeft"]["y"] as number) 2202 ); 2203 } 2204 2205 if (typeof x["whiteboard"]["topRight"] === "undefined") { 2206 A.store.Bool(ptr + 24 + 24 + 18, false); 2207 A.store.Bool(ptr + 24 + 24 + 16, false); 2208 A.store.Float64(ptr + 24 + 24 + 0, 0); 2209 A.store.Bool(ptr + 24 + 24 + 17, false); 2210 A.store.Float64(ptr + 24 + 24 + 8, 0); 2211 } else { 2212 A.store.Bool(ptr + 24 + 24 + 18, true); 2213 A.store.Bool(ptr + 24 + 24 + 16, "x" in x["whiteboard"]["topRight"] ? true : false); 2214 A.store.Float64( 2215 ptr + 24 + 24 + 0, 2216 x["whiteboard"]["topRight"]["x"] === undefined ? 0 : (x["whiteboard"]["topRight"]["x"] as number) 2217 ); 2218 A.store.Bool(ptr + 24 + 24 + 17, "y" in x["whiteboard"]["topRight"] ? true : false); 2219 A.store.Float64( 2220 ptr + 24 + 24 + 8, 2221 x["whiteboard"]["topRight"]["y"] === undefined ? 0 : (x["whiteboard"]["topRight"]["y"] as number) 2222 ); 2223 } 2224 2225 if (typeof x["whiteboard"]["bottomLeft"] === "undefined") { 2226 A.store.Bool(ptr + 24 + 48 + 18, false); 2227 A.store.Bool(ptr + 24 + 48 + 16, false); 2228 A.store.Float64(ptr + 24 + 48 + 0, 0); 2229 A.store.Bool(ptr + 24 + 48 + 17, false); 2230 A.store.Float64(ptr + 24 + 48 + 8, 0); 2231 } else { 2232 A.store.Bool(ptr + 24 + 48 + 18, true); 2233 A.store.Bool(ptr + 24 + 48 + 16, "x" in x["whiteboard"]["bottomLeft"] ? true : false); 2234 A.store.Float64( 2235 ptr + 24 + 48 + 0, 2236 x["whiteboard"]["bottomLeft"]["x"] === undefined ? 0 : (x["whiteboard"]["bottomLeft"]["x"] as number) 2237 ); 2238 A.store.Bool(ptr + 24 + 48 + 17, "y" in x["whiteboard"]["bottomLeft"] ? true : false); 2239 A.store.Float64( 2240 ptr + 24 + 48 + 8, 2241 x["whiteboard"]["bottomLeft"]["y"] === undefined ? 0 : (x["whiteboard"]["bottomLeft"]["y"] as number) 2242 ); 2243 } 2244 2245 if (typeof x["whiteboard"]["bottomRight"] === "undefined") { 2246 A.store.Bool(ptr + 24 + 72 + 18, false); 2247 A.store.Bool(ptr + 24 + 72 + 16, false); 2248 A.store.Float64(ptr + 24 + 72 + 0, 0); 2249 A.store.Bool(ptr + 24 + 72 + 17, false); 2250 A.store.Float64(ptr + 24 + 72 + 8, 0); 2251 } else { 2252 A.store.Bool(ptr + 24 + 72 + 18, true); 2253 A.store.Bool(ptr + 24 + 72 + 16, "x" in x["whiteboard"]["bottomRight"] ? true : false); 2254 A.store.Float64( 2255 ptr + 24 + 72 + 0, 2256 x["whiteboard"]["bottomRight"]["x"] === undefined ? 0 : (x["whiteboard"]["bottomRight"]["x"] as number) 2257 ); 2258 A.store.Bool(ptr + 24 + 72 + 17, "y" in x["whiteboard"]["bottomRight"] ? true : false); 2259 A.store.Float64( 2260 ptr + 24 + 72 + 8, 2261 x["whiteboard"]["bottomRight"]["y"] === undefined ? 0 : (x["whiteboard"]["bottomRight"]["y"] as number) 2262 ); 2263 } 2264 A.store.Bool(ptr + 24 + 104, "aspectRatio" in x["whiteboard"] ? true : false); 2265 A.store.Float64( 2266 ptr + 24 + 96, 2267 x["whiteboard"]["aspectRatio"] === undefined ? 0 : (x["whiteboard"]["aspectRatio"] as number) 2268 ); 2269 } 2270 A.store.Ref(ptr + 132, x["features"]); 2271 A.store.Ref(ptr + 136, x["namedTemplateArguments"]); 2272 } 2273 }, 2274 "load_State": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 2275 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 2276 2277 x["status"] = A.load.Enum(ptr + 0, [ 2278 "UNINITIALIZED", 2279 "STARTED", 2280 "RUNNING", 2281 "SUSPENDED", 2282 "RESTARTING", 2283 "STOPPED", 2284 "SERVICE_ERROR", 2285 ]); 2286 x["deviceContext"] = A.load.Ref(ptr + 4, undefined); 2287 x["serviceError"] = A.load.Enum(ptr + 8, [ 2288 "SERVICE_UNREACHABLE", 2289 "SERVICE_NOT_RUNNING", 2290 "SERVICE_BUSY_LAUNCHING", 2291 "SERVICE_NOT_INSTALLED", 2292 "MOJO_CONNECTION_FAILURE", 2293 ]); 2294 x["videoStreamParam"] = A.load.Ref(ptr + 12, undefined); 2295 x["configuration"] = A.load.Ref(ptr + 16, undefined); 2296 if (A.load.Bool(ptr + 24 + 105)) { 2297 x["whiteboard"] = {}; 2298 if (A.load.Bool(ptr + 24 + 0 + 18)) { 2299 x["whiteboard"]["topLeft"] = {}; 2300 if (A.load.Bool(ptr + 24 + 0 + 16)) { 2301 x["whiteboard"]["topLeft"]["x"] = A.load.Float64(ptr + 24 + 0 + 0); 2302 } else { 2303 delete x["whiteboard"]["topLeft"]["x"]; 2304 } 2305 if (A.load.Bool(ptr + 24 + 0 + 17)) { 2306 x["whiteboard"]["topLeft"]["y"] = A.load.Float64(ptr + 24 + 0 + 8); 2307 } else { 2308 delete x["whiteboard"]["topLeft"]["y"]; 2309 } 2310 } else { 2311 delete x["whiteboard"]["topLeft"]; 2312 } 2313 if (A.load.Bool(ptr + 24 + 24 + 18)) { 2314 x["whiteboard"]["topRight"] = {}; 2315 if (A.load.Bool(ptr + 24 + 24 + 16)) { 2316 x["whiteboard"]["topRight"]["x"] = A.load.Float64(ptr + 24 + 24 + 0); 2317 } else { 2318 delete x["whiteboard"]["topRight"]["x"]; 2319 } 2320 if (A.load.Bool(ptr + 24 + 24 + 17)) { 2321 x["whiteboard"]["topRight"]["y"] = A.load.Float64(ptr + 24 + 24 + 8); 2322 } else { 2323 delete x["whiteboard"]["topRight"]["y"]; 2324 } 2325 } else { 2326 delete x["whiteboard"]["topRight"]; 2327 } 2328 if (A.load.Bool(ptr + 24 + 48 + 18)) { 2329 x["whiteboard"]["bottomLeft"] = {}; 2330 if (A.load.Bool(ptr + 24 + 48 + 16)) { 2331 x["whiteboard"]["bottomLeft"]["x"] = A.load.Float64(ptr + 24 + 48 + 0); 2332 } else { 2333 delete x["whiteboard"]["bottomLeft"]["x"]; 2334 } 2335 if (A.load.Bool(ptr + 24 + 48 + 17)) { 2336 x["whiteboard"]["bottomLeft"]["y"] = A.load.Float64(ptr + 24 + 48 + 8); 2337 } else { 2338 delete x["whiteboard"]["bottomLeft"]["y"]; 2339 } 2340 } else { 2341 delete x["whiteboard"]["bottomLeft"]; 2342 } 2343 if (A.load.Bool(ptr + 24 + 72 + 18)) { 2344 x["whiteboard"]["bottomRight"] = {}; 2345 if (A.load.Bool(ptr + 24 + 72 + 16)) { 2346 x["whiteboard"]["bottomRight"]["x"] = A.load.Float64(ptr + 24 + 72 + 0); 2347 } else { 2348 delete x["whiteboard"]["bottomRight"]["x"]; 2349 } 2350 if (A.load.Bool(ptr + 24 + 72 + 17)) { 2351 x["whiteboard"]["bottomRight"]["y"] = A.load.Float64(ptr + 24 + 72 + 8); 2352 } else { 2353 delete x["whiteboard"]["bottomRight"]["y"]; 2354 } 2355 } else { 2356 delete x["whiteboard"]["bottomRight"]; 2357 } 2358 if (A.load.Bool(ptr + 24 + 104)) { 2359 x["whiteboard"]["aspectRatio"] = A.load.Float64(ptr + 24 + 96); 2360 } else { 2361 delete x["whiteboard"]["aspectRatio"]; 2362 } 2363 } else { 2364 delete x["whiteboard"]; 2365 } 2366 x["features"] = A.load.Ref(ptr + 132, undefined); 2367 x["namedTemplateArguments"] = A.load.Ref(ptr + 136, undefined); 2368 return create === A.H.TRUE ? A.H.push(x) : ref; 2369 }, 2370 "has_GetDiagnostics": (): heap.Ref<boolean> => { 2371 if (WEBEXT?.mediaPerceptionPrivate && "getDiagnostics" in WEBEXT?.mediaPerceptionPrivate) { 2372 return A.H.TRUE; 2373 } 2374 return A.H.FALSE; 2375 }, 2376 "func_GetDiagnostics": (fn: Pointer): void => { 2377 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.getDiagnostics); 2378 }, 2379 "call_GetDiagnostics": (retPtr: Pointer): void => { 2380 const _ret = WEBEXT.mediaPerceptionPrivate.getDiagnostics(); 2381 A.store.Ref(retPtr, _ret); 2382 }, 2383 "try_GetDiagnostics": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2384 try { 2385 const _ret = WEBEXT.mediaPerceptionPrivate.getDiagnostics(); 2386 A.store.Ref(retPtr, _ret); 2387 return A.H.TRUE; 2388 } catch (err: any) { 2389 A.store.Ref(errPtr, err); 2390 return A.H.FALSE; 2391 } 2392 }, 2393 "has_GetState": (): heap.Ref<boolean> => { 2394 if (WEBEXT?.mediaPerceptionPrivate && "getState" in WEBEXT?.mediaPerceptionPrivate) { 2395 return A.H.TRUE; 2396 } 2397 return A.H.FALSE; 2398 }, 2399 "func_GetState": (fn: Pointer): void => { 2400 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.getState); 2401 }, 2402 "call_GetState": (retPtr: Pointer): void => { 2403 const _ret = WEBEXT.mediaPerceptionPrivate.getState(); 2404 A.store.Ref(retPtr, _ret); 2405 }, 2406 "try_GetState": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2407 try { 2408 const _ret = WEBEXT.mediaPerceptionPrivate.getState(); 2409 A.store.Ref(retPtr, _ret); 2410 return A.H.TRUE; 2411 } catch (err: any) { 2412 A.store.Ref(errPtr, err); 2413 return A.H.FALSE; 2414 } 2415 }, 2416 "has_OnMediaPerception": (): heap.Ref<boolean> => { 2417 if ( 2418 WEBEXT?.mediaPerceptionPrivate?.onMediaPerception && 2419 "addListener" in WEBEXT?.mediaPerceptionPrivate?.onMediaPerception 2420 ) { 2421 return A.H.TRUE; 2422 } 2423 return A.H.FALSE; 2424 }, 2425 "func_OnMediaPerception": (fn: Pointer): void => { 2426 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.onMediaPerception.addListener); 2427 }, 2428 "call_OnMediaPerception": (retPtr: Pointer, callback: heap.Ref<object>): void => { 2429 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.addListener(A.H.get<object>(callback)); 2430 }, 2431 "try_OnMediaPerception": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 2432 try { 2433 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.addListener(A.H.get<object>(callback)); 2434 return A.H.TRUE; 2435 } catch (err: any) { 2436 A.store.Ref(errPtr, err); 2437 return A.H.FALSE; 2438 } 2439 }, 2440 "has_OffMediaPerception": (): heap.Ref<boolean> => { 2441 if ( 2442 WEBEXT?.mediaPerceptionPrivate?.onMediaPerception && 2443 "removeListener" in WEBEXT?.mediaPerceptionPrivate?.onMediaPerception 2444 ) { 2445 return A.H.TRUE; 2446 } 2447 return A.H.FALSE; 2448 }, 2449 "func_OffMediaPerception": (fn: Pointer): void => { 2450 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.onMediaPerception.removeListener); 2451 }, 2452 "call_OffMediaPerception": (retPtr: Pointer, callback: heap.Ref<object>): void => { 2453 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.removeListener(A.H.get<object>(callback)); 2454 }, 2455 "try_OffMediaPerception": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 2456 try { 2457 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.removeListener(A.H.get<object>(callback)); 2458 return A.H.TRUE; 2459 } catch (err: any) { 2460 A.store.Ref(errPtr, err); 2461 return A.H.FALSE; 2462 } 2463 }, 2464 "has_HasOnMediaPerception": (): heap.Ref<boolean> => { 2465 if ( 2466 WEBEXT?.mediaPerceptionPrivate?.onMediaPerception && 2467 "hasListener" in WEBEXT?.mediaPerceptionPrivate?.onMediaPerception 2468 ) { 2469 return A.H.TRUE; 2470 } 2471 return A.H.FALSE; 2472 }, 2473 "func_HasOnMediaPerception": (fn: Pointer): void => { 2474 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.onMediaPerception.hasListener); 2475 }, 2476 "call_HasOnMediaPerception": (retPtr: Pointer, callback: heap.Ref<object>): void => { 2477 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.hasListener(A.H.get<object>(callback)); 2478 A.store.Bool(retPtr, _ret); 2479 }, 2480 "try_HasOnMediaPerception": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 2481 try { 2482 const _ret = WEBEXT.mediaPerceptionPrivate.onMediaPerception.hasListener(A.H.get<object>(callback)); 2483 A.store.Bool(retPtr, _ret); 2484 return A.H.TRUE; 2485 } catch (err: any) { 2486 A.store.Ref(errPtr, err); 2487 return A.H.FALSE; 2488 } 2489 }, 2490 "has_SetAnalyticsComponent": (): heap.Ref<boolean> => { 2491 if (WEBEXT?.mediaPerceptionPrivate && "setAnalyticsComponent" in WEBEXT?.mediaPerceptionPrivate) { 2492 return A.H.TRUE; 2493 } 2494 return A.H.FALSE; 2495 }, 2496 "func_SetAnalyticsComponent": (fn: Pointer): void => { 2497 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.setAnalyticsComponent); 2498 }, 2499 "call_SetAnalyticsComponent": (retPtr: Pointer, component: Pointer): void => { 2500 const component_ffi = {}; 2501 2502 component_ffi["type"] = A.load.Enum(component + 0, ["LIGHT", "FULL"]); 2503 2504 const _ret = WEBEXT.mediaPerceptionPrivate.setAnalyticsComponent(component_ffi); 2505 A.store.Ref(retPtr, _ret); 2506 }, 2507 "try_SetAnalyticsComponent": (retPtr: Pointer, errPtr: Pointer, component: Pointer): heap.Ref<boolean> => { 2508 try { 2509 const component_ffi = {}; 2510 2511 component_ffi["type"] = A.load.Enum(component + 0, ["LIGHT", "FULL"]); 2512 2513 const _ret = WEBEXT.mediaPerceptionPrivate.setAnalyticsComponent(component_ffi); 2514 A.store.Ref(retPtr, _ret); 2515 return A.H.TRUE; 2516 } catch (err: any) { 2517 A.store.Ref(errPtr, err); 2518 return A.H.FALSE; 2519 } 2520 }, 2521 "has_SetComponentProcessState": (): heap.Ref<boolean> => { 2522 if (WEBEXT?.mediaPerceptionPrivate && "setComponentProcessState" in WEBEXT?.mediaPerceptionPrivate) { 2523 return A.H.TRUE; 2524 } 2525 return A.H.FALSE; 2526 }, 2527 "func_SetComponentProcessState": (fn: Pointer): void => { 2528 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.setComponentProcessState); 2529 }, 2530 "call_SetComponentProcessState": (retPtr: Pointer, processState: Pointer): void => { 2531 const processState_ffi = {}; 2532 2533 processState_ffi["status"] = A.load.Enum(processState + 0, ["UNKNOWN", "STARTED", "STOPPED", "SERVICE_ERROR"]); 2534 processState_ffi["serviceError"] = A.load.Enum(processState + 4, [ 2535 "SERVICE_UNREACHABLE", 2536 "SERVICE_NOT_RUNNING", 2537 "SERVICE_BUSY_LAUNCHING", 2538 "SERVICE_NOT_INSTALLED", 2539 "MOJO_CONNECTION_FAILURE", 2540 ]); 2541 2542 const _ret = WEBEXT.mediaPerceptionPrivate.setComponentProcessState(processState_ffi); 2543 A.store.Ref(retPtr, _ret); 2544 }, 2545 "try_SetComponentProcessState": (retPtr: Pointer, errPtr: Pointer, processState: Pointer): heap.Ref<boolean> => { 2546 try { 2547 const processState_ffi = {}; 2548 2549 processState_ffi["status"] = A.load.Enum(processState + 0, ["UNKNOWN", "STARTED", "STOPPED", "SERVICE_ERROR"]); 2550 processState_ffi["serviceError"] = A.load.Enum(processState + 4, [ 2551 "SERVICE_UNREACHABLE", 2552 "SERVICE_NOT_RUNNING", 2553 "SERVICE_BUSY_LAUNCHING", 2554 "SERVICE_NOT_INSTALLED", 2555 "MOJO_CONNECTION_FAILURE", 2556 ]); 2557 2558 const _ret = WEBEXT.mediaPerceptionPrivate.setComponentProcessState(processState_ffi); 2559 A.store.Ref(retPtr, _ret); 2560 return A.H.TRUE; 2561 } catch (err: any) { 2562 A.store.Ref(errPtr, err); 2563 return A.H.FALSE; 2564 } 2565 }, 2566 "has_SetState": (): heap.Ref<boolean> => { 2567 if (WEBEXT?.mediaPerceptionPrivate && "setState" in WEBEXT?.mediaPerceptionPrivate) { 2568 return A.H.TRUE; 2569 } 2570 return A.H.FALSE; 2571 }, 2572 "func_SetState": (fn: Pointer): void => { 2573 A.store.Ref(fn, WEBEXT.mediaPerceptionPrivate.setState); 2574 }, 2575 "call_SetState": (retPtr: Pointer, state: Pointer): void => { 2576 const state_ffi = {}; 2577 2578 state_ffi["status"] = A.load.Enum(state + 0, [ 2579 "UNINITIALIZED", 2580 "STARTED", 2581 "RUNNING", 2582 "SUSPENDED", 2583 "RESTARTING", 2584 "STOPPED", 2585 "SERVICE_ERROR", 2586 ]); 2587 state_ffi["deviceContext"] = A.load.Ref(state + 4, undefined); 2588 state_ffi["serviceError"] = A.load.Enum(state + 8, [ 2589 "SERVICE_UNREACHABLE", 2590 "SERVICE_NOT_RUNNING", 2591 "SERVICE_BUSY_LAUNCHING", 2592 "SERVICE_NOT_INSTALLED", 2593 "MOJO_CONNECTION_FAILURE", 2594 ]); 2595 state_ffi["videoStreamParam"] = A.load.Ref(state + 12, undefined); 2596 state_ffi["configuration"] = A.load.Ref(state + 16, undefined); 2597 if (A.load.Bool(state + 24 + 105)) { 2598 state_ffi["whiteboard"] = {}; 2599 if (A.load.Bool(state + 24 + 0 + 18)) { 2600 state_ffi["whiteboard"]["topLeft"] = {}; 2601 if (A.load.Bool(state + 24 + 0 + 16)) { 2602 state_ffi["whiteboard"]["topLeft"]["x"] = A.load.Float64(state + 24 + 0 + 0); 2603 } 2604 if (A.load.Bool(state + 24 + 0 + 17)) { 2605 state_ffi["whiteboard"]["topLeft"]["y"] = A.load.Float64(state + 24 + 0 + 8); 2606 } 2607 } 2608 if (A.load.Bool(state + 24 + 24 + 18)) { 2609 state_ffi["whiteboard"]["topRight"] = {}; 2610 if (A.load.Bool(state + 24 + 24 + 16)) { 2611 state_ffi["whiteboard"]["topRight"]["x"] = A.load.Float64(state + 24 + 24 + 0); 2612 } 2613 if (A.load.Bool(state + 24 + 24 + 17)) { 2614 state_ffi["whiteboard"]["topRight"]["y"] = A.load.Float64(state + 24 + 24 + 8); 2615 } 2616 } 2617 if (A.load.Bool(state + 24 + 48 + 18)) { 2618 state_ffi["whiteboard"]["bottomLeft"] = {}; 2619 if (A.load.Bool(state + 24 + 48 + 16)) { 2620 state_ffi["whiteboard"]["bottomLeft"]["x"] = A.load.Float64(state + 24 + 48 + 0); 2621 } 2622 if (A.load.Bool(state + 24 + 48 + 17)) { 2623 state_ffi["whiteboard"]["bottomLeft"]["y"] = A.load.Float64(state + 24 + 48 + 8); 2624 } 2625 } 2626 if (A.load.Bool(state + 24 + 72 + 18)) { 2627 state_ffi["whiteboard"]["bottomRight"] = {}; 2628 if (A.load.Bool(state + 24 + 72 + 16)) { 2629 state_ffi["whiteboard"]["bottomRight"]["x"] = A.load.Float64(state + 24 + 72 + 0); 2630 } 2631 if (A.load.Bool(state + 24 + 72 + 17)) { 2632 state_ffi["whiteboard"]["bottomRight"]["y"] = A.load.Float64(state + 24 + 72 + 8); 2633 } 2634 } 2635 if (A.load.Bool(state + 24 + 104)) { 2636 state_ffi["whiteboard"]["aspectRatio"] = A.load.Float64(state + 24 + 96); 2637 } 2638 } 2639 state_ffi["features"] = A.load.Ref(state + 132, undefined); 2640 state_ffi["namedTemplateArguments"] = A.load.Ref(state + 136, undefined); 2641 2642 const _ret = WEBEXT.mediaPerceptionPrivate.setState(state_ffi); 2643 A.store.Ref(retPtr, _ret); 2644 }, 2645 "try_SetState": (retPtr: Pointer, errPtr: Pointer, state: Pointer): heap.Ref<boolean> => { 2646 try { 2647 const state_ffi = {}; 2648 2649 state_ffi["status"] = A.load.Enum(state + 0, [ 2650 "UNINITIALIZED", 2651 "STARTED", 2652 "RUNNING", 2653 "SUSPENDED", 2654 "RESTARTING", 2655 "STOPPED", 2656 "SERVICE_ERROR", 2657 ]); 2658 state_ffi["deviceContext"] = A.load.Ref(state + 4, undefined); 2659 state_ffi["serviceError"] = A.load.Enum(state + 8, [ 2660 "SERVICE_UNREACHABLE", 2661 "SERVICE_NOT_RUNNING", 2662 "SERVICE_BUSY_LAUNCHING", 2663 "SERVICE_NOT_INSTALLED", 2664 "MOJO_CONNECTION_FAILURE", 2665 ]); 2666 state_ffi["videoStreamParam"] = A.load.Ref(state + 12, undefined); 2667 state_ffi["configuration"] = A.load.Ref(state + 16, undefined); 2668 if (A.load.Bool(state + 24 + 105)) { 2669 state_ffi["whiteboard"] = {}; 2670 if (A.load.Bool(state + 24 + 0 + 18)) { 2671 state_ffi["whiteboard"]["topLeft"] = {}; 2672 if (A.load.Bool(state + 24 + 0 + 16)) { 2673 state_ffi["whiteboard"]["topLeft"]["x"] = A.load.Float64(state + 24 + 0 + 0); 2674 } 2675 if (A.load.Bool(state + 24 + 0 + 17)) { 2676 state_ffi["whiteboard"]["topLeft"]["y"] = A.load.Float64(state + 24 + 0 + 8); 2677 } 2678 } 2679 if (A.load.Bool(state + 24 + 24 + 18)) { 2680 state_ffi["whiteboard"]["topRight"] = {}; 2681 if (A.load.Bool(state + 24 + 24 + 16)) { 2682 state_ffi["whiteboard"]["topRight"]["x"] = A.load.Float64(state + 24 + 24 + 0); 2683 } 2684 if (A.load.Bool(state + 24 + 24 + 17)) { 2685 state_ffi["whiteboard"]["topRight"]["y"] = A.load.Float64(state + 24 + 24 + 8); 2686 } 2687 } 2688 if (A.load.Bool(state + 24 + 48 + 18)) { 2689 state_ffi["whiteboard"]["bottomLeft"] = {}; 2690 if (A.load.Bool(state + 24 + 48 + 16)) { 2691 state_ffi["whiteboard"]["bottomLeft"]["x"] = A.load.Float64(state + 24 + 48 + 0); 2692 } 2693 if (A.load.Bool(state + 24 + 48 + 17)) { 2694 state_ffi["whiteboard"]["bottomLeft"]["y"] = A.load.Float64(state + 24 + 48 + 8); 2695 } 2696 } 2697 if (A.load.Bool(state + 24 + 72 + 18)) { 2698 state_ffi["whiteboard"]["bottomRight"] = {}; 2699 if (A.load.Bool(state + 24 + 72 + 16)) { 2700 state_ffi["whiteboard"]["bottomRight"]["x"] = A.load.Float64(state + 24 + 72 + 0); 2701 } 2702 if (A.load.Bool(state + 24 + 72 + 17)) { 2703 state_ffi["whiteboard"]["bottomRight"]["y"] = A.load.Float64(state + 24 + 72 + 8); 2704 } 2705 } 2706 if (A.load.Bool(state + 24 + 104)) { 2707 state_ffi["whiteboard"]["aspectRatio"] = A.load.Float64(state + 24 + 96); 2708 } 2709 } 2710 state_ffi["features"] = A.load.Ref(state + 132, undefined); 2711 state_ffi["namedTemplateArguments"] = A.load.Ref(state + 136, undefined); 2712 2713 const _ret = WEBEXT.mediaPerceptionPrivate.setState(state_ffi); 2714 A.store.Ref(retPtr, _ret); 2715 return A.H.TRUE; 2716 } catch (err: any) { 2717 A.store.Ref(errPtr, err); 2718 return A.H.FALSE; 2719 } 2720 }, 2721 }; 2722 });