github.com/primecitizens/pcz/std@v0.2.1/plat/js/web/apis48_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package web 5 6 import ( 7 "github.com/primecitizens/pcz/std/core/abi" 8 "github.com/primecitizens/pcz/std/core/mark" 9 "github.com/primecitizens/pcz/std/ffi/js" 10 "github.com/primecitizens/pcz/std/plat/js/web/bindings" 11 ) 12 13 type RTCIceGathererState uint32 14 15 const ( 16 _ RTCIceGathererState = iota 17 18 RTCIceGathererState_NEW 19 RTCIceGathererState_GATHERING 20 RTCIceGathererState_COMPLETE 21 ) 22 23 func (RTCIceGathererState) FromRef(str js.Ref) RTCIceGathererState { 24 return RTCIceGathererState(bindings.ConstOfRTCIceGathererState(str)) 25 } 26 27 func (x RTCIceGathererState) String() (string, bool) { 28 switch x { 29 case RTCIceGathererState_NEW: 30 return "new", true 31 case RTCIceGathererState_GATHERING: 32 return "gathering", true 33 case RTCIceGathererState_COMPLETE: 34 return "complete", true 35 default: 36 return "", false 37 } 38 } 39 40 type RTCIceTransport struct { 41 EventTarget 42 } 43 44 func (this RTCIceTransport) Once() RTCIceTransport { 45 this.ref.Once() 46 return this 47 } 48 49 func (this RTCIceTransport) Ref() js.Ref { 50 return this.EventTarget.Ref() 51 } 52 53 func (this RTCIceTransport) FromRef(ref js.Ref) RTCIceTransport { 54 this.EventTarget = this.EventTarget.FromRef(ref) 55 return this 56 } 57 58 func (this RTCIceTransport) Free() { 59 this.ref.Free() 60 } 61 62 // Role returns the value of property "RTCIceTransport.role". 63 // 64 // It returns ok=false if there is no such property. 65 func (this RTCIceTransport) Role() (ret RTCIceRole, ok bool) { 66 ok = js.True == bindings.GetRTCIceTransportRole( 67 this.ref, js.Pointer(&ret), 68 ) 69 return 70 } 71 72 // Component returns the value of property "RTCIceTransport.component". 73 // 74 // It returns ok=false if there is no such property. 75 func (this RTCIceTransport) Component() (ret RTCIceComponent, ok bool) { 76 ok = js.True == bindings.GetRTCIceTransportComponent( 77 this.ref, js.Pointer(&ret), 78 ) 79 return 80 } 81 82 // State returns the value of property "RTCIceTransport.state". 83 // 84 // It returns ok=false if there is no such property. 85 func (this RTCIceTransport) State() (ret RTCIceTransportState, ok bool) { 86 ok = js.True == bindings.GetRTCIceTransportState( 87 this.ref, js.Pointer(&ret), 88 ) 89 return 90 } 91 92 // GatheringState returns the value of property "RTCIceTransport.gatheringState". 93 // 94 // It returns ok=false if there is no such property. 95 func (this RTCIceTransport) GatheringState() (ret RTCIceGathererState, ok bool) { 96 ok = js.True == bindings.GetRTCIceTransportGatheringState( 97 this.ref, js.Pointer(&ret), 98 ) 99 return 100 } 101 102 // HasFuncGetLocalCandidates returns true if the method "RTCIceTransport.getLocalCandidates" exists. 103 func (this RTCIceTransport) HasFuncGetLocalCandidates() bool { 104 return js.True == bindings.HasFuncRTCIceTransportGetLocalCandidates( 105 this.ref, 106 ) 107 } 108 109 // FuncGetLocalCandidates returns the method "RTCIceTransport.getLocalCandidates". 110 func (this RTCIceTransport) FuncGetLocalCandidates() (fn js.Func[func() js.Array[RTCIceCandidate]]) { 111 bindings.FuncRTCIceTransportGetLocalCandidates( 112 this.ref, js.Pointer(&fn), 113 ) 114 return 115 } 116 117 // GetLocalCandidates calls the method "RTCIceTransport.getLocalCandidates". 118 func (this RTCIceTransport) GetLocalCandidates() (ret js.Array[RTCIceCandidate]) { 119 bindings.CallRTCIceTransportGetLocalCandidates( 120 this.ref, js.Pointer(&ret), 121 ) 122 123 return 124 } 125 126 // TryGetLocalCandidates calls the method "RTCIceTransport.getLocalCandidates" 127 // in a try/catch block and returns (_, err, ok = false) when it went through 128 // the catch clause. 129 func (this RTCIceTransport) TryGetLocalCandidates() (ret js.Array[RTCIceCandidate], exception js.Any, ok bool) { 130 ok = js.True == bindings.TryRTCIceTransportGetLocalCandidates( 131 this.ref, js.Pointer(&ret), js.Pointer(&exception), 132 ) 133 134 return 135 } 136 137 // HasFuncGetRemoteCandidates returns true if the method "RTCIceTransport.getRemoteCandidates" exists. 138 func (this RTCIceTransport) HasFuncGetRemoteCandidates() bool { 139 return js.True == bindings.HasFuncRTCIceTransportGetRemoteCandidates( 140 this.ref, 141 ) 142 } 143 144 // FuncGetRemoteCandidates returns the method "RTCIceTransport.getRemoteCandidates". 145 func (this RTCIceTransport) FuncGetRemoteCandidates() (fn js.Func[func() js.Array[RTCIceCandidate]]) { 146 bindings.FuncRTCIceTransportGetRemoteCandidates( 147 this.ref, js.Pointer(&fn), 148 ) 149 return 150 } 151 152 // GetRemoteCandidates calls the method "RTCIceTransport.getRemoteCandidates". 153 func (this RTCIceTransport) GetRemoteCandidates() (ret js.Array[RTCIceCandidate]) { 154 bindings.CallRTCIceTransportGetRemoteCandidates( 155 this.ref, js.Pointer(&ret), 156 ) 157 158 return 159 } 160 161 // TryGetRemoteCandidates calls the method "RTCIceTransport.getRemoteCandidates" 162 // in a try/catch block and returns (_, err, ok = false) when it went through 163 // the catch clause. 164 func (this RTCIceTransport) TryGetRemoteCandidates() (ret js.Array[RTCIceCandidate], exception js.Any, ok bool) { 165 ok = js.True == bindings.TryRTCIceTransportGetRemoteCandidates( 166 this.ref, js.Pointer(&ret), js.Pointer(&exception), 167 ) 168 169 return 170 } 171 172 // HasFuncGetSelectedCandidatePair returns true if the method "RTCIceTransport.getSelectedCandidatePair" exists. 173 func (this RTCIceTransport) HasFuncGetSelectedCandidatePair() bool { 174 return js.True == bindings.HasFuncRTCIceTransportGetSelectedCandidatePair( 175 this.ref, 176 ) 177 } 178 179 // FuncGetSelectedCandidatePair returns the method "RTCIceTransport.getSelectedCandidatePair". 180 func (this RTCIceTransport) FuncGetSelectedCandidatePair() (fn js.Func[func() RTCIceCandidatePair]) { 181 bindings.FuncRTCIceTransportGetSelectedCandidatePair( 182 this.ref, js.Pointer(&fn), 183 ) 184 return 185 } 186 187 // GetSelectedCandidatePair calls the method "RTCIceTransport.getSelectedCandidatePair". 188 func (this RTCIceTransport) GetSelectedCandidatePair() (ret RTCIceCandidatePair) { 189 bindings.CallRTCIceTransportGetSelectedCandidatePair( 190 this.ref, js.Pointer(&ret), 191 ) 192 193 return 194 } 195 196 // TryGetSelectedCandidatePair calls the method "RTCIceTransport.getSelectedCandidatePair" 197 // in a try/catch block and returns (_, err, ok = false) when it went through 198 // the catch clause. 199 func (this RTCIceTransport) TryGetSelectedCandidatePair() (ret RTCIceCandidatePair, exception js.Any, ok bool) { 200 ok = js.True == bindings.TryRTCIceTransportGetSelectedCandidatePair( 201 this.ref, js.Pointer(&ret), js.Pointer(&exception), 202 ) 203 204 return 205 } 206 207 // HasFuncGetLocalParameters returns true if the method "RTCIceTransport.getLocalParameters" exists. 208 func (this RTCIceTransport) HasFuncGetLocalParameters() bool { 209 return js.True == bindings.HasFuncRTCIceTransportGetLocalParameters( 210 this.ref, 211 ) 212 } 213 214 // FuncGetLocalParameters returns the method "RTCIceTransport.getLocalParameters". 215 func (this RTCIceTransport) FuncGetLocalParameters() (fn js.Func[func() RTCIceParameters]) { 216 bindings.FuncRTCIceTransportGetLocalParameters( 217 this.ref, js.Pointer(&fn), 218 ) 219 return 220 } 221 222 // GetLocalParameters calls the method "RTCIceTransport.getLocalParameters". 223 func (this RTCIceTransport) GetLocalParameters() (ret RTCIceParameters) { 224 bindings.CallRTCIceTransportGetLocalParameters( 225 this.ref, js.Pointer(&ret), 226 ) 227 228 return 229 } 230 231 // TryGetLocalParameters calls the method "RTCIceTransport.getLocalParameters" 232 // in a try/catch block and returns (_, err, ok = false) when it went through 233 // the catch clause. 234 func (this RTCIceTransport) TryGetLocalParameters() (ret RTCIceParameters, exception js.Any, ok bool) { 235 ok = js.True == bindings.TryRTCIceTransportGetLocalParameters( 236 this.ref, js.Pointer(&ret), js.Pointer(&exception), 237 ) 238 239 return 240 } 241 242 // HasFuncGetRemoteParameters returns true if the method "RTCIceTransport.getRemoteParameters" exists. 243 func (this RTCIceTransport) HasFuncGetRemoteParameters() bool { 244 return js.True == bindings.HasFuncRTCIceTransportGetRemoteParameters( 245 this.ref, 246 ) 247 } 248 249 // FuncGetRemoteParameters returns the method "RTCIceTransport.getRemoteParameters". 250 func (this RTCIceTransport) FuncGetRemoteParameters() (fn js.Func[func() RTCIceParameters]) { 251 bindings.FuncRTCIceTransportGetRemoteParameters( 252 this.ref, js.Pointer(&fn), 253 ) 254 return 255 } 256 257 // GetRemoteParameters calls the method "RTCIceTransport.getRemoteParameters". 258 func (this RTCIceTransport) GetRemoteParameters() (ret RTCIceParameters) { 259 bindings.CallRTCIceTransportGetRemoteParameters( 260 this.ref, js.Pointer(&ret), 261 ) 262 263 return 264 } 265 266 // TryGetRemoteParameters calls the method "RTCIceTransport.getRemoteParameters" 267 // in a try/catch block and returns (_, err, ok = false) when it went through 268 // the catch clause. 269 func (this RTCIceTransport) TryGetRemoteParameters() (ret RTCIceParameters, exception js.Any, ok bool) { 270 ok = js.True == bindings.TryRTCIceTransportGetRemoteParameters( 271 this.ref, js.Pointer(&ret), js.Pointer(&exception), 272 ) 273 274 return 275 } 276 277 // HasFuncGather returns true if the method "RTCIceTransport.gather" exists. 278 func (this RTCIceTransport) HasFuncGather() bool { 279 return js.True == bindings.HasFuncRTCIceTransportGather( 280 this.ref, 281 ) 282 } 283 284 // FuncGather returns the method "RTCIceTransport.gather". 285 func (this RTCIceTransport) FuncGather() (fn js.Func[func(options RTCIceGatherOptions)]) { 286 bindings.FuncRTCIceTransportGather( 287 this.ref, js.Pointer(&fn), 288 ) 289 return 290 } 291 292 // Gather calls the method "RTCIceTransport.gather". 293 func (this RTCIceTransport) Gather(options RTCIceGatherOptions) (ret js.Void) { 294 bindings.CallRTCIceTransportGather( 295 this.ref, js.Pointer(&ret), 296 js.Pointer(&options), 297 ) 298 299 return 300 } 301 302 // TryGather calls the method "RTCIceTransport.gather" 303 // in a try/catch block and returns (_, err, ok = false) when it went through 304 // the catch clause. 305 func (this RTCIceTransport) TryGather(options RTCIceGatherOptions) (ret js.Void, exception js.Any, ok bool) { 306 ok = js.True == bindings.TryRTCIceTransportGather( 307 this.ref, js.Pointer(&ret), js.Pointer(&exception), 308 js.Pointer(&options), 309 ) 310 311 return 312 } 313 314 // HasFuncGather1 returns true if the method "RTCIceTransport.gather" exists. 315 func (this RTCIceTransport) HasFuncGather1() bool { 316 return js.True == bindings.HasFuncRTCIceTransportGather1( 317 this.ref, 318 ) 319 } 320 321 // FuncGather1 returns the method "RTCIceTransport.gather". 322 func (this RTCIceTransport) FuncGather1() (fn js.Func[func()]) { 323 bindings.FuncRTCIceTransportGather1( 324 this.ref, js.Pointer(&fn), 325 ) 326 return 327 } 328 329 // Gather1 calls the method "RTCIceTransport.gather". 330 func (this RTCIceTransport) Gather1() (ret js.Void) { 331 bindings.CallRTCIceTransportGather1( 332 this.ref, js.Pointer(&ret), 333 ) 334 335 return 336 } 337 338 // TryGather1 calls the method "RTCIceTransport.gather" 339 // in a try/catch block and returns (_, err, ok = false) when it went through 340 // the catch clause. 341 func (this RTCIceTransport) TryGather1() (ret js.Void, exception js.Any, ok bool) { 342 ok = js.True == bindings.TryRTCIceTransportGather1( 343 this.ref, js.Pointer(&ret), js.Pointer(&exception), 344 ) 345 346 return 347 } 348 349 // HasFuncStart returns true if the method "RTCIceTransport.start" exists. 350 func (this RTCIceTransport) HasFuncStart() bool { 351 return js.True == bindings.HasFuncRTCIceTransportStart( 352 this.ref, 353 ) 354 } 355 356 // FuncStart returns the method "RTCIceTransport.start". 357 func (this RTCIceTransport) FuncStart() (fn js.Func[func(remoteParameters RTCIceParameters, role RTCIceRole)]) { 358 bindings.FuncRTCIceTransportStart( 359 this.ref, js.Pointer(&fn), 360 ) 361 return 362 } 363 364 // Start calls the method "RTCIceTransport.start". 365 func (this RTCIceTransport) Start(remoteParameters RTCIceParameters, role RTCIceRole) (ret js.Void) { 366 bindings.CallRTCIceTransportStart( 367 this.ref, js.Pointer(&ret), 368 js.Pointer(&remoteParameters), 369 uint32(role), 370 ) 371 372 return 373 } 374 375 // TryStart calls the method "RTCIceTransport.start" 376 // in a try/catch block and returns (_, err, ok = false) when it went through 377 // the catch clause. 378 func (this RTCIceTransport) TryStart(remoteParameters RTCIceParameters, role RTCIceRole) (ret js.Void, exception js.Any, ok bool) { 379 ok = js.True == bindings.TryRTCIceTransportStart( 380 this.ref, js.Pointer(&ret), js.Pointer(&exception), 381 js.Pointer(&remoteParameters), 382 uint32(role), 383 ) 384 385 return 386 } 387 388 // HasFuncStart1 returns true if the method "RTCIceTransport.start" exists. 389 func (this RTCIceTransport) HasFuncStart1() bool { 390 return js.True == bindings.HasFuncRTCIceTransportStart1( 391 this.ref, 392 ) 393 } 394 395 // FuncStart1 returns the method "RTCIceTransport.start". 396 func (this RTCIceTransport) FuncStart1() (fn js.Func[func(remoteParameters RTCIceParameters)]) { 397 bindings.FuncRTCIceTransportStart1( 398 this.ref, js.Pointer(&fn), 399 ) 400 return 401 } 402 403 // Start1 calls the method "RTCIceTransport.start". 404 func (this RTCIceTransport) Start1(remoteParameters RTCIceParameters) (ret js.Void) { 405 bindings.CallRTCIceTransportStart1( 406 this.ref, js.Pointer(&ret), 407 js.Pointer(&remoteParameters), 408 ) 409 410 return 411 } 412 413 // TryStart1 calls the method "RTCIceTransport.start" 414 // in a try/catch block and returns (_, err, ok = false) when it went through 415 // the catch clause. 416 func (this RTCIceTransport) TryStart1(remoteParameters RTCIceParameters) (ret js.Void, exception js.Any, ok bool) { 417 ok = js.True == bindings.TryRTCIceTransportStart1( 418 this.ref, js.Pointer(&ret), js.Pointer(&exception), 419 js.Pointer(&remoteParameters), 420 ) 421 422 return 423 } 424 425 // HasFuncStart2 returns true if the method "RTCIceTransport.start" exists. 426 func (this RTCIceTransport) HasFuncStart2() bool { 427 return js.True == bindings.HasFuncRTCIceTransportStart2( 428 this.ref, 429 ) 430 } 431 432 // FuncStart2 returns the method "RTCIceTransport.start". 433 func (this RTCIceTransport) FuncStart2() (fn js.Func[func()]) { 434 bindings.FuncRTCIceTransportStart2( 435 this.ref, js.Pointer(&fn), 436 ) 437 return 438 } 439 440 // Start2 calls the method "RTCIceTransport.start". 441 func (this RTCIceTransport) Start2() (ret js.Void) { 442 bindings.CallRTCIceTransportStart2( 443 this.ref, js.Pointer(&ret), 444 ) 445 446 return 447 } 448 449 // TryStart2 calls the method "RTCIceTransport.start" 450 // in a try/catch block and returns (_, err, ok = false) when it went through 451 // the catch clause. 452 func (this RTCIceTransport) TryStart2() (ret js.Void, exception js.Any, ok bool) { 453 ok = js.True == bindings.TryRTCIceTransportStart2( 454 this.ref, js.Pointer(&ret), js.Pointer(&exception), 455 ) 456 457 return 458 } 459 460 // HasFuncStop returns true if the method "RTCIceTransport.stop" exists. 461 func (this RTCIceTransport) HasFuncStop() bool { 462 return js.True == bindings.HasFuncRTCIceTransportStop( 463 this.ref, 464 ) 465 } 466 467 // FuncStop returns the method "RTCIceTransport.stop". 468 func (this RTCIceTransport) FuncStop() (fn js.Func[func()]) { 469 bindings.FuncRTCIceTransportStop( 470 this.ref, js.Pointer(&fn), 471 ) 472 return 473 } 474 475 // Stop calls the method "RTCIceTransport.stop". 476 func (this RTCIceTransport) Stop() (ret js.Void) { 477 bindings.CallRTCIceTransportStop( 478 this.ref, js.Pointer(&ret), 479 ) 480 481 return 482 } 483 484 // TryStop calls the method "RTCIceTransport.stop" 485 // in a try/catch block and returns (_, err, ok = false) when it went through 486 // the catch clause. 487 func (this RTCIceTransport) TryStop() (ret js.Void, exception js.Any, ok bool) { 488 ok = js.True == bindings.TryRTCIceTransportStop( 489 this.ref, js.Pointer(&ret), js.Pointer(&exception), 490 ) 491 492 return 493 } 494 495 // HasFuncAddRemoteCandidate returns true if the method "RTCIceTransport.addRemoteCandidate" exists. 496 func (this RTCIceTransport) HasFuncAddRemoteCandidate() bool { 497 return js.True == bindings.HasFuncRTCIceTransportAddRemoteCandidate( 498 this.ref, 499 ) 500 } 501 502 // FuncAddRemoteCandidate returns the method "RTCIceTransport.addRemoteCandidate". 503 func (this RTCIceTransport) FuncAddRemoteCandidate() (fn js.Func[func(remoteCandidate RTCIceCandidateInit)]) { 504 bindings.FuncRTCIceTransportAddRemoteCandidate( 505 this.ref, js.Pointer(&fn), 506 ) 507 return 508 } 509 510 // AddRemoteCandidate calls the method "RTCIceTransport.addRemoteCandidate". 511 func (this RTCIceTransport) AddRemoteCandidate(remoteCandidate RTCIceCandidateInit) (ret js.Void) { 512 bindings.CallRTCIceTransportAddRemoteCandidate( 513 this.ref, js.Pointer(&ret), 514 js.Pointer(&remoteCandidate), 515 ) 516 517 return 518 } 519 520 // TryAddRemoteCandidate calls the method "RTCIceTransport.addRemoteCandidate" 521 // in a try/catch block and returns (_, err, ok = false) when it went through 522 // the catch clause. 523 func (this RTCIceTransport) TryAddRemoteCandidate(remoteCandidate RTCIceCandidateInit) (ret js.Void, exception js.Any, ok bool) { 524 ok = js.True == bindings.TryRTCIceTransportAddRemoteCandidate( 525 this.ref, js.Pointer(&ret), js.Pointer(&exception), 526 js.Pointer(&remoteCandidate), 527 ) 528 529 return 530 } 531 532 // HasFuncAddRemoteCandidate1 returns true if the method "RTCIceTransport.addRemoteCandidate" exists. 533 func (this RTCIceTransport) HasFuncAddRemoteCandidate1() bool { 534 return js.True == bindings.HasFuncRTCIceTransportAddRemoteCandidate1( 535 this.ref, 536 ) 537 } 538 539 // FuncAddRemoteCandidate1 returns the method "RTCIceTransport.addRemoteCandidate". 540 func (this RTCIceTransport) FuncAddRemoteCandidate1() (fn js.Func[func()]) { 541 bindings.FuncRTCIceTransportAddRemoteCandidate1( 542 this.ref, js.Pointer(&fn), 543 ) 544 return 545 } 546 547 // AddRemoteCandidate1 calls the method "RTCIceTransport.addRemoteCandidate". 548 func (this RTCIceTransport) AddRemoteCandidate1() (ret js.Void) { 549 bindings.CallRTCIceTransportAddRemoteCandidate1( 550 this.ref, js.Pointer(&ret), 551 ) 552 553 return 554 } 555 556 // TryAddRemoteCandidate1 calls the method "RTCIceTransport.addRemoteCandidate" 557 // in a try/catch block and returns (_, err, ok = false) when it went through 558 // the catch clause. 559 func (this RTCIceTransport) TryAddRemoteCandidate1() (ret js.Void, exception js.Any, ok bool) { 560 ok = js.True == bindings.TryRTCIceTransportAddRemoteCandidate1( 561 this.ref, js.Pointer(&ret), js.Pointer(&exception), 562 ) 563 564 return 565 } 566 567 type RTCDtlsTransportState uint32 568 569 const ( 570 _ RTCDtlsTransportState = iota 571 572 RTCDtlsTransportState_NEW 573 RTCDtlsTransportState_CONNECTING 574 RTCDtlsTransportState_CONNECTED 575 RTCDtlsTransportState_CLOSED 576 RTCDtlsTransportState_FAILED 577 ) 578 579 func (RTCDtlsTransportState) FromRef(str js.Ref) RTCDtlsTransportState { 580 return RTCDtlsTransportState(bindings.ConstOfRTCDtlsTransportState(str)) 581 } 582 583 func (x RTCDtlsTransportState) String() (string, bool) { 584 switch x { 585 case RTCDtlsTransportState_NEW: 586 return "new", true 587 case RTCDtlsTransportState_CONNECTING: 588 return "connecting", true 589 case RTCDtlsTransportState_CONNECTED: 590 return "connected", true 591 case RTCDtlsTransportState_CLOSED: 592 return "closed", true 593 case RTCDtlsTransportState_FAILED: 594 return "failed", true 595 default: 596 return "", false 597 } 598 } 599 600 type RTCDtlsTransport struct { 601 EventTarget 602 } 603 604 func (this RTCDtlsTransport) Once() RTCDtlsTransport { 605 this.ref.Once() 606 return this 607 } 608 609 func (this RTCDtlsTransport) Ref() js.Ref { 610 return this.EventTarget.Ref() 611 } 612 613 func (this RTCDtlsTransport) FromRef(ref js.Ref) RTCDtlsTransport { 614 this.EventTarget = this.EventTarget.FromRef(ref) 615 return this 616 } 617 618 func (this RTCDtlsTransport) Free() { 619 this.ref.Free() 620 } 621 622 // IceTransport returns the value of property "RTCDtlsTransport.iceTransport". 623 // 624 // It returns ok=false if there is no such property. 625 func (this RTCDtlsTransport) IceTransport() (ret RTCIceTransport, ok bool) { 626 ok = js.True == bindings.GetRTCDtlsTransportIceTransport( 627 this.ref, js.Pointer(&ret), 628 ) 629 return 630 } 631 632 // State returns the value of property "RTCDtlsTransport.state". 633 // 634 // It returns ok=false if there is no such property. 635 func (this RTCDtlsTransport) State() (ret RTCDtlsTransportState, ok bool) { 636 ok = js.True == bindings.GetRTCDtlsTransportState( 637 this.ref, js.Pointer(&ret), 638 ) 639 return 640 } 641 642 // HasFuncGetRemoteCertificates returns true if the method "RTCDtlsTransport.getRemoteCertificates" exists. 643 func (this RTCDtlsTransport) HasFuncGetRemoteCertificates() bool { 644 return js.True == bindings.HasFuncRTCDtlsTransportGetRemoteCertificates( 645 this.ref, 646 ) 647 } 648 649 // FuncGetRemoteCertificates returns the method "RTCDtlsTransport.getRemoteCertificates". 650 func (this RTCDtlsTransport) FuncGetRemoteCertificates() (fn js.Func[func() js.Array[js.ArrayBuffer]]) { 651 bindings.FuncRTCDtlsTransportGetRemoteCertificates( 652 this.ref, js.Pointer(&fn), 653 ) 654 return 655 } 656 657 // GetRemoteCertificates calls the method "RTCDtlsTransport.getRemoteCertificates". 658 func (this RTCDtlsTransport) GetRemoteCertificates() (ret js.Array[js.ArrayBuffer]) { 659 bindings.CallRTCDtlsTransportGetRemoteCertificates( 660 this.ref, js.Pointer(&ret), 661 ) 662 663 return 664 } 665 666 // TryGetRemoteCertificates calls the method "RTCDtlsTransport.getRemoteCertificates" 667 // in a try/catch block and returns (_, err, ok = false) when it went through 668 // the catch clause. 669 func (this RTCDtlsTransport) TryGetRemoteCertificates() (ret js.Array[js.ArrayBuffer], exception js.Any, ok bool) { 670 ok = js.True == bindings.TryRTCDtlsTransportGetRemoteCertificates( 671 this.ref, js.Pointer(&ret), js.Pointer(&exception), 672 ) 673 674 return 675 } 676 677 type RTCEncodedAudioFrameMetadata struct { 678 // SynchronizationSource is "RTCEncodedAudioFrameMetadata.synchronizationSource" 679 // 680 // Optional 681 // 682 // NOTE: FFI_USE_SynchronizationSource MUST be set to true to make this field effective. 683 SynchronizationSource uint32 684 // PayloadType is "RTCEncodedAudioFrameMetadata.payloadType" 685 // 686 // Optional 687 // 688 // NOTE: FFI_USE_PayloadType MUST be set to true to make this field effective. 689 PayloadType uint8 690 // ContributingSources is "RTCEncodedAudioFrameMetadata.contributingSources" 691 // 692 // Optional 693 ContributingSources js.Array[uint32] 694 // SequenceNumber is "RTCEncodedAudioFrameMetadata.sequenceNumber" 695 // 696 // Optional 697 // 698 // NOTE: FFI_USE_SequenceNumber MUST be set to true to make this field effective. 699 SequenceNumber int16 700 701 FFI_USE_SynchronizationSource bool // for SynchronizationSource. 702 FFI_USE_PayloadType bool // for PayloadType. 703 FFI_USE_SequenceNumber bool // for SequenceNumber. 704 705 FFI_USE bool 706 } 707 708 // FromRef calls UpdateFrom and returns a RTCEncodedAudioFrameMetadata with all fields set. 709 func (p RTCEncodedAudioFrameMetadata) FromRef(ref js.Ref) RTCEncodedAudioFrameMetadata { 710 p.UpdateFrom(ref) 711 return p 712 } 713 714 // New creates a new RTCEncodedAudioFrameMetadata in the application heap. 715 func (p RTCEncodedAudioFrameMetadata) New() js.Ref { 716 return bindings.RTCEncodedAudioFrameMetadataJSLoad( 717 js.Pointer(&p), js.True, 0, 718 ) 719 } 720 721 // UpdateFrom copies value of all fields of the heap object to p. 722 func (p *RTCEncodedAudioFrameMetadata) UpdateFrom(ref js.Ref) { 723 bindings.RTCEncodedAudioFrameMetadataJSStore( 724 js.Pointer(p), ref, 725 ) 726 } 727 728 // Update writes all fields of the p to the heap object referenced by ref. 729 func (p *RTCEncodedAudioFrameMetadata) Update(ref js.Ref) { 730 bindings.RTCEncodedAudioFrameMetadataJSLoad( 731 js.Pointer(p), js.False, ref, 732 ) 733 } 734 735 // FreeMembers frees fields with heap reference, if recursive is true 736 // free all heap references reachable from p. 737 func (p *RTCEncodedAudioFrameMetadata) FreeMembers(recursive bool) { 738 js.Free( 739 p.ContributingSources.Ref(), 740 ) 741 p.ContributingSources = p.ContributingSources.FromRef(js.Undefined) 742 } 743 744 type RTCEncodedAudioFrame struct { 745 ref js.Ref 746 } 747 748 func (this RTCEncodedAudioFrame) Once() RTCEncodedAudioFrame { 749 this.ref.Once() 750 return this 751 } 752 753 func (this RTCEncodedAudioFrame) Ref() js.Ref { 754 return this.ref 755 } 756 757 func (this RTCEncodedAudioFrame) FromRef(ref js.Ref) RTCEncodedAudioFrame { 758 this.ref = ref 759 return this 760 } 761 762 func (this RTCEncodedAudioFrame) Free() { 763 this.ref.Free() 764 } 765 766 // Timestamp returns the value of property "RTCEncodedAudioFrame.timestamp". 767 // 768 // It returns ok=false if there is no such property. 769 func (this RTCEncodedAudioFrame) Timestamp() (ret uint32, ok bool) { 770 ok = js.True == bindings.GetRTCEncodedAudioFrameTimestamp( 771 this.ref, js.Pointer(&ret), 772 ) 773 return 774 } 775 776 // Data returns the value of property "RTCEncodedAudioFrame.data". 777 // 778 // It returns ok=false if there is no such property. 779 func (this RTCEncodedAudioFrame) Data() (ret js.ArrayBuffer, ok bool) { 780 ok = js.True == bindings.GetRTCEncodedAudioFrameData( 781 this.ref, js.Pointer(&ret), 782 ) 783 return 784 } 785 786 // SetData sets the value of property "RTCEncodedAudioFrame.data" to val. 787 // 788 // It returns false if the property cannot be set. 789 func (this RTCEncodedAudioFrame) SetData(val js.ArrayBuffer) bool { 790 return js.True == bindings.SetRTCEncodedAudioFrameData( 791 this.ref, 792 val.Ref(), 793 ) 794 } 795 796 // HasFuncGetMetadata returns true if the method "RTCEncodedAudioFrame.getMetadata" exists. 797 func (this RTCEncodedAudioFrame) HasFuncGetMetadata() bool { 798 return js.True == bindings.HasFuncRTCEncodedAudioFrameGetMetadata( 799 this.ref, 800 ) 801 } 802 803 // FuncGetMetadata returns the method "RTCEncodedAudioFrame.getMetadata". 804 func (this RTCEncodedAudioFrame) FuncGetMetadata() (fn js.Func[func() RTCEncodedAudioFrameMetadata]) { 805 bindings.FuncRTCEncodedAudioFrameGetMetadata( 806 this.ref, js.Pointer(&fn), 807 ) 808 return 809 } 810 811 // GetMetadata calls the method "RTCEncodedAudioFrame.getMetadata". 812 func (this RTCEncodedAudioFrame) GetMetadata() (ret RTCEncodedAudioFrameMetadata) { 813 bindings.CallRTCEncodedAudioFrameGetMetadata( 814 this.ref, js.Pointer(&ret), 815 ) 816 817 return 818 } 819 820 // TryGetMetadata calls the method "RTCEncodedAudioFrame.getMetadata" 821 // in a try/catch block and returns (_, err, ok = false) when it went through 822 // the catch clause. 823 func (this RTCEncodedAudioFrame) TryGetMetadata() (ret RTCEncodedAudioFrameMetadata, exception js.Any, ok bool) { 824 ok = js.True == bindings.TryRTCEncodedAudioFrameGetMetadata( 825 this.ref, js.Pointer(&ret), js.Pointer(&exception), 826 ) 827 828 return 829 } 830 831 type RTCEncodedVideoFrameMetadata struct { 832 // FrameId is "RTCEncodedVideoFrameMetadata.frameId" 833 // 834 // Optional 835 // 836 // NOTE: FFI_USE_FrameId MUST be set to true to make this field effective. 837 FrameId uint64 838 // Dependencies is "RTCEncodedVideoFrameMetadata.dependencies" 839 // 840 // Optional 841 Dependencies js.Array[uint64] 842 // Width is "RTCEncodedVideoFrameMetadata.width" 843 // 844 // Optional 845 // 846 // NOTE: FFI_USE_Width MUST be set to true to make this field effective. 847 Width uint16 848 // Height is "RTCEncodedVideoFrameMetadata.height" 849 // 850 // Optional 851 // 852 // NOTE: FFI_USE_Height MUST be set to true to make this field effective. 853 Height uint16 854 // SpatialIndex is "RTCEncodedVideoFrameMetadata.spatialIndex" 855 // 856 // Optional 857 // 858 // NOTE: FFI_USE_SpatialIndex MUST be set to true to make this field effective. 859 SpatialIndex uint32 860 // TemporalIndex is "RTCEncodedVideoFrameMetadata.temporalIndex" 861 // 862 // Optional 863 // 864 // NOTE: FFI_USE_TemporalIndex MUST be set to true to make this field effective. 865 TemporalIndex uint32 866 // SynchronizationSource is "RTCEncodedVideoFrameMetadata.synchronizationSource" 867 // 868 // Optional 869 // 870 // NOTE: FFI_USE_SynchronizationSource MUST be set to true to make this field effective. 871 SynchronizationSource uint32 872 // PayloadType is "RTCEncodedVideoFrameMetadata.payloadType" 873 // 874 // Optional 875 // 876 // NOTE: FFI_USE_PayloadType MUST be set to true to make this field effective. 877 PayloadType uint8 878 // ContributingSources is "RTCEncodedVideoFrameMetadata.contributingSources" 879 // 880 // Optional 881 ContributingSources js.Array[uint32] 882 // Timestamp is "RTCEncodedVideoFrameMetadata.timestamp" 883 // 884 // Optional 885 // 886 // NOTE: FFI_USE_Timestamp MUST be set to true to make this field effective. 887 Timestamp int64 888 889 FFI_USE_FrameId bool // for FrameId. 890 FFI_USE_Width bool // for Width. 891 FFI_USE_Height bool // for Height. 892 FFI_USE_SpatialIndex bool // for SpatialIndex. 893 FFI_USE_TemporalIndex bool // for TemporalIndex. 894 FFI_USE_SynchronizationSource bool // for SynchronizationSource. 895 FFI_USE_PayloadType bool // for PayloadType. 896 FFI_USE_Timestamp bool // for Timestamp. 897 898 FFI_USE bool 899 } 900 901 // FromRef calls UpdateFrom and returns a RTCEncodedVideoFrameMetadata with all fields set. 902 func (p RTCEncodedVideoFrameMetadata) FromRef(ref js.Ref) RTCEncodedVideoFrameMetadata { 903 p.UpdateFrom(ref) 904 return p 905 } 906 907 // New creates a new RTCEncodedVideoFrameMetadata in the application heap. 908 func (p RTCEncodedVideoFrameMetadata) New() js.Ref { 909 return bindings.RTCEncodedVideoFrameMetadataJSLoad( 910 js.Pointer(&p), js.True, 0, 911 ) 912 } 913 914 // UpdateFrom copies value of all fields of the heap object to p. 915 func (p *RTCEncodedVideoFrameMetadata) UpdateFrom(ref js.Ref) { 916 bindings.RTCEncodedVideoFrameMetadataJSStore( 917 js.Pointer(p), ref, 918 ) 919 } 920 921 // Update writes all fields of the p to the heap object referenced by ref. 922 func (p *RTCEncodedVideoFrameMetadata) Update(ref js.Ref) { 923 bindings.RTCEncodedVideoFrameMetadataJSLoad( 924 js.Pointer(p), js.False, ref, 925 ) 926 } 927 928 // FreeMembers frees fields with heap reference, if recursive is true 929 // free all heap references reachable from p. 930 func (p *RTCEncodedVideoFrameMetadata) FreeMembers(recursive bool) { 931 js.Free( 932 p.Dependencies.Ref(), 933 p.ContributingSources.Ref(), 934 ) 935 p.Dependencies = p.Dependencies.FromRef(js.Undefined) 936 p.ContributingSources = p.ContributingSources.FromRef(js.Undefined) 937 } 938 939 type RTCEncodedVideoFrameType uint32 940 941 const ( 942 _ RTCEncodedVideoFrameType = iota 943 944 RTCEncodedVideoFrameType_EMPTY 945 RTCEncodedVideoFrameType_KEY 946 RTCEncodedVideoFrameType_DELTA 947 ) 948 949 func (RTCEncodedVideoFrameType) FromRef(str js.Ref) RTCEncodedVideoFrameType { 950 return RTCEncodedVideoFrameType(bindings.ConstOfRTCEncodedVideoFrameType(str)) 951 } 952 953 func (x RTCEncodedVideoFrameType) String() (string, bool) { 954 switch x { 955 case RTCEncodedVideoFrameType_EMPTY: 956 return "empty", true 957 case RTCEncodedVideoFrameType_KEY: 958 return "key", true 959 case RTCEncodedVideoFrameType_DELTA: 960 return "delta", true 961 default: 962 return "", false 963 } 964 } 965 966 type RTCEncodedVideoFrame struct { 967 ref js.Ref 968 } 969 970 func (this RTCEncodedVideoFrame) Once() RTCEncodedVideoFrame { 971 this.ref.Once() 972 return this 973 } 974 975 func (this RTCEncodedVideoFrame) Ref() js.Ref { 976 return this.ref 977 } 978 979 func (this RTCEncodedVideoFrame) FromRef(ref js.Ref) RTCEncodedVideoFrame { 980 this.ref = ref 981 return this 982 } 983 984 func (this RTCEncodedVideoFrame) Free() { 985 this.ref.Free() 986 } 987 988 // Type returns the value of property "RTCEncodedVideoFrame.type". 989 // 990 // It returns ok=false if there is no such property. 991 func (this RTCEncodedVideoFrame) Type() (ret RTCEncodedVideoFrameType, ok bool) { 992 ok = js.True == bindings.GetRTCEncodedVideoFrameType( 993 this.ref, js.Pointer(&ret), 994 ) 995 return 996 } 997 998 // Timestamp returns the value of property "RTCEncodedVideoFrame.timestamp". 999 // 1000 // It returns ok=false if there is no such property. 1001 func (this RTCEncodedVideoFrame) Timestamp() (ret uint32, ok bool) { 1002 ok = js.True == bindings.GetRTCEncodedVideoFrameTimestamp( 1003 this.ref, js.Pointer(&ret), 1004 ) 1005 return 1006 } 1007 1008 // Data returns the value of property "RTCEncodedVideoFrame.data". 1009 // 1010 // It returns ok=false if there is no such property. 1011 func (this RTCEncodedVideoFrame) Data() (ret js.ArrayBuffer, ok bool) { 1012 ok = js.True == bindings.GetRTCEncodedVideoFrameData( 1013 this.ref, js.Pointer(&ret), 1014 ) 1015 return 1016 } 1017 1018 // SetData sets the value of property "RTCEncodedVideoFrame.data" to val. 1019 // 1020 // It returns false if the property cannot be set. 1021 func (this RTCEncodedVideoFrame) SetData(val js.ArrayBuffer) bool { 1022 return js.True == bindings.SetRTCEncodedVideoFrameData( 1023 this.ref, 1024 val.Ref(), 1025 ) 1026 } 1027 1028 // HasFuncGetMetadata returns true if the method "RTCEncodedVideoFrame.getMetadata" exists. 1029 func (this RTCEncodedVideoFrame) HasFuncGetMetadata() bool { 1030 return js.True == bindings.HasFuncRTCEncodedVideoFrameGetMetadata( 1031 this.ref, 1032 ) 1033 } 1034 1035 // FuncGetMetadata returns the method "RTCEncodedVideoFrame.getMetadata". 1036 func (this RTCEncodedVideoFrame) FuncGetMetadata() (fn js.Func[func() RTCEncodedVideoFrameMetadata]) { 1037 bindings.FuncRTCEncodedVideoFrameGetMetadata( 1038 this.ref, js.Pointer(&fn), 1039 ) 1040 return 1041 } 1042 1043 // GetMetadata calls the method "RTCEncodedVideoFrame.getMetadata". 1044 func (this RTCEncodedVideoFrame) GetMetadata() (ret RTCEncodedVideoFrameMetadata) { 1045 bindings.CallRTCEncodedVideoFrameGetMetadata( 1046 this.ref, js.Pointer(&ret), 1047 ) 1048 1049 return 1050 } 1051 1052 // TryGetMetadata calls the method "RTCEncodedVideoFrame.getMetadata" 1053 // in a try/catch block and returns (_, err, ok = false) when it went through 1054 // the catch clause. 1055 func (this RTCEncodedVideoFrame) TryGetMetadata() (ret RTCEncodedVideoFrameMetadata, exception js.Any, ok bool) { 1056 ok = js.True == bindings.TryRTCEncodedVideoFrameGetMetadata( 1057 this.ref, js.Pointer(&ret), js.Pointer(&exception), 1058 ) 1059 1060 return 1061 } 1062 1063 type RTCErrorDetailType uint32 1064 1065 const ( 1066 _ RTCErrorDetailType = iota 1067 1068 RTCErrorDetailType_DATA_CHANNEL_FAILURE 1069 RTCErrorDetailType_DTLS_FAILURE 1070 RTCErrorDetailType_FINGERPRINT_FAILURE 1071 RTCErrorDetailType_SCTP_FAILURE 1072 RTCErrorDetailType_SDP_SYNTAX_ERROR 1073 RTCErrorDetailType_HARDWARE_ENCODER_NOT_AVAILABLE 1074 RTCErrorDetailType_HARDWARE_ENCODER_ERROR 1075 ) 1076 1077 func (RTCErrorDetailType) FromRef(str js.Ref) RTCErrorDetailType { 1078 return RTCErrorDetailType(bindings.ConstOfRTCErrorDetailType(str)) 1079 } 1080 1081 func (x RTCErrorDetailType) String() (string, bool) { 1082 switch x { 1083 case RTCErrorDetailType_DATA_CHANNEL_FAILURE: 1084 return "data-channel-failure", true 1085 case RTCErrorDetailType_DTLS_FAILURE: 1086 return "dtls-failure", true 1087 case RTCErrorDetailType_FINGERPRINT_FAILURE: 1088 return "fingerprint-failure", true 1089 case RTCErrorDetailType_SCTP_FAILURE: 1090 return "sctp-failure", true 1091 case RTCErrorDetailType_SDP_SYNTAX_ERROR: 1092 return "sdp-syntax-error", true 1093 case RTCErrorDetailType_HARDWARE_ENCODER_NOT_AVAILABLE: 1094 return "hardware-encoder-not-available", true 1095 case RTCErrorDetailType_HARDWARE_ENCODER_ERROR: 1096 return "hardware-encoder-error", true 1097 default: 1098 return "", false 1099 } 1100 } 1101 1102 type RTCErrorInit struct { 1103 // ErrorDetail is "RTCErrorInit.errorDetail" 1104 // 1105 // Required 1106 ErrorDetail RTCErrorDetailType 1107 // SdpLineNumber is "RTCErrorInit.sdpLineNumber" 1108 // 1109 // Optional 1110 // 1111 // NOTE: FFI_USE_SdpLineNumber MUST be set to true to make this field effective. 1112 SdpLineNumber int32 1113 // SctpCauseCode is "RTCErrorInit.sctpCauseCode" 1114 // 1115 // Optional 1116 // 1117 // NOTE: FFI_USE_SctpCauseCode MUST be set to true to make this field effective. 1118 SctpCauseCode int32 1119 // ReceivedAlert is "RTCErrorInit.receivedAlert" 1120 // 1121 // Optional 1122 // 1123 // NOTE: FFI_USE_ReceivedAlert MUST be set to true to make this field effective. 1124 ReceivedAlert uint32 1125 // SentAlert is "RTCErrorInit.sentAlert" 1126 // 1127 // Optional 1128 // 1129 // NOTE: FFI_USE_SentAlert MUST be set to true to make this field effective. 1130 SentAlert uint32 1131 // HttpRequestStatusCode is "RTCErrorInit.httpRequestStatusCode" 1132 // 1133 // Optional 1134 // 1135 // NOTE: FFI_USE_HttpRequestStatusCode MUST be set to true to make this field effective. 1136 HttpRequestStatusCode int32 1137 1138 FFI_USE_SdpLineNumber bool // for SdpLineNumber. 1139 FFI_USE_SctpCauseCode bool // for SctpCauseCode. 1140 FFI_USE_ReceivedAlert bool // for ReceivedAlert. 1141 FFI_USE_SentAlert bool // for SentAlert. 1142 FFI_USE_HttpRequestStatusCode bool // for HttpRequestStatusCode. 1143 1144 FFI_USE bool 1145 } 1146 1147 // FromRef calls UpdateFrom and returns a RTCErrorInit with all fields set. 1148 func (p RTCErrorInit) FromRef(ref js.Ref) RTCErrorInit { 1149 p.UpdateFrom(ref) 1150 return p 1151 } 1152 1153 // New creates a new RTCErrorInit in the application heap. 1154 func (p RTCErrorInit) New() js.Ref { 1155 return bindings.RTCErrorInitJSLoad( 1156 js.Pointer(&p), js.True, 0, 1157 ) 1158 } 1159 1160 // UpdateFrom copies value of all fields of the heap object to p. 1161 func (p *RTCErrorInit) UpdateFrom(ref js.Ref) { 1162 bindings.RTCErrorInitJSStore( 1163 js.Pointer(p), ref, 1164 ) 1165 } 1166 1167 // Update writes all fields of the p to the heap object referenced by ref. 1168 func (p *RTCErrorInit) Update(ref js.Ref) { 1169 bindings.RTCErrorInitJSLoad( 1170 js.Pointer(p), js.False, ref, 1171 ) 1172 } 1173 1174 // FreeMembers frees fields with heap reference, if recursive is true 1175 // free all heap references reachable from p. 1176 func (p *RTCErrorInit) FreeMembers(recursive bool) { 1177 } 1178 1179 func NewRTCError(init RTCErrorInit, message js.String) (ret RTCError) { 1180 ret.ref = bindings.NewRTCErrorByRTCError( 1181 js.Pointer(&init), 1182 message.Ref()) 1183 return 1184 } 1185 1186 func NewRTCErrorByRTCError1(init RTCErrorInit) (ret RTCError) { 1187 ret.ref = bindings.NewRTCErrorByRTCError1( 1188 js.Pointer(&init)) 1189 return 1190 } 1191 1192 type RTCError struct { 1193 DOMException 1194 } 1195 1196 func (this RTCError) Once() RTCError { 1197 this.ref.Once() 1198 return this 1199 } 1200 1201 func (this RTCError) Ref() js.Ref { 1202 return this.DOMException.Ref() 1203 } 1204 1205 func (this RTCError) FromRef(ref js.Ref) RTCError { 1206 this.DOMException = this.DOMException.FromRef(ref) 1207 return this 1208 } 1209 1210 func (this RTCError) Free() { 1211 this.ref.Free() 1212 } 1213 1214 // ErrorDetail returns the value of property "RTCError.errorDetail". 1215 // 1216 // It returns ok=false if there is no such property. 1217 func (this RTCError) ErrorDetail() (ret RTCErrorDetailType, ok bool) { 1218 ok = js.True == bindings.GetRTCErrorErrorDetail( 1219 this.ref, js.Pointer(&ret), 1220 ) 1221 return 1222 } 1223 1224 // SdpLineNumber returns the value of property "RTCError.sdpLineNumber". 1225 // 1226 // It returns ok=false if there is no such property. 1227 func (this RTCError) SdpLineNumber() (ret int32, ok bool) { 1228 ok = js.True == bindings.GetRTCErrorSdpLineNumber( 1229 this.ref, js.Pointer(&ret), 1230 ) 1231 return 1232 } 1233 1234 // SctpCauseCode returns the value of property "RTCError.sctpCauseCode". 1235 // 1236 // It returns ok=false if there is no such property. 1237 func (this RTCError) SctpCauseCode() (ret int32, ok bool) { 1238 ok = js.True == bindings.GetRTCErrorSctpCauseCode( 1239 this.ref, js.Pointer(&ret), 1240 ) 1241 return 1242 } 1243 1244 // ReceivedAlert returns the value of property "RTCError.receivedAlert". 1245 // 1246 // It returns ok=false if there is no such property. 1247 func (this RTCError) ReceivedAlert() (ret uint32, ok bool) { 1248 ok = js.True == bindings.GetRTCErrorReceivedAlert( 1249 this.ref, js.Pointer(&ret), 1250 ) 1251 return 1252 } 1253 1254 // SentAlert returns the value of property "RTCError.sentAlert". 1255 // 1256 // It returns ok=false if there is no such property. 1257 func (this RTCError) SentAlert() (ret uint32, ok bool) { 1258 ok = js.True == bindings.GetRTCErrorSentAlert( 1259 this.ref, js.Pointer(&ret), 1260 ) 1261 return 1262 } 1263 1264 // HttpRequestStatusCode returns the value of property "RTCError.httpRequestStatusCode". 1265 // 1266 // It returns ok=false if there is no such property. 1267 func (this RTCError) HttpRequestStatusCode() (ret int32, ok bool) { 1268 ok = js.True == bindings.GetRTCErrorHttpRequestStatusCode( 1269 this.ref, js.Pointer(&ret), 1270 ) 1271 return 1272 } 1273 1274 type RTCErrorDetailTypeIdp uint32 1275 1276 const ( 1277 _ RTCErrorDetailTypeIdp = iota 1278 1279 RTCErrorDetailTypeIdp_IDP_BAD_SCRIPT_FAILURE 1280 RTCErrorDetailTypeIdp_IDP_EXECUTION_FAILURE 1281 RTCErrorDetailTypeIdp_IDP_LOAD_FAILURE 1282 RTCErrorDetailTypeIdp_IDP_NEED_LOGIN 1283 RTCErrorDetailTypeIdp_IDP_TIMEOUT 1284 RTCErrorDetailTypeIdp_IDP_TLS_FAILURE 1285 RTCErrorDetailTypeIdp_IDP_TOKEN_EXPIRED 1286 RTCErrorDetailTypeIdp_IDP_TOKEN_INVALID 1287 ) 1288 1289 func (RTCErrorDetailTypeIdp) FromRef(str js.Ref) RTCErrorDetailTypeIdp { 1290 return RTCErrorDetailTypeIdp(bindings.ConstOfRTCErrorDetailTypeIdp(str)) 1291 } 1292 1293 func (x RTCErrorDetailTypeIdp) String() (string, bool) { 1294 switch x { 1295 case RTCErrorDetailTypeIdp_IDP_BAD_SCRIPT_FAILURE: 1296 return "idp-bad-script-failure", true 1297 case RTCErrorDetailTypeIdp_IDP_EXECUTION_FAILURE: 1298 return "idp-execution-failure", true 1299 case RTCErrorDetailTypeIdp_IDP_LOAD_FAILURE: 1300 return "idp-load-failure", true 1301 case RTCErrorDetailTypeIdp_IDP_NEED_LOGIN: 1302 return "idp-need-login", true 1303 case RTCErrorDetailTypeIdp_IDP_TIMEOUT: 1304 return "idp-timeout", true 1305 case RTCErrorDetailTypeIdp_IDP_TLS_FAILURE: 1306 return "idp-tls-failure", true 1307 case RTCErrorDetailTypeIdp_IDP_TOKEN_EXPIRED: 1308 return "idp-token-expired", true 1309 case RTCErrorDetailTypeIdp_IDP_TOKEN_INVALID: 1310 return "idp-token-invalid", true 1311 default: 1312 return "", false 1313 } 1314 } 1315 1316 type RTCErrorEventInit struct { 1317 // Error is "RTCErrorEventInit.error" 1318 // 1319 // Required 1320 Error RTCError 1321 // Bubbles is "RTCErrorEventInit.bubbles" 1322 // 1323 // Optional, defaults to false. 1324 // 1325 // NOTE: FFI_USE_Bubbles MUST be set to true to make this field effective. 1326 Bubbles bool 1327 // Cancelable is "RTCErrorEventInit.cancelable" 1328 // 1329 // Optional, defaults to false. 1330 // 1331 // NOTE: FFI_USE_Cancelable MUST be set to true to make this field effective. 1332 Cancelable bool 1333 // Composed is "RTCErrorEventInit.composed" 1334 // 1335 // Optional, defaults to false. 1336 // 1337 // NOTE: FFI_USE_Composed MUST be set to true to make this field effective. 1338 Composed bool 1339 1340 FFI_USE_Bubbles bool // for Bubbles. 1341 FFI_USE_Cancelable bool // for Cancelable. 1342 FFI_USE_Composed bool // for Composed. 1343 1344 FFI_USE bool 1345 } 1346 1347 // FromRef calls UpdateFrom and returns a RTCErrorEventInit with all fields set. 1348 func (p RTCErrorEventInit) FromRef(ref js.Ref) RTCErrorEventInit { 1349 p.UpdateFrom(ref) 1350 return p 1351 } 1352 1353 // New creates a new RTCErrorEventInit in the application heap. 1354 func (p RTCErrorEventInit) New() js.Ref { 1355 return bindings.RTCErrorEventInitJSLoad( 1356 js.Pointer(&p), js.True, 0, 1357 ) 1358 } 1359 1360 // UpdateFrom copies value of all fields of the heap object to p. 1361 func (p *RTCErrorEventInit) UpdateFrom(ref js.Ref) { 1362 bindings.RTCErrorEventInitJSStore( 1363 js.Pointer(p), ref, 1364 ) 1365 } 1366 1367 // Update writes all fields of the p to the heap object referenced by ref. 1368 func (p *RTCErrorEventInit) Update(ref js.Ref) { 1369 bindings.RTCErrorEventInitJSLoad( 1370 js.Pointer(p), js.False, ref, 1371 ) 1372 } 1373 1374 // FreeMembers frees fields with heap reference, if recursive is true 1375 // free all heap references reachable from p. 1376 func (p *RTCErrorEventInit) FreeMembers(recursive bool) { 1377 js.Free( 1378 p.Error.Ref(), 1379 ) 1380 p.Error = p.Error.FromRef(js.Undefined) 1381 } 1382 1383 func NewRTCErrorEvent(typ js.String, eventInitDict RTCErrorEventInit) (ret RTCErrorEvent) { 1384 ret.ref = bindings.NewRTCErrorEventByRTCErrorEvent( 1385 typ.Ref(), 1386 js.Pointer(&eventInitDict)) 1387 return 1388 } 1389 1390 type RTCErrorEvent struct { 1391 Event 1392 } 1393 1394 func (this RTCErrorEvent) Once() RTCErrorEvent { 1395 this.ref.Once() 1396 return this 1397 } 1398 1399 func (this RTCErrorEvent) Ref() js.Ref { 1400 return this.Event.Ref() 1401 } 1402 1403 func (this RTCErrorEvent) FromRef(ref js.Ref) RTCErrorEvent { 1404 this.Event = this.Event.FromRef(ref) 1405 return this 1406 } 1407 1408 func (this RTCErrorEvent) Free() { 1409 this.ref.Free() 1410 } 1411 1412 // Error returns the value of property "RTCErrorEvent.error". 1413 // 1414 // It returns ok=false if there is no such property. 1415 func (this RTCErrorEvent) Error() (ret RTCError, ok bool) { 1416 ok = js.True == bindings.GetRTCErrorEventError( 1417 this.ref, js.Pointer(&ret), 1418 ) 1419 return 1420 } 1421 1422 type RTCStatsIceCandidatePairState uint32 1423 1424 const ( 1425 _ RTCStatsIceCandidatePairState = iota 1426 1427 RTCStatsIceCandidatePairState_FROZEN 1428 RTCStatsIceCandidatePairState_WAITING 1429 RTCStatsIceCandidatePairState_IN_PROGRESS 1430 RTCStatsIceCandidatePairState_FAILED 1431 RTCStatsIceCandidatePairState_SUCCEEDED 1432 ) 1433 1434 func (RTCStatsIceCandidatePairState) FromRef(str js.Ref) RTCStatsIceCandidatePairState { 1435 return RTCStatsIceCandidatePairState(bindings.ConstOfRTCStatsIceCandidatePairState(str)) 1436 } 1437 1438 func (x RTCStatsIceCandidatePairState) String() (string, bool) { 1439 switch x { 1440 case RTCStatsIceCandidatePairState_FROZEN: 1441 return "frozen", true 1442 case RTCStatsIceCandidatePairState_WAITING: 1443 return "waiting", true 1444 case RTCStatsIceCandidatePairState_IN_PROGRESS: 1445 return "in-progress", true 1446 case RTCStatsIceCandidatePairState_FAILED: 1447 return "failed", true 1448 case RTCStatsIceCandidatePairState_SUCCEEDED: 1449 return "succeeded", true 1450 default: 1451 return "", false 1452 } 1453 } 1454 1455 type RTCIceCandidatePairStats struct { 1456 // TransportId is "RTCIceCandidatePairStats.transportId" 1457 // 1458 // Required 1459 TransportId js.String 1460 // LocalCandidateId is "RTCIceCandidatePairStats.localCandidateId" 1461 // 1462 // Required 1463 LocalCandidateId js.String 1464 // RemoteCandidateId is "RTCIceCandidatePairStats.remoteCandidateId" 1465 // 1466 // Required 1467 RemoteCandidateId js.String 1468 // State is "RTCIceCandidatePairStats.state" 1469 // 1470 // Required 1471 State RTCStatsIceCandidatePairState 1472 // Nominated is "RTCIceCandidatePairStats.nominated" 1473 // 1474 // Optional 1475 // 1476 // NOTE: FFI_USE_Nominated MUST be set to true to make this field effective. 1477 Nominated bool 1478 // PacketsSent is "RTCIceCandidatePairStats.packetsSent" 1479 // 1480 // Optional 1481 // 1482 // NOTE: FFI_USE_PacketsSent MUST be set to true to make this field effective. 1483 PacketsSent uint64 1484 // PacketsReceived is "RTCIceCandidatePairStats.packetsReceived" 1485 // 1486 // Optional 1487 // 1488 // NOTE: FFI_USE_PacketsReceived MUST be set to true to make this field effective. 1489 PacketsReceived uint64 1490 // BytesSent is "RTCIceCandidatePairStats.bytesSent" 1491 // 1492 // Optional 1493 // 1494 // NOTE: FFI_USE_BytesSent MUST be set to true to make this field effective. 1495 BytesSent uint64 1496 // BytesReceived is "RTCIceCandidatePairStats.bytesReceived" 1497 // 1498 // Optional 1499 // 1500 // NOTE: FFI_USE_BytesReceived MUST be set to true to make this field effective. 1501 BytesReceived uint64 1502 // LastPacketSentTimestamp is "RTCIceCandidatePairStats.lastPacketSentTimestamp" 1503 // 1504 // Optional 1505 // 1506 // NOTE: FFI_USE_LastPacketSentTimestamp MUST be set to true to make this field effective. 1507 LastPacketSentTimestamp DOMHighResTimeStamp 1508 // LastPacketReceivedTimestamp is "RTCIceCandidatePairStats.lastPacketReceivedTimestamp" 1509 // 1510 // Optional 1511 // 1512 // NOTE: FFI_USE_LastPacketReceivedTimestamp MUST be set to true to make this field effective. 1513 LastPacketReceivedTimestamp DOMHighResTimeStamp 1514 // TotalRoundTripTime is "RTCIceCandidatePairStats.totalRoundTripTime" 1515 // 1516 // Optional 1517 // 1518 // NOTE: FFI_USE_TotalRoundTripTime MUST be set to true to make this field effective. 1519 TotalRoundTripTime float64 1520 // CurrentRoundTripTime is "RTCIceCandidatePairStats.currentRoundTripTime" 1521 // 1522 // Optional 1523 // 1524 // NOTE: FFI_USE_CurrentRoundTripTime MUST be set to true to make this field effective. 1525 CurrentRoundTripTime float64 1526 // AvailableOutgoingBitrate is "RTCIceCandidatePairStats.availableOutgoingBitrate" 1527 // 1528 // Optional 1529 // 1530 // NOTE: FFI_USE_AvailableOutgoingBitrate MUST be set to true to make this field effective. 1531 AvailableOutgoingBitrate float64 1532 // AvailableIncomingBitrate is "RTCIceCandidatePairStats.availableIncomingBitrate" 1533 // 1534 // Optional 1535 // 1536 // NOTE: FFI_USE_AvailableIncomingBitrate MUST be set to true to make this field effective. 1537 AvailableIncomingBitrate float64 1538 // RequestsReceived is "RTCIceCandidatePairStats.requestsReceived" 1539 // 1540 // Optional 1541 // 1542 // NOTE: FFI_USE_RequestsReceived MUST be set to true to make this field effective. 1543 RequestsReceived uint64 1544 // RequestsSent is "RTCIceCandidatePairStats.requestsSent" 1545 // 1546 // Optional 1547 // 1548 // NOTE: FFI_USE_RequestsSent MUST be set to true to make this field effective. 1549 RequestsSent uint64 1550 // ResponsesReceived is "RTCIceCandidatePairStats.responsesReceived" 1551 // 1552 // Optional 1553 // 1554 // NOTE: FFI_USE_ResponsesReceived MUST be set to true to make this field effective. 1555 ResponsesReceived uint64 1556 // ResponsesSent is "RTCIceCandidatePairStats.responsesSent" 1557 // 1558 // Optional 1559 // 1560 // NOTE: FFI_USE_ResponsesSent MUST be set to true to make this field effective. 1561 ResponsesSent uint64 1562 // ConsentRequestsSent is "RTCIceCandidatePairStats.consentRequestsSent" 1563 // 1564 // Optional 1565 // 1566 // NOTE: FFI_USE_ConsentRequestsSent MUST be set to true to make this field effective. 1567 ConsentRequestsSent uint64 1568 // PacketsDiscardedOnSend is "RTCIceCandidatePairStats.packetsDiscardedOnSend" 1569 // 1570 // Optional 1571 // 1572 // NOTE: FFI_USE_PacketsDiscardedOnSend MUST be set to true to make this field effective. 1573 PacketsDiscardedOnSend uint32 1574 // BytesDiscardedOnSend is "RTCIceCandidatePairStats.bytesDiscardedOnSend" 1575 // 1576 // Optional 1577 // 1578 // NOTE: FFI_USE_BytesDiscardedOnSend MUST be set to true to make this field effective. 1579 BytesDiscardedOnSend uint64 1580 // Timestamp is "RTCIceCandidatePairStats.timestamp" 1581 // 1582 // Required 1583 Timestamp DOMHighResTimeStamp 1584 // Type is "RTCIceCandidatePairStats.type" 1585 // 1586 // Required 1587 Type RTCStatsType 1588 // Id is "RTCIceCandidatePairStats.id" 1589 // 1590 // Required 1591 Id js.String 1592 1593 FFI_USE_Nominated bool // for Nominated. 1594 FFI_USE_PacketsSent bool // for PacketsSent. 1595 FFI_USE_PacketsReceived bool // for PacketsReceived. 1596 FFI_USE_BytesSent bool // for BytesSent. 1597 FFI_USE_BytesReceived bool // for BytesReceived. 1598 FFI_USE_LastPacketSentTimestamp bool // for LastPacketSentTimestamp. 1599 FFI_USE_LastPacketReceivedTimestamp bool // for LastPacketReceivedTimestamp. 1600 FFI_USE_TotalRoundTripTime bool // for TotalRoundTripTime. 1601 FFI_USE_CurrentRoundTripTime bool // for CurrentRoundTripTime. 1602 FFI_USE_AvailableOutgoingBitrate bool // for AvailableOutgoingBitrate. 1603 FFI_USE_AvailableIncomingBitrate bool // for AvailableIncomingBitrate. 1604 FFI_USE_RequestsReceived bool // for RequestsReceived. 1605 FFI_USE_RequestsSent bool // for RequestsSent. 1606 FFI_USE_ResponsesReceived bool // for ResponsesReceived. 1607 FFI_USE_ResponsesSent bool // for ResponsesSent. 1608 FFI_USE_ConsentRequestsSent bool // for ConsentRequestsSent. 1609 FFI_USE_PacketsDiscardedOnSend bool // for PacketsDiscardedOnSend. 1610 FFI_USE_BytesDiscardedOnSend bool // for BytesDiscardedOnSend. 1611 1612 FFI_USE bool 1613 } 1614 1615 // FromRef calls UpdateFrom and returns a RTCIceCandidatePairStats with all fields set. 1616 func (p RTCIceCandidatePairStats) FromRef(ref js.Ref) RTCIceCandidatePairStats { 1617 p.UpdateFrom(ref) 1618 return p 1619 } 1620 1621 // New creates a new RTCIceCandidatePairStats in the application heap. 1622 func (p RTCIceCandidatePairStats) New() js.Ref { 1623 return bindings.RTCIceCandidatePairStatsJSLoad( 1624 js.Pointer(&p), js.True, 0, 1625 ) 1626 } 1627 1628 // UpdateFrom copies value of all fields of the heap object to p. 1629 func (p *RTCIceCandidatePairStats) UpdateFrom(ref js.Ref) { 1630 bindings.RTCIceCandidatePairStatsJSStore( 1631 js.Pointer(p), ref, 1632 ) 1633 } 1634 1635 // Update writes all fields of the p to the heap object referenced by ref. 1636 func (p *RTCIceCandidatePairStats) Update(ref js.Ref) { 1637 bindings.RTCIceCandidatePairStatsJSLoad( 1638 js.Pointer(p), js.False, ref, 1639 ) 1640 } 1641 1642 // FreeMembers frees fields with heap reference, if recursive is true 1643 // free all heap references reachable from p. 1644 func (p *RTCIceCandidatePairStats) FreeMembers(recursive bool) { 1645 js.Free( 1646 p.TransportId.Ref(), 1647 p.LocalCandidateId.Ref(), 1648 p.RemoteCandidateId.Ref(), 1649 p.Id.Ref(), 1650 ) 1651 p.TransportId = p.TransportId.FromRef(js.Undefined) 1652 p.LocalCandidateId = p.LocalCandidateId.FromRef(js.Undefined) 1653 p.RemoteCandidateId = p.RemoteCandidateId.FromRef(js.Undefined) 1654 p.Id = p.Id.FromRef(js.Undefined) 1655 } 1656 1657 type RTCIceCandidateStats struct { 1658 // TransportId is "RTCIceCandidateStats.transportId" 1659 // 1660 // Required 1661 TransportId js.String 1662 // Address is "RTCIceCandidateStats.address" 1663 // 1664 // Optional 1665 Address js.String 1666 // Port is "RTCIceCandidateStats.port" 1667 // 1668 // Optional 1669 // 1670 // NOTE: FFI_USE_Port MUST be set to true to make this field effective. 1671 Port int32 1672 // Protocol is "RTCIceCandidateStats.protocol" 1673 // 1674 // Optional 1675 Protocol js.String 1676 // CandidateType is "RTCIceCandidateStats.candidateType" 1677 // 1678 // Required 1679 CandidateType RTCIceCandidateType 1680 // Priority is "RTCIceCandidateStats.priority" 1681 // 1682 // Optional 1683 // 1684 // NOTE: FFI_USE_Priority MUST be set to true to make this field effective. 1685 Priority int32 1686 // Url is "RTCIceCandidateStats.url" 1687 // 1688 // Optional 1689 Url js.String 1690 // RelayProtocol is "RTCIceCandidateStats.relayProtocol" 1691 // 1692 // Optional 1693 RelayProtocol RTCIceServerTransportProtocol 1694 // Foundation is "RTCIceCandidateStats.foundation" 1695 // 1696 // Optional 1697 Foundation js.String 1698 // RelatedAddress is "RTCIceCandidateStats.relatedAddress" 1699 // 1700 // Optional 1701 RelatedAddress js.String 1702 // RelatedPort is "RTCIceCandidateStats.relatedPort" 1703 // 1704 // Optional 1705 // 1706 // NOTE: FFI_USE_RelatedPort MUST be set to true to make this field effective. 1707 RelatedPort int32 1708 // UsernameFragment is "RTCIceCandidateStats.usernameFragment" 1709 // 1710 // Optional 1711 UsernameFragment js.String 1712 // TcpType is "RTCIceCandidateStats.tcpType" 1713 // 1714 // Optional 1715 TcpType RTCIceTcpCandidateType 1716 // Timestamp is "RTCIceCandidateStats.timestamp" 1717 // 1718 // Required 1719 Timestamp DOMHighResTimeStamp 1720 // Type is "RTCIceCandidateStats.type" 1721 // 1722 // Required 1723 Type RTCStatsType 1724 // Id is "RTCIceCandidateStats.id" 1725 // 1726 // Required 1727 Id js.String 1728 1729 FFI_USE_Port bool // for Port. 1730 FFI_USE_Priority bool // for Priority. 1731 FFI_USE_RelatedPort bool // for RelatedPort. 1732 1733 FFI_USE bool 1734 } 1735 1736 // FromRef calls UpdateFrom and returns a RTCIceCandidateStats with all fields set. 1737 func (p RTCIceCandidateStats) FromRef(ref js.Ref) RTCIceCandidateStats { 1738 p.UpdateFrom(ref) 1739 return p 1740 } 1741 1742 // New creates a new RTCIceCandidateStats in the application heap. 1743 func (p RTCIceCandidateStats) New() js.Ref { 1744 return bindings.RTCIceCandidateStatsJSLoad( 1745 js.Pointer(&p), js.True, 0, 1746 ) 1747 } 1748 1749 // UpdateFrom copies value of all fields of the heap object to p. 1750 func (p *RTCIceCandidateStats) UpdateFrom(ref js.Ref) { 1751 bindings.RTCIceCandidateStatsJSStore( 1752 js.Pointer(p), ref, 1753 ) 1754 } 1755 1756 // Update writes all fields of the p to the heap object referenced by ref. 1757 func (p *RTCIceCandidateStats) Update(ref js.Ref) { 1758 bindings.RTCIceCandidateStatsJSLoad( 1759 js.Pointer(p), js.False, ref, 1760 ) 1761 } 1762 1763 // FreeMembers frees fields with heap reference, if recursive is true 1764 // free all heap references reachable from p. 1765 func (p *RTCIceCandidateStats) FreeMembers(recursive bool) { 1766 js.Free( 1767 p.TransportId.Ref(), 1768 p.Address.Ref(), 1769 p.Protocol.Ref(), 1770 p.Url.Ref(), 1771 p.Foundation.Ref(), 1772 p.RelatedAddress.Ref(), 1773 p.UsernameFragment.Ref(), 1774 p.Id.Ref(), 1775 ) 1776 p.TransportId = p.TransportId.FromRef(js.Undefined) 1777 p.Address = p.Address.FromRef(js.Undefined) 1778 p.Protocol = p.Protocol.FromRef(js.Undefined) 1779 p.Url = p.Url.FromRef(js.Undefined) 1780 p.Foundation = p.Foundation.FromRef(js.Undefined) 1781 p.RelatedAddress = p.RelatedAddress.FromRef(js.Undefined) 1782 p.UsernameFragment = p.UsernameFragment.FromRef(js.Undefined) 1783 p.Id = p.Id.FromRef(js.Undefined) 1784 } 1785 1786 type RTCIceConnectionState uint32 1787 1788 const ( 1789 _ RTCIceConnectionState = iota 1790 1791 RTCIceConnectionState_CLOSED 1792 RTCIceConnectionState_FAILED 1793 RTCIceConnectionState_DISCONNECTED 1794 RTCIceConnectionState_NEW 1795 RTCIceConnectionState_CHECKING 1796 RTCIceConnectionState_COMPLETED 1797 RTCIceConnectionState_CONNECTED 1798 ) 1799 1800 func (RTCIceConnectionState) FromRef(str js.Ref) RTCIceConnectionState { 1801 return RTCIceConnectionState(bindings.ConstOfRTCIceConnectionState(str)) 1802 } 1803 1804 func (x RTCIceConnectionState) String() (string, bool) { 1805 switch x { 1806 case RTCIceConnectionState_CLOSED: 1807 return "closed", true 1808 case RTCIceConnectionState_FAILED: 1809 return "failed", true 1810 case RTCIceConnectionState_DISCONNECTED: 1811 return "disconnected", true 1812 case RTCIceConnectionState_NEW: 1813 return "new", true 1814 case RTCIceConnectionState_CHECKING: 1815 return "checking", true 1816 case RTCIceConnectionState_COMPLETED: 1817 return "completed", true 1818 case RTCIceConnectionState_CONNECTED: 1819 return "connected", true 1820 default: 1821 return "", false 1822 } 1823 } 1824 1825 type RTCIceGatheringState uint32 1826 1827 const ( 1828 _ RTCIceGatheringState = iota 1829 1830 RTCIceGatheringState_NEW 1831 RTCIceGatheringState_GATHERING 1832 RTCIceGatheringState_COMPLETE 1833 ) 1834 1835 func (RTCIceGatheringState) FromRef(str js.Ref) RTCIceGatheringState { 1836 return RTCIceGatheringState(bindings.ConstOfRTCIceGatheringState(str)) 1837 } 1838 1839 func (x RTCIceGatheringState) String() (string, bool) { 1840 switch x { 1841 case RTCIceGatheringState_NEW: 1842 return "new", true 1843 case RTCIceGatheringState_GATHERING: 1844 return "gathering", true 1845 case RTCIceGatheringState_COMPLETE: 1846 return "complete", true 1847 default: 1848 return "", false 1849 } 1850 } 1851 1852 func NewRTCIdentityAssertion(idp js.String, name js.String) (ret RTCIdentityAssertion) { 1853 ret.ref = bindings.NewRTCIdentityAssertionByRTCIdentityAssertion( 1854 idp.Ref(), 1855 name.Ref()) 1856 return 1857 } 1858 1859 type RTCIdentityAssertion struct { 1860 ref js.Ref 1861 } 1862 1863 func (this RTCIdentityAssertion) Once() RTCIdentityAssertion { 1864 this.ref.Once() 1865 return this 1866 } 1867 1868 func (this RTCIdentityAssertion) Ref() js.Ref { 1869 return this.ref 1870 } 1871 1872 func (this RTCIdentityAssertion) FromRef(ref js.Ref) RTCIdentityAssertion { 1873 this.ref = ref 1874 return this 1875 } 1876 1877 func (this RTCIdentityAssertion) Free() { 1878 this.ref.Free() 1879 } 1880 1881 // Idp returns the value of property "RTCIdentityAssertion.idp". 1882 // 1883 // It returns ok=false if there is no such property. 1884 func (this RTCIdentityAssertion) Idp() (ret js.String, ok bool) { 1885 ok = js.True == bindings.GetRTCIdentityAssertionIdp( 1886 this.ref, js.Pointer(&ret), 1887 ) 1888 return 1889 } 1890 1891 // SetIdp sets the value of property "RTCIdentityAssertion.idp" to val. 1892 // 1893 // It returns false if the property cannot be set. 1894 func (this RTCIdentityAssertion) SetIdp(val js.String) bool { 1895 return js.True == bindings.SetRTCIdentityAssertionIdp( 1896 this.ref, 1897 val.Ref(), 1898 ) 1899 } 1900 1901 // Name returns the value of property "RTCIdentityAssertion.name". 1902 // 1903 // It returns ok=false if there is no such property. 1904 func (this RTCIdentityAssertion) Name() (ret js.String, ok bool) { 1905 ok = js.True == bindings.GetRTCIdentityAssertionName( 1906 this.ref, js.Pointer(&ret), 1907 ) 1908 return 1909 } 1910 1911 // SetName sets the value of property "RTCIdentityAssertion.name" to val. 1912 // 1913 // It returns false if the property cannot be set. 1914 func (this RTCIdentityAssertion) SetName(val js.String) bool { 1915 return js.True == bindings.SetRTCIdentityAssertionName( 1916 this.ref, 1917 val.Ref(), 1918 ) 1919 } 1920 1921 type ValidateAssertionCallbackFunc func(this js.Ref, assertion js.String, origin js.String) js.Ref 1922 1923 func (fn ValidateAssertionCallbackFunc) Register() js.Func[func(assertion js.String, origin js.String) js.Promise[RTCIdentityValidationResult]] { 1924 return js.RegisterCallback[func(assertion js.String, origin js.String) js.Promise[RTCIdentityValidationResult]]( 1925 fn, abi.FuncPCABIInternal(fn), 1926 ) 1927 } 1928 1929 func (fn ValidateAssertionCallbackFunc) DispatchCallback( 1930 targetPC uintptr, ctx *js.CallbackContext, 1931 ) { 1932 args := ctx.Args() 1933 if len(args) != 2+1 /* js this */ || 1934 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 1935 js.ThrowInvalidCallbackInvocation() 1936 } 1937 1938 if ctx.Return(fn( 1939 args[0], 1940 1941 js.String{}.FromRef(args[0+1]), 1942 js.String{}.FromRef(args[1+1]), 1943 )) { 1944 return 1945 } 1946 1947 js.ThrowCallbackValueNotReturned() 1948 } 1949 1950 type ValidateAssertionCallback[T any] struct { 1951 Fn func(arg T, this js.Ref, assertion js.String, origin js.String) js.Ref 1952 Arg T 1953 } 1954 1955 func (cb *ValidateAssertionCallback[T]) Register() js.Func[func(assertion js.String, origin js.String) js.Promise[RTCIdentityValidationResult]] { 1956 return js.RegisterCallback[func(assertion js.String, origin js.String) js.Promise[RTCIdentityValidationResult]]( 1957 cb, abi.FuncPCABIInternal(cb.Fn), 1958 ) 1959 } 1960 1961 func (cb *ValidateAssertionCallback[T]) DispatchCallback( 1962 targetPC uintptr, ctx *js.CallbackContext, 1963 ) { 1964 args := ctx.Args() 1965 if len(args) != 2+1 /* js this */ || 1966 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 1967 js.ThrowInvalidCallbackInvocation() 1968 } 1969 1970 if ctx.Return(cb.Fn( 1971 cb.Arg, 1972 args[0], 1973 1974 js.String{}.FromRef(args[0+1]), 1975 js.String{}.FromRef(args[1+1]), 1976 )) { 1977 return 1978 } 1979 1980 js.ThrowCallbackValueNotReturned() 1981 } 1982 1983 type RTCIdentityValidationResult struct { 1984 // Identity is "RTCIdentityValidationResult.identity" 1985 // 1986 // Required 1987 Identity js.String 1988 // Contents is "RTCIdentityValidationResult.contents" 1989 // 1990 // Required 1991 Contents js.String 1992 1993 FFI_USE bool 1994 } 1995 1996 // FromRef calls UpdateFrom and returns a RTCIdentityValidationResult with all fields set. 1997 func (p RTCIdentityValidationResult) FromRef(ref js.Ref) RTCIdentityValidationResult { 1998 p.UpdateFrom(ref) 1999 return p 2000 } 2001 2002 // New creates a new RTCIdentityValidationResult in the application heap. 2003 func (p RTCIdentityValidationResult) New() js.Ref { 2004 return bindings.RTCIdentityValidationResultJSLoad( 2005 js.Pointer(&p), js.True, 0, 2006 ) 2007 } 2008 2009 // UpdateFrom copies value of all fields of the heap object to p. 2010 func (p *RTCIdentityValidationResult) UpdateFrom(ref js.Ref) { 2011 bindings.RTCIdentityValidationResultJSStore( 2012 js.Pointer(p), ref, 2013 ) 2014 } 2015 2016 // Update writes all fields of the p to the heap object referenced by ref. 2017 func (p *RTCIdentityValidationResult) Update(ref js.Ref) { 2018 bindings.RTCIdentityValidationResultJSLoad( 2019 js.Pointer(p), js.False, ref, 2020 ) 2021 } 2022 2023 // FreeMembers frees fields with heap reference, if recursive is true 2024 // free all heap references reachable from p. 2025 func (p *RTCIdentityValidationResult) FreeMembers(recursive bool) { 2026 js.Free( 2027 p.Identity.Ref(), 2028 p.Contents.Ref(), 2029 ) 2030 p.Identity = p.Identity.FromRef(js.Undefined) 2031 p.Contents = p.Contents.FromRef(js.Undefined) 2032 } 2033 2034 type RTCIdentityProvider struct { 2035 // GenerateAssertion is "RTCIdentityProvider.generateAssertion" 2036 // 2037 // Required 2038 GenerateAssertion js.Func[func(contents js.String, origin js.String, options *RTCIdentityProviderOptions) js.Promise[RTCIdentityAssertionResult]] 2039 // ValidateAssertion is "RTCIdentityProvider.validateAssertion" 2040 // 2041 // Required 2042 ValidateAssertion js.Func[func(assertion js.String, origin js.String) js.Promise[RTCIdentityValidationResult]] 2043 2044 FFI_USE bool 2045 } 2046 2047 // FromRef calls UpdateFrom and returns a RTCIdentityProvider with all fields set. 2048 func (p RTCIdentityProvider) FromRef(ref js.Ref) RTCIdentityProvider { 2049 p.UpdateFrom(ref) 2050 return p 2051 } 2052 2053 // New creates a new RTCIdentityProvider in the application heap. 2054 func (p RTCIdentityProvider) New() js.Ref { 2055 return bindings.RTCIdentityProviderJSLoad( 2056 js.Pointer(&p), js.True, 0, 2057 ) 2058 } 2059 2060 // UpdateFrom copies value of all fields of the heap object to p. 2061 func (p *RTCIdentityProvider) UpdateFrom(ref js.Ref) { 2062 bindings.RTCIdentityProviderJSStore( 2063 js.Pointer(p), ref, 2064 ) 2065 } 2066 2067 // Update writes all fields of the p to the heap object referenced by ref. 2068 func (p *RTCIdentityProvider) Update(ref js.Ref) { 2069 bindings.RTCIdentityProviderJSLoad( 2070 js.Pointer(p), js.False, ref, 2071 ) 2072 } 2073 2074 // FreeMembers frees fields with heap reference, if recursive is true 2075 // free all heap references reachable from p. 2076 func (p *RTCIdentityProvider) FreeMembers(recursive bool) { 2077 js.Free( 2078 p.GenerateAssertion.Ref(), 2079 p.ValidateAssertion.Ref(), 2080 ) 2081 p.GenerateAssertion = p.GenerateAssertion.FromRef(js.Undefined) 2082 p.ValidateAssertion = p.ValidateAssertion.FromRef(js.Undefined) 2083 } 2084 2085 type RTCIdentityProviderRegistrar struct { 2086 ref js.Ref 2087 } 2088 2089 func (this RTCIdentityProviderRegistrar) Once() RTCIdentityProviderRegistrar { 2090 this.ref.Once() 2091 return this 2092 } 2093 2094 func (this RTCIdentityProviderRegistrar) Ref() js.Ref { 2095 return this.ref 2096 } 2097 2098 func (this RTCIdentityProviderRegistrar) FromRef(ref js.Ref) RTCIdentityProviderRegistrar { 2099 this.ref = ref 2100 return this 2101 } 2102 2103 func (this RTCIdentityProviderRegistrar) Free() { 2104 this.ref.Free() 2105 } 2106 2107 // HasFuncRegister returns true if the method "RTCIdentityProviderRegistrar.register" exists. 2108 func (this RTCIdentityProviderRegistrar) HasFuncRegister() bool { 2109 return js.True == bindings.HasFuncRTCIdentityProviderRegistrarRegister( 2110 this.ref, 2111 ) 2112 } 2113 2114 // FuncRegister returns the method "RTCIdentityProviderRegistrar.register". 2115 func (this RTCIdentityProviderRegistrar) FuncRegister() (fn js.Func[func(idp RTCIdentityProvider)]) { 2116 bindings.FuncRTCIdentityProviderRegistrarRegister( 2117 this.ref, js.Pointer(&fn), 2118 ) 2119 return 2120 } 2121 2122 // Register calls the method "RTCIdentityProviderRegistrar.register". 2123 func (this RTCIdentityProviderRegistrar) Register(idp RTCIdentityProvider) (ret js.Void) { 2124 bindings.CallRTCIdentityProviderRegistrarRegister( 2125 this.ref, js.Pointer(&ret), 2126 js.Pointer(&idp), 2127 ) 2128 2129 return 2130 } 2131 2132 // TryRegister calls the method "RTCIdentityProviderRegistrar.register" 2133 // in a try/catch block and returns (_, err, ok = false) when it went through 2134 // the catch clause. 2135 func (this RTCIdentityProviderRegistrar) TryRegister(idp RTCIdentityProvider) (ret js.Void, exception js.Any, ok bool) { 2136 ok = js.True == bindings.TryRTCIdentityProviderRegistrarRegister( 2137 this.ref, js.Pointer(&ret), js.Pointer(&exception), 2138 js.Pointer(&idp), 2139 ) 2140 2141 return 2142 } 2143 2144 type RTCIdentityProviderGlobalScope struct { 2145 WorkerGlobalScope 2146 } 2147 2148 func (this RTCIdentityProviderGlobalScope) Once() RTCIdentityProviderGlobalScope { 2149 this.ref.Once() 2150 return this 2151 } 2152 2153 func (this RTCIdentityProviderGlobalScope) Ref() js.Ref { 2154 return this.WorkerGlobalScope.Ref() 2155 } 2156 2157 func (this RTCIdentityProviderGlobalScope) FromRef(ref js.Ref) RTCIdentityProviderGlobalScope { 2158 this.WorkerGlobalScope = this.WorkerGlobalScope.FromRef(ref) 2159 return this 2160 } 2161 2162 func (this RTCIdentityProviderGlobalScope) Free() { 2163 this.ref.Free() 2164 } 2165 2166 // RtcIdentityProvider returns the value of property "RTCIdentityProviderGlobalScope.rtcIdentityProvider". 2167 // 2168 // It returns ok=false if there is no such property. 2169 func (this RTCIdentityProviderGlobalScope) RtcIdentityProvider() (ret RTCIdentityProviderRegistrar, ok bool) { 2170 ok = js.True == bindings.GetRTCIdentityProviderGlobalScopeRtcIdentityProvider( 2171 this.ref, js.Pointer(&ret), 2172 ) 2173 return 2174 } 2175 2176 type RTCInboundRtpStreamStats struct { 2177 // TrackIdentifier is "RTCInboundRtpStreamStats.trackIdentifier" 2178 // 2179 // Required 2180 TrackIdentifier js.String 2181 // Mid is "RTCInboundRtpStreamStats.mid" 2182 // 2183 // Optional 2184 Mid js.String 2185 // RemoteId is "RTCInboundRtpStreamStats.remoteId" 2186 // 2187 // Optional 2188 RemoteId js.String 2189 // FramesDecoded is "RTCInboundRtpStreamStats.framesDecoded" 2190 // 2191 // Optional 2192 // 2193 // NOTE: FFI_USE_FramesDecoded MUST be set to true to make this field effective. 2194 FramesDecoded uint32 2195 // KeyFramesDecoded is "RTCInboundRtpStreamStats.keyFramesDecoded" 2196 // 2197 // Optional 2198 // 2199 // NOTE: FFI_USE_KeyFramesDecoded MUST be set to true to make this field effective. 2200 KeyFramesDecoded uint32 2201 // FramesRendered is "RTCInboundRtpStreamStats.framesRendered" 2202 // 2203 // Optional 2204 // 2205 // NOTE: FFI_USE_FramesRendered MUST be set to true to make this field effective. 2206 FramesRendered uint32 2207 // FramesDropped is "RTCInboundRtpStreamStats.framesDropped" 2208 // 2209 // Optional 2210 // 2211 // NOTE: FFI_USE_FramesDropped MUST be set to true to make this field effective. 2212 FramesDropped uint32 2213 // FrameWidth is "RTCInboundRtpStreamStats.frameWidth" 2214 // 2215 // Optional 2216 // 2217 // NOTE: FFI_USE_FrameWidth MUST be set to true to make this field effective. 2218 FrameWidth uint32 2219 // FrameHeight is "RTCInboundRtpStreamStats.frameHeight" 2220 // 2221 // Optional 2222 // 2223 // NOTE: FFI_USE_FrameHeight MUST be set to true to make this field effective. 2224 FrameHeight uint32 2225 // FramesPerSecond is "RTCInboundRtpStreamStats.framesPerSecond" 2226 // 2227 // Optional 2228 // 2229 // NOTE: FFI_USE_FramesPerSecond MUST be set to true to make this field effective. 2230 FramesPerSecond float64 2231 // QpSum is "RTCInboundRtpStreamStats.qpSum" 2232 // 2233 // Optional 2234 // 2235 // NOTE: FFI_USE_QpSum MUST be set to true to make this field effective. 2236 QpSum uint64 2237 // TotalDecodeTime is "RTCInboundRtpStreamStats.totalDecodeTime" 2238 // 2239 // Optional 2240 // 2241 // NOTE: FFI_USE_TotalDecodeTime MUST be set to true to make this field effective. 2242 TotalDecodeTime float64 2243 // TotalInterFrameDelay is "RTCInboundRtpStreamStats.totalInterFrameDelay" 2244 // 2245 // Optional 2246 // 2247 // NOTE: FFI_USE_TotalInterFrameDelay MUST be set to true to make this field effective. 2248 TotalInterFrameDelay float64 2249 // TotalSquaredInterFrameDelay is "RTCInboundRtpStreamStats.totalSquaredInterFrameDelay" 2250 // 2251 // Optional 2252 // 2253 // NOTE: FFI_USE_TotalSquaredInterFrameDelay MUST be set to true to make this field effective. 2254 TotalSquaredInterFrameDelay float64 2255 // PauseCount is "RTCInboundRtpStreamStats.pauseCount" 2256 // 2257 // Optional 2258 // 2259 // NOTE: FFI_USE_PauseCount MUST be set to true to make this field effective. 2260 PauseCount uint32 2261 // TotalPausesDuration is "RTCInboundRtpStreamStats.totalPausesDuration" 2262 // 2263 // Optional 2264 // 2265 // NOTE: FFI_USE_TotalPausesDuration MUST be set to true to make this field effective. 2266 TotalPausesDuration float64 2267 // FreezeCount is "RTCInboundRtpStreamStats.freezeCount" 2268 // 2269 // Optional 2270 // 2271 // NOTE: FFI_USE_FreezeCount MUST be set to true to make this field effective. 2272 FreezeCount uint32 2273 // TotalFreezesDuration is "RTCInboundRtpStreamStats.totalFreezesDuration" 2274 // 2275 // Optional 2276 // 2277 // NOTE: FFI_USE_TotalFreezesDuration MUST be set to true to make this field effective. 2278 TotalFreezesDuration float64 2279 // LastPacketReceivedTimestamp is "RTCInboundRtpStreamStats.lastPacketReceivedTimestamp" 2280 // 2281 // Optional 2282 // 2283 // NOTE: FFI_USE_LastPacketReceivedTimestamp MUST be set to true to make this field effective. 2284 LastPacketReceivedTimestamp DOMHighResTimeStamp 2285 // HeaderBytesReceived is "RTCInboundRtpStreamStats.headerBytesReceived" 2286 // 2287 // Optional 2288 // 2289 // NOTE: FFI_USE_HeaderBytesReceived MUST be set to true to make this field effective. 2290 HeaderBytesReceived uint64 2291 // PacketsDiscarded is "RTCInboundRtpStreamStats.packetsDiscarded" 2292 // 2293 // Optional 2294 // 2295 // NOTE: FFI_USE_PacketsDiscarded MUST be set to true to make this field effective. 2296 PacketsDiscarded uint64 2297 // FecBytesReceived is "RTCInboundRtpStreamStats.fecBytesReceived" 2298 // 2299 // Optional 2300 // 2301 // NOTE: FFI_USE_FecBytesReceived MUST be set to true to make this field effective. 2302 FecBytesReceived uint64 2303 // FecPacketsReceived is "RTCInboundRtpStreamStats.fecPacketsReceived" 2304 // 2305 // Optional 2306 // 2307 // NOTE: FFI_USE_FecPacketsReceived MUST be set to true to make this field effective. 2308 FecPacketsReceived uint64 2309 // FecPacketsDiscarded is "RTCInboundRtpStreamStats.fecPacketsDiscarded" 2310 // 2311 // Optional 2312 // 2313 // NOTE: FFI_USE_FecPacketsDiscarded MUST be set to true to make this field effective. 2314 FecPacketsDiscarded uint64 2315 // BytesReceived is "RTCInboundRtpStreamStats.bytesReceived" 2316 // 2317 // Optional 2318 // 2319 // NOTE: FFI_USE_BytesReceived MUST be set to true to make this field effective. 2320 BytesReceived uint64 2321 // NackCount is "RTCInboundRtpStreamStats.nackCount" 2322 // 2323 // Optional 2324 // 2325 // NOTE: FFI_USE_NackCount MUST be set to true to make this field effective. 2326 NackCount uint32 2327 // FirCount is "RTCInboundRtpStreamStats.firCount" 2328 // 2329 // Optional 2330 // 2331 // NOTE: FFI_USE_FirCount MUST be set to true to make this field effective. 2332 FirCount uint32 2333 // PliCount is "RTCInboundRtpStreamStats.pliCount" 2334 // 2335 // Optional 2336 // 2337 // NOTE: FFI_USE_PliCount MUST be set to true to make this field effective. 2338 PliCount uint32 2339 // TotalProcessingDelay is "RTCInboundRtpStreamStats.totalProcessingDelay" 2340 // 2341 // Optional 2342 // 2343 // NOTE: FFI_USE_TotalProcessingDelay MUST be set to true to make this field effective. 2344 TotalProcessingDelay float64 2345 // EstimatedPlayoutTimestamp is "RTCInboundRtpStreamStats.estimatedPlayoutTimestamp" 2346 // 2347 // Optional 2348 // 2349 // NOTE: FFI_USE_EstimatedPlayoutTimestamp MUST be set to true to make this field effective. 2350 EstimatedPlayoutTimestamp DOMHighResTimeStamp 2351 // JitterBufferDelay is "RTCInboundRtpStreamStats.jitterBufferDelay" 2352 // 2353 // Optional 2354 // 2355 // NOTE: FFI_USE_JitterBufferDelay MUST be set to true to make this field effective. 2356 JitterBufferDelay float64 2357 // JitterBufferTargetDelay is "RTCInboundRtpStreamStats.jitterBufferTargetDelay" 2358 // 2359 // Optional 2360 // 2361 // NOTE: FFI_USE_JitterBufferTargetDelay MUST be set to true to make this field effective. 2362 JitterBufferTargetDelay float64 2363 // JitterBufferEmittedCount is "RTCInboundRtpStreamStats.jitterBufferEmittedCount" 2364 // 2365 // Optional 2366 // 2367 // NOTE: FFI_USE_JitterBufferEmittedCount MUST be set to true to make this field effective. 2368 JitterBufferEmittedCount uint64 2369 // JitterBufferMinimumDelay is "RTCInboundRtpStreamStats.jitterBufferMinimumDelay" 2370 // 2371 // Optional 2372 // 2373 // NOTE: FFI_USE_JitterBufferMinimumDelay MUST be set to true to make this field effective. 2374 JitterBufferMinimumDelay float64 2375 // TotalSamplesReceived is "RTCInboundRtpStreamStats.totalSamplesReceived" 2376 // 2377 // Optional 2378 // 2379 // NOTE: FFI_USE_TotalSamplesReceived MUST be set to true to make this field effective. 2380 TotalSamplesReceived uint64 2381 // ConcealedSamples is "RTCInboundRtpStreamStats.concealedSamples" 2382 // 2383 // Optional 2384 // 2385 // NOTE: FFI_USE_ConcealedSamples MUST be set to true to make this field effective. 2386 ConcealedSamples uint64 2387 // SilentConcealedSamples is "RTCInboundRtpStreamStats.silentConcealedSamples" 2388 // 2389 // Optional 2390 // 2391 // NOTE: FFI_USE_SilentConcealedSamples MUST be set to true to make this field effective. 2392 SilentConcealedSamples uint64 2393 // ConcealmentEvents is "RTCInboundRtpStreamStats.concealmentEvents" 2394 // 2395 // Optional 2396 // 2397 // NOTE: FFI_USE_ConcealmentEvents MUST be set to true to make this field effective. 2398 ConcealmentEvents uint64 2399 // InsertedSamplesForDeceleration is "RTCInboundRtpStreamStats.insertedSamplesForDeceleration" 2400 // 2401 // Optional 2402 // 2403 // NOTE: FFI_USE_InsertedSamplesForDeceleration MUST be set to true to make this field effective. 2404 InsertedSamplesForDeceleration uint64 2405 // RemovedSamplesForAcceleration is "RTCInboundRtpStreamStats.removedSamplesForAcceleration" 2406 // 2407 // Optional 2408 // 2409 // NOTE: FFI_USE_RemovedSamplesForAcceleration MUST be set to true to make this field effective. 2410 RemovedSamplesForAcceleration uint64 2411 // AudioLevel is "RTCInboundRtpStreamStats.audioLevel" 2412 // 2413 // Optional 2414 // 2415 // NOTE: FFI_USE_AudioLevel MUST be set to true to make this field effective. 2416 AudioLevel float64 2417 // TotalAudioEnergy is "RTCInboundRtpStreamStats.totalAudioEnergy" 2418 // 2419 // Optional 2420 // 2421 // NOTE: FFI_USE_TotalAudioEnergy MUST be set to true to make this field effective. 2422 TotalAudioEnergy float64 2423 // TotalSamplesDuration is "RTCInboundRtpStreamStats.totalSamplesDuration" 2424 // 2425 // Optional 2426 // 2427 // NOTE: FFI_USE_TotalSamplesDuration MUST be set to true to make this field effective. 2428 TotalSamplesDuration float64 2429 // FramesReceived is "RTCInboundRtpStreamStats.framesReceived" 2430 // 2431 // Optional 2432 // 2433 // NOTE: FFI_USE_FramesReceived MUST be set to true to make this field effective. 2434 FramesReceived uint32 2435 // DecoderImplementation is "RTCInboundRtpStreamStats.decoderImplementation" 2436 // 2437 // Optional 2438 DecoderImplementation js.String 2439 // PlayoutId is "RTCInboundRtpStreamStats.playoutId" 2440 // 2441 // Optional 2442 PlayoutId js.String 2443 // PowerEfficientDecoder is "RTCInboundRtpStreamStats.powerEfficientDecoder" 2444 // 2445 // Optional 2446 // 2447 // NOTE: FFI_USE_PowerEfficientDecoder MUST be set to true to make this field effective. 2448 PowerEfficientDecoder bool 2449 // FramesAssembledFromMultiplePackets is "RTCInboundRtpStreamStats.framesAssembledFromMultiplePackets" 2450 // 2451 // Optional 2452 // 2453 // NOTE: FFI_USE_FramesAssembledFromMultiplePackets MUST be set to true to make this field effective. 2454 FramesAssembledFromMultiplePackets uint32 2455 // TotalAssemblyTime is "RTCInboundRtpStreamStats.totalAssemblyTime" 2456 // 2457 // Optional 2458 // 2459 // NOTE: FFI_USE_TotalAssemblyTime MUST be set to true to make this field effective. 2460 TotalAssemblyTime float64 2461 // RetransmittedPacketsReceived is "RTCInboundRtpStreamStats.retransmittedPacketsReceived" 2462 // 2463 // Optional 2464 // 2465 // NOTE: FFI_USE_RetransmittedPacketsReceived MUST be set to true to make this field effective. 2466 RetransmittedPacketsReceived uint64 2467 // RetransmittedBytesReceived is "RTCInboundRtpStreamStats.retransmittedBytesReceived" 2468 // 2469 // Optional 2470 // 2471 // NOTE: FFI_USE_RetransmittedBytesReceived MUST be set to true to make this field effective. 2472 RetransmittedBytesReceived uint64 2473 // RtxSsrc is "RTCInboundRtpStreamStats.rtxSsrc" 2474 // 2475 // Optional 2476 // 2477 // NOTE: FFI_USE_RtxSsrc MUST be set to true to make this field effective. 2478 RtxSsrc uint32 2479 // FecSsrc is "RTCInboundRtpStreamStats.fecSsrc" 2480 // 2481 // Optional 2482 // 2483 // NOTE: FFI_USE_FecSsrc MUST be set to true to make this field effective. 2484 FecSsrc uint32 2485 // PacketsReceived is "RTCInboundRtpStreamStats.packetsReceived" 2486 // 2487 // Optional 2488 // 2489 // NOTE: FFI_USE_PacketsReceived MUST be set to true to make this field effective. 2490 PacketsReceived uint64 2491 // PacketsLost is "RTCInboundRtpStreamStats.packetsLost" 2492 // 2493 // Optional 2494 // 2495 // NOTE: FFI_USE_PacketsLost MUST be set to true to make this field effective. 2496 PacketsLost int64 2497 // Jitter is "RTCInboundRtpStreamStats.jitter" 2498 // 2499 // Optional 2500 // 2501 // NOTE: FFI_USE_Jitter MUST be set to true to make this field effective. 2502 Jitter float64 2503 // Ssrc is "RTCInboundRtpStreamStats.ssrc" 2504 // 2505 // Required 2506 Ssrc uint32 2507 // Kind is "RTCInboundRtpStreamStats.kind" 2508 // 2509 // Required 2510 Kind js.String 2511 // TransportId is "RTCInboundRtpStreamStats.transportId" 2512 // 2513 // Optional 2514 TransportId js.String 2515 // CodecId is "RTCInboundRtpStreamStats.codecId" 2516 // 2517 // Optional 2518 CodecId js.String 2519 // Timestamp is "RTCInboundRtpStreamStats.timestamp" 2520 // 2521 // Required 2522 Timestamp DOMHighResTimeStamp 2523 // Type is "RTCInboundRtpStreamStats.type" 2524 // 2525 // Required 2526 Type RTCStatsType 2527 // Id is "RTCInboundRtpStreamStats.id" 2528 // 2529 // Required 2530 Id js.String 2531 2532 FFI_USE_FramesDecoded bool // for FramesDecoded. 2533 FFI_USE_KeyFramesDecoded bool // for KeyFramesDecoded. 2534 FFI_USE_FramesRendered bool // for FramesRendered. 2535 FFI_USE_FramesDropped bool // for FramesDropped. 2536 FFI_USE_FrameWidth bool // for FrameWidth. 2537 FFI_USE_FrameHeight bool // for FrameHeight. 2538 FFI_USE_FramesPerSecond bool // for FramesPerSecond. 2539 FFI_USE_QpSum bool // for QpSum. 2540 FFI_USE_TotalDecodeTime bool // for TotalDecodeTime. 2541 FFI_USE_TotalInterFrameDelay bool // for TotalInterFrameDelay. 2542 FFI_USE_TotalSquaredInterFrameDelay bool // for TotalSquaredInterFrameDelay. 2543 FFI_USE_PauseCount bool // for PauseCount. 2544 FFI_USE_TotalPausesDuration bool // for TotalPausesDuration. 2545 FFI_USE_FreezeCount bool // for FreezeCount. 2546 FFI_USE_TotalFreezesDuration bool // for TotalFreezesDuration. 2547 FFI_USE_LastPacketReceivedTimestamp bool // for LastPacketReceivedTimestamp. 2548 FFI_USE_HeaderBytesReceived bool // for HeaderBytesReceived. 2549 FFI_USE_PacketsDiscarded bool // for PacketsDiscarded. 2550 FFI_USE_FecBytesReceived bool // for FecBytesReceived. 2551 FFI_USE_FecPacketsReceived bool // for FecPacketsReceived. 2552 FFI_USE_FecPacketsDiscarded bool // for FecPacketsDiscarded. 2553 FFI_USE_BytesReceived bool // for BytesReceived. 2554 FFI_USE_NackCount bool // for NackCount. 2555 FFI_USE_FirCount bool // for FirCount. 2556 FFI_USE_PliCount bool // for PliCount. 2557 FFI_USE_TotalProcessingDelay bool // for TotalProcessingDelay. 2558 FFI_USE_EstimatedPlayoutTimestamp bool // for EstimatedPlayoutTimestamp. 2559 FFI_USE_JitterBufferDelay bool // for JitterBufferDelay. 2560 FFI_USE_JitterBufferTargetDelay bool // for JitterBufferTargetDelay. 2561 FFI_USE_JitterBufferEmittedCount bool // for JitterBufferEmittedCount. 2562 FFI_USE_JitterBufferMinimumDelay bool // for JitterBufferMinimumDelay. 2563 FFI_USE_TotalSamplesReceived bool // for TotalSamplesReceived. 2564 FFI_USE_ConcealedSamples bool // for ConcealedSamples. 2565 FFI_USE_SilentConcealedSamples bool // for SilentConcealedSamples. 2566 FFI_USE_ConcealmentEvents bool // for ConcealmentEvents. 2567 FFI_USE_InsertedSamplesForDeceleration bool // for InsertedSamplesForDeceleration. 2568 FFI_USE_RemovedSamplesForAcceleration bool // for RemovedSamplesForAcceleration. 2569 FFI_USE_AudioLevel bool // for AudioLevel. 2570 FFI_USE_TotalAudioEnergy bool // for TotalAudioEnergy. 2571 FFI_USE_TotalSamplesDuration bool // for TotalSamplesDuration. 2572 FFI_USE_FramesReceived bool // for FramesReceived. 2573 FFI_USE_PowerEfficientDecoder bool // for PowerEfficientDecoder. 2574 FFI_USE_FramesAssembledFromMultiplePackets bool // for FramesAssembledFromMultiplePackets. 2575 FFI_USE_TotalAssemblyTime bool // for TotalAssemblyTime. 2576 FFI_USE_RetransmittedPacketsReceived bool // for RetransmittedPacketsReceived. 2577 FFI_USE_RetransmittedBytesReceived bool // for RetransmittedBytesReceived. 2578 FFI_USE_RtxSsrc bool // for RtxSsrc. 2579 FFI_USE_FecSsrc bool // for FecSsrc. 2580 FFI_USE_PacketsReceived bool // for PacketsReceived. 2581 FFI_USE_PacketsLost bool // for PacketsLost. 2582 FFI_USE_Jitter bool // for Jitter. 2583 2584 FFI_USE bool 2585 } 2586 2587 // FromRef calls UpdateFrom and returns a RTCInboundRtpStreamStats with all fields set. 2588 func (p RTCInboundRtpStreamStats) FromRef(ref js.Ref) RTCInboundRtpStreamStats { 2589 p.UpdateFrom(ref) 2590 return p 2591 } 2592 2593 // New creates a new RTCInboundRtpStreamStats in the application heap. 2594 func (p RTCInboundRtpStreamStats) New() js.Ref { 2595 return bindings.RTCInboundRtpStreamStatsJSLoad( 2596 js.Pointer(&p), js.True, 0, 2597 ) 2598 } 2599 2600 // UpdateFrom copies value of all fields of the heap object to p. 2601 func (p *RTCInboundRtpStreamStats) UpdateFrom(ref js.Ref) { 2602 bindings.RTCInboundRtpStreamStatsJSStore( 2603 js.Pointer(p), ref, 2604 ) 2605 } 2606 2607 // Update writes all fields of the p to the heap object referenced by ref. 2608 func (p *RTCInboundRtpStreamStats) Update(ref js.Ref) { 2609 bindings.RTCInboundRtpStreamStatsJSLoad( 2610 js.Pointer(p), js.False, ref, 2611 ) 2612 } 2613 2614 // FreeMembers frees fields with heap reference, if recursive is true 2615 // free all heap references reachable from p. 2616 func (p *RTCInboundRtpStreamStats) FreeMembers(recursive bool) { 2617 js.Free( 2618 p.TrackIdentifier.Ref(), 2619 p.Mid.Ref(), 2620 p.RemoteId.Ref(), 2621 p.DecoderImplementation.Ref(), 2622 p.PlayoutId.Ref(), 2623 p.Kind.Ref(), 2624 p.TransportId.Ref(), 2625 p.CodecId.Ref(), 2626 p.Id.Ref(), 2627 ) 2628 p.TrackIdentifier = p.TrackIdentifier.FromRef(js.Undefined) 2629 p.Mid = p.Mid.FromRef(js.Undefined) 2630 p.RemoteId = p.RemoteId.FromRef(js.Undefined) 2631 p.DecoderImplementation = p.DecoderImplementation.FromRef(js.Undefined) 2632 p.PlayoutId = p.PlayoutId.FromRef(js.Undefined) 2633 p.Kind = p.Kind.FromRef(js.Undefined) 2634 p.TransportId = p.TransportId.FromRef(js.Undefined) 2635 p.CodecId = p.CodecId.FromRef(js.Undefined) 2636 p.Id = p.Id.FromRef(js.Undefined) 2637 } 2638 2639 type RTCSdpType uint32 2640 2641 const ( 2642 _ RTCSdpType = iota 2643 2644 RTCSdpType_OFFER 2645 RTCSdpType_PRANSWER 2646 RTCSdpType_ANSWER 2647 RTCSdpType_ROLLBACK 2648 ) 2649 2650 func (RTCSdpType) FromRef(str js.Ref) RTCSdpType { 2651 return RTCSdpType(bindings.ConstOfRTCSdpType(str)) 2652 } 2653 2654 func (x RTCSdpType) String() (string, bool) { 2655 switch x { 2656 case RTCSdpType_OFFER: 2657 return "offer", true 2658 case RTCSdpType_PRANSWER: 2659 return "pranswer", true 2660 case RTCSdpType_ANSWER: 2661 return "answer", true 2662 case RTCSdpType_ROLLBACK: 2663 return "rollback", true 2664 default: 2665 return "", false 2666 } 2667 } 2668 2669 type RTCLocalSessionDescriptionInit struct { 2670 // Type is "RTCLocalSessionDescriptionInit.type" 2671 // 2672 // Optional 2673 Type RTCSdpType 2674 // Sdp is "RTCLocalSessionDescriptionInit.sdp" 2675 // 2676 // Optional, defaults to "". 2677 Sdp js.String 2678 2679 FFI_USE bool 2680 } 2681 2682 // FromRef calls UpdateFrom and returns a RTCLocalSessionDescriptionInit with all fields set. 2683 func (p RTCLocalSessionDescriptionInit) FromRef(ref js.Ref) RTCLocalSessionDescriptionInit { 2684 p.UpdateFrom(ref) 2685 return p 2686 } 2687 2688 // New creates a new RTCLocalSessionDescriptionInit in the application heap. 2689 func (p RTCLocalSessionDescriptionInit) New() js.Ref { 2690 return bindings.RTCLocalSessionDescriptionInitJSLoad( 2691 js.Pointer(&p), js.True, 0, 2692 ) 2693 } 2694 2695 // UpdateFrom copies value of all fields of the heap object to p. 2696 func (p *RTCLocalSessionDescriptionInit) UpdateFrom(ref js.Ref) { 2697 bindings.RTCLocalSessionDescriptionInitJSStore( 2698 js.Pointer(p), ref, 2699 ) 2700 } 2701 2702 // Update writes all fields of the p to the heap object referenced by ref. 2703 func (p *RTCLocalSessionDescriptionInit) Update(ref js.Ref) { 2704 bindings.RTCLocalSessionDescriptionInitJSLoad( 2705 js.Pointer(p), js.False, ref, 2706 ) 2707 } 2708 2709 // FreeMembers frees fields with heap reference, if recursive is true 2710 // free all heap references reachable from p. 2711 func (p *RTCLocalSessionDescriptionInit) FreeMembers(recursive bool) { 2712 js.Free( 2713 p.Sdp.Ref(), 2714 ) 2715 p.Sdp = p.Sdp.FromRef(js.Undefined) 2716 } 2717 2718 type RTCMediaSourceStats struct { 2719 // TrackIdentifier is "RTCMediaSourceStats.trackIdentifier" 2720 // 2721 // Required 2722 TrackIdentifier js.String 2723 // Kind is "RTCMediaSourceStats.kind" 2724 // 2725 // Required 2726 Kind js.String 2727 // Timestamp is "RTCMediaSourceStats.timestamp" 2728 // 2729 // Required 2730 Timestamp DOMHighResTimeStamp 2731 // Type is "RTCMediaSourceStats.type" 2732 // 2733 // Required 2734 Type RTCStatsType 2735 // Id is "RTCMediaSourceStats.id" 2736 // 2737 // Required 2738 Id js.String 2739 2740 FFI_USE bool 2741 } 2742 2743 // FromRef calls UpdateFrom and returns a RTCMediaSourceStats with all fields set. 2744 func (p RTCMediaSourceStats) FromRef(ref js.Ref) RTCMediaSourceStats { 2745 p.UpdateFrom(ref) 2746 return p 2747 } 2748 2749 // New creates a new RTCMediaSourceStats in the application heap. 2750 func (p RTCMediaSourceStats) New() js.Ref { 2751 return bindings.RTCMediaSourceStatsJSLoad( 2752 js.Pointer(&p), js.True, 0, 2753 ) 2754 } 2755 2756 // UpdateFrom copies value of all fields of the heap object to p. 2757 func (p *RTCMediaSourceStats) UpdateFrom(ref js.Ref) { 2758 bindings.RTCMediaSourceStatsJSStore( 2759 js.Pointer(p), ref, 2760 ) 2761 } 2762 2763 // Update writes all fields of the p to the heap object referenced by ref. 2764 func (p *RTCMediaSourceStats) Update(ref js.Ref) { 2765 bindings.RTCMediaSourceStatsJSLoad( 2766 js.Pointer(p), js.False, ref, 2767 ) 2768 } 2769 2770 // FreeMembers frees fields with heap reference, if recursive is true 2771 // free all heap references reachable from p. 2772 func (p *RTCMediaSourceStats) FreeMembers(recursive bool) { 2773 js.Free( 2774 p.TrackIdentifier.Ref(), 2775 p.Kind.Ref(), 2776 p.Id.Ref(), 2777 ) 2778 p.TrackIdentifier = p.TrackIdentifier.FromRef(js.Undefined) 2779 p.Kind = p.Kind.FromRef(js.Undefined) 2780 p.Id = p.Id.FromRef(js.Undefined) 2781 } 2782 2783 type RTCOfferAnswerOptions struct { 2784 FFI_USE bool 2785 } 2786 2787 // FromRef calls UpdateFrom and returns a RTCOfferAnswerOptions with all fields set. 2788 func (p RTCOfferAnswerOptions) FromRef(ref js.Ref) RTCOfferAnswerOptions { 2789 p.UpdateFrom(ref) 2790 return p 2791 } 2792 2793 // New creates a new RTCOfferAnswerOptions in the application heap. 2794 func (p RTCOfferAnswerOptions) New() js.Ref { 2795 return bindings.RTCOfferAnswerOptionsJSLoad( 2796 js.Pointer(&p), js.True, 0, 2797 ) 2798 } 2799 2800 // UpdateFrom copies value of all fields of the heap object to p. 2801 func (p *RTCOfferAnswerOptions) UpdateFrom(ref js.Ref) { 2802 bindings.RTCOfferAnswerOptionsJSStore( 2803 js.Pointer(p), ref, 2804 ) 2805 } 2806 2807 // Update writes all fields of the p to the heap object referenced by ref. 2808 func (p *RTCOfferAnswerOptions) Update(ref js.Ref) { 2809 bindings.RTCOfferAnswerOptionsJSLoad( 2810 js.Pointer(p), js.False, ref, 2811 ) 2812 } 2813 2814 // FreeMembers frees fields with heap reference, if recursive is true 2815 // free all heap references reachable from p. 2816 func (p *RTCOfferAnswerOptions) FreeMembers(recursive bool) { 2817 } 2818 2819 type RTCOfferOptions struct { 2820 // IceRestart is "RTCOfferOptions.iceRestart" 2821 // 2822 // Optional, defaults to false. 2823 // 2824 // NOTE: FFI_USE_IceRestart MUST be set to true to make this field effective. 2825 IceRestart bool 2826 // OfferToReceiveAudio is "RTCOfferOptions.offerToReceiveAudio" 2827 // 2828 // Optional 2829 // 2830 // NOTE: FFI_USE_OfferToReceiveAudio MUST be set to true to make this field effective. 2831 OfferToReceiveAudio bool 2832 // OfferToReceiveVideo is "RTCOfferOptions.offerToReceiveVideo" 2833 // 2834 // Optional 2835 // 2836 // NOTE: FFI_USE_OfferToReceiveVideo MUST be set to true to make this field effective. 2837 OfferToReceiveVideo bool 2838 2839 FFI_USE_IceRestart bool // for IceRestart. 2840 FFI_USE_OfferToReceiveAudio bool // for OfferToReceiveAudio. 2841 FFI_USE_OfferToReceiveVideo bool // for OfferToReceiveVideo. 2842 2843 FFI_USE bool 2844 } 2845 2846 // FromRef calls UpdateFrom and returns a RTCOfferOptions with all fields set. 2847 func (p RTCOfferOptions) FromRef(ref js.Ref) RTCOfferOptions { 2848 p.UpdateFrom(ref) 2849 return p 2850 } 2851 2852 // New creates a new RTCOfferOptions in the application heap. 2853 func (p RTCOfferOptions) New() js.Ref { 2854 return bindings.RTCOfferOptionsJSLoad( 2855 js.Pointer(&p), js.True, 0, 2856 ) 2857 } 2858 2859 // UpdateFrom copies value of all fields of the heap object to p. 2860 func (p *RTCOfferOptions) UpdateFrom(ref js.Ref) { 2861 bindings.RTCOfferOptionsJSStore( 2862 js.Pointer(p), ref, 2863 ) 2864 } 2865 2866 // Update writes all fields of the p to the heap object referenced by ref. 2867 func (p *RTCOfferOptions) Update(ref js.Ref) { 2868 bindings.RTCOfferOptionsJSLoad( 2869 js.Pointer(p), js.False, ref, 2870 ) 2871 } 2872 2873 // FreeMembers frees fields with heap reference, if recursive is true 2874 // free all heap references reachable from p. 2875 func (p *RTCOfferOptions) FreeMembers(recursive bool) { 2876 } 2877 2878 type RTCQualityLimitationReason uint32 2879 2880 const ( 2881 _ RTCQualityLimitationReason = iota 2882 2883 RTCQualityLimitationReason_NONE 2884 RTCQualityLimitationReason_CPU 2885 RTCQualityLimitationReason_BANDWIDTH 2886 RTCQualityLimitationReason_OTHER 2887 ) 2888 2889 func (RTCQualityLimitationReason) FromRef(str js.Ref) RTCQualityLimitationReason { 2890 return RTCQualityLimitationReason(bindings.ConstOfRTCQualityLimitationReason(str)) 2891 } 2892 2893 func (x RTCQualityLimitationReason) String() (string, bool) { 2894 switch x { 2895 case RTCQualityLimitationReason_NONE: 2896 return "none", true 2897 case RTCQualityLimitationReason_CPU: 2898 return "cpu", true 2899 case RTCQualityLimitationReason_BANDWIDTH: 2900 return "bandwidth", true 2901 case RTCQualityLimitationReason_OTHER: 2902 return "other", true 2903 default: 2904 return "", false 2905 } 2906 } 2907 2908 type RTCOutboundRtpStreamStats struct { 2909 // Mid is "RTCOutboundRtpStreamStats.mid" 2910 // 2911 // Optional 2912 Mid js.String 2913 // MediaSourceId is "RTCOutboundRtpStreamStats.mediaSourceId" 2914 // 2915 // Optional 2916 MediaSourceId js.String 2917 // RemoteId is "RTCOutboundRtpStreamStats.remoteId" 2918 // 2919 // Optional 2920 RemoteId js.String 2921 // Rid is "RTCOutboundRtpStreamStats.rid" 2922 // 2923 // Optional 2924 Rid js.String 2925 // HeaderBytesSent is "RTCOutboundRtpStreamStats.headerBytesSent" 2926 // 2927 // Optional 2928 // 2929 // NOTE: FFI_USE_HeaderBytesSent MUST be set to true to make this field effective. 2930 HeaderBytesSent uint64 2931 // RetransmittedPacketsSent is "RTCOutboundRtpStreamStats.retransmittedPacketsSent" 2932 // 2933 // Optional 2934 // 2935 // NOTE: FFI_USE_RetransmittedPacketsSent MUST be set to true to make this field effective. 2936 RetransmittedPacketsSent uint64 2937 // RetransmittedBytesSent is "RTCOutboundRtpStreamStats.retransmittedBytesSent" 2938 // 2939 // Optional 2940 // 2941 // NOTE: FFI_USE_RetransmittedBytesSent MUST be set to true to make this field effective. 2942 RetransmittedBytesSent uint64 2943 // RtxSsrc is "RTCOutboundRtpStreamStats.rtxSsrc" 2944 // 2945 // Optional 2946 // 2947 // NOTE: FFI_USE_RtxSsrc MUST be set to true to make this field effective. 2948 RtxSsrc uint32 2949 // TargetBitrate is "RTCOutboundRtpStreamStats.targetBitrate" 2950 // 2951 // Optional 2952 // 2953 // NOTE: FFI_USE_TargetBitrate MUST be set to true to make this field effective. 2954 TargetBitrate float64 2955 // TotalEncodedBytesTarget is "RTCOutboundRtpStreamStats.totalEncodedBytesTarget" 2956 // 2957 // Optional 2958 // 2959 // NOTE: FFI_USE_TotalEncodedBytesTarget MUST be set to true to make this field effective. 2960 TotalEncodedBytesTarget uint64 2961 // FrameWidth is "RTCOutboundRtpStreamStats.frameWidth" 2962 // 2963 // Optional 2964 // 2965 // NOTE: FFI_USE_FrameWidth MUST be set to true to make this field effective. 2966 FrameWidth uint32 2967 // FrameHeight is "RTCOutboundRtpStreamStats.frameHeight" 2968 // 2969 // Optional 2970 // 2971 // NOTE: FFI_USE_FrameHeight MUST be set to true to make this field effective. 2972 FrameHeight uint32 2973 // FramesPerSecond is "RTCOutboundRtpStreamStats.framesPerSecond" 2974 // 2975 // Optional 2976 // 2977 // NOTE: FFI_USE_FramesPerSecond MUST be set to true to make this field effective. 2978 FramesPerSecond float64 2979 // FramesSent is "RTCOutboundRtpStreamStats.framesSent" 2980 // 2981 // Optional 2982 // 2983 // NOTE: FFI_USE_FramesSent MUST be set to true to make this field effective. 2984 FramesSent uint32 2985 // HugeFramesSent is "RTCOutboundRtpStreamStats.hugeFramesSent" 2986 // 2987 // Optional 2988 // 2989 // NOTE: FFI_USE_HugeFramesSent MUST be set to true to make this field effective. 2990 HugeFramesSent uint32 2991 // FramesEncoded is "RTCOutboundRtpStreamStats.framesEncoded" 2992 // 2993 // Optional 2994 // 2995 // NOTE: FFI_USE_FramesEncoded MUST be set to true to make this field effective. 2996 FramesEncoded uint32 2997 // KeyFramesEncoded is "RTCOutboundRtpStreamStats.keyFramesEncoded" 2998 // 2999 // Optional 3000 // 3001 // NOTE: FFI_USE_KeyFramesEncoded MUST be set to true to make this field effective. 3002 KeyFramesEncoded uint32 3003 // QpSum is "RTCOutboundRtpStreamStats.qpSum" 3004 // 3005 // Optional 3006 // 3007 // NOTE: FFI_USE_QpSum MUST be set to true to make this field effective. 3008 QpSum uint64 3009 // TotalEncodeTime is "RTCOutboundRtpStreamStats.totalEncodeTime" 3010 // 3011 // Optional 3012 // 3013 // NOTE: FFI_USE_TotalEncodeTime MUST be set to true to make this field effective. 3014 TotalEncodeTime float64 3015 // TotalPacketSendDelay is "RTCOutboundRtpStreamStats.totalPacketSendDelay" 3016 // 3017 // Optional 3018 // 3019 // NOTE: FFI_USE_TotalPacketSendDelay MUST be set to true to make this field effective. 3020 TotalPacketSendDelay float64 3021 // QualityLimitationReason is "RTCOutboundRtpStreamStats.qualityLimitationReason" 3022 // 3023 // Optional 3024 QualityLimitationReason RTCQualityLimitationReason 3025 // QualityLimitationDurations is "RTCOutboundRtpStreamStats.qualityLimitationDurations" 3026 // 3027 // Optional 3028 QualityLimitationDurations js.Record[float64] 3029 // QualityLimitationResolutionChanges is "RTCOutboundRtpStreamStats.qualityLimitationResolutionChanges" 3030 // 3031 // Optional 3032 // 3033 // NOTE: FFI_USE_QualityLimitationResolutionChanges MUST be set to true to make this field effective. 3034 QualityLimitationResolutionChanges uint32 3035 // NackCount is "RTCOutboundRtpStreamStats.nackCount" 3036 // 3037 // Optional 3038 // 3039 // NOTE: FFI_USE_NackCount MUST be set to true to make this field effective. 3040 NackCount uint32 3041 // FirCount is "RTCOutboundRtpStreamStats.firCount" 3042 // 3043 // Optional 3044 // 3045 // NOTE: FFI_USE_FirCount MUST be set to true to make this field effective. 3046 FirCount uint32 3047 // PliCount is "RTCOutboundRtpStreamStats.pliCount" 3048 // 3049 // Optional 3050 // 3051 // NOTE: FFI_USE_PliCount MUST be set to true to make this field effective. 3052 PliCount uint32 3053 // EncoderImplementation is "RTCOutboundRtpStreamStats.encoderImplementation" 3054 // 3055 // Optional 3056 EncoderImplementation js.String 3057 // PowerEfficientEncoder is "RTCOutboundRtpStreamStats.powerEfficientEncoder" 3058 // 3059 // Optional 3060 // 3061 // NOTE: FFI_USE_PowerEfficientEncoder MUST be set to true to make this field effective. 3062 PowerEfficientEncoder bool 3063 // Active is "RTCOutboundRtpStreamStats.active" 3064 // 3065 // Optional 3066 // 3067 // NOTE: FFI_USE_Active MUST be set to true to make this field effective. 3068 Active bool 3069 // ScalabilityMode is "RTCOutboundRtpStreamStats.scalabilityMode" 3070 // 3071 // Optional 3072 ScalabilityMode js.String 3073 // PacketsSent is "RTCOutboundRtpStreamStats.packetsSent" 3074 // 3075 // Optional 3076 // 3077 // NOTE: FFI_USE_PacketsSent MUST be set to true to make this field effective. 3078 PacketsSent uint64 3079 // BytesSent is "RTCOutboundRtpStreamStats.bytesSent" 3080 // 3081 // Optional 3082 // 3083 // NOTE: FFI_USE_BytesSent MUST be set to true to make this field effective. 3084 BytesSent uint64 3085 // Ssrc is "RTCOutboundRtpStreamStats.ssrc" 3086 // 3087 // Required 3088 Ssrc uint32 3089 // Kind is "RTCOutboundRtpStreamStats.kind" 3090 // 3091 // Required 3092 Kind js.String 3093 // TransportId is "RTCOutboundRtpStreamStats.transportId" 3094 // 3095 // Optional 3096 TransportId js.String 3097 // CodecId is "RTCOutboundRtpStreamStats.codecId" 3098 // 3099 // Optional 3100 CodecId js.String 3101 // Timestamp is "RTCOutboundRtpStreamStats.timestamp" 3102 // 3103 // Required 3104 Timestamp DOMHighResTimeStamp 3105 // Type is "RTCOutboundRtpStreamStats.type" 3106 // 3107 // Required 3108 Type RTCStatsType 3109 // Id is "RTCOutboundRtpStreamStats.id" 3110 // 3111 // Required 3112 Id js.String 3113 3114 FFI_USE_HeaderBytesSent bool // for HeaderBytesSent. 3115 FFI_USE_RetransmittedPacketsSent bool // for RetransmittedPacketsSent. 3116 FFI_USE_RetransmittedBytesSent bool // for RetransmittedBytesSent. 3117 FFI_USE_RtxSsrc bool // for RtxSsrc. 3118 FFI_USE_TargetBitrate bool // for TargetBitrate. 3119 FFI_USE_TotalEncodedBytesTarget bool // for TotalEncodedBytesTarget. 3120 FFI_USE_FrameWidth bool // for FrameWidth. 3121 FFI_USE_FrameHeight bool // for FrameHeight. 3122 FFI_USE_FramesPerSecond bool // for FramesPerSecond. 3123 FFI_USE_FramesSent bool // for FramesSent. 3124 FFI_USE_HugeFramesSent bool // for HugeFramesSent. 3125 FFI_USE_FramesEncoded bool // for FramesEncoded. 3126 FFI_USE_KeyFramesEncoded bool // for KeyFramesEncoded. 3127 FFI_USE_QpSum bool // for QpSum. 3128 FFI_USE_TotalEncodeTime bool // for TotalEncodeTime. 3129 FFI_USE_TotalPacketSendDelay bool // for TotalPacketSendDelay. 3130 FFI_USE_QualityLimitationResolutionChanges bool // for QualityLimitationResolutionChanges. 3131 FFI_USE_NackCount bool // for NackCount. 3132 FFI_USE_FirCount bool // for FirCount. 3133 FFI_USE_PliCount bool // for PliCount. 3134 FFI_USE_PowerEfficientEncoder bool // for PowerEfficientEncoder. 3135 FFI_USE_Active bool // for Active. 3136 FFI_USE_PacketsSent bool // for PacketsSent. 3137 FFI_USE_BytesSent bool // for BytesSent. 3138 3139 FFI_USE bool 3140 } 3141 3142 // FromRef calls UpdateFrom and returns a RTCOutboundRtpStreamStats with all fields set. 3143 func (p RTCOutboundRtpStreamStats) FromRef(ref js.Ref) RTCOutboundRtpStreamStats { 3144 p.UpdateFrom(ref) 3145 return p 3146 } 3147 3148 // New creates a new RTCOutboundRtpStreamStats in the application heap. 3149 func (p RTCOutboundRtpStreamStats) New() js.Ref { 3150 return bindings.RTCOutboundRtpStreamStatsJSLoad( 3151 js.Pointer(&p), js.True, 0, 3152 ) 3153 } 3154 3155 // UpdateFrom copies value of all fields of the heap object to p. 3156 func (p *RTCOutboundRtpStreamStats) UpdateFrom(ref js.Ref) { 3157 bindings.RTCOutboundRtpStreamStatsJSStore( 3158 js.Pointer(p), ref, 3159 ) 3160 } 3161 3162 // Update writes all fields of the p to the heap object referenced by ref. 3163 func (p *RTCOutboundRtpStreamStats) Update(ref js.Ref) { 3164 bindings.RTCOutboundRtpStreamStatsJSLoad( 3165 js.Pointer(p), js.False, ref, 3166 ) 3167 } 3168 3169 // FreeMembers frees fields with heap reference, if recursive is true 3170 // free all heap references reachable from p. 3171 func (p *RTCOutboundRtpStreamStats) FreeMembers(recursive bool) { 3172 js.Free( 3173 p.Mid.Ref(), 3174 p.MediaSourceId.Ref(), 3175 p.RemoteId.Ref(), 3176 p.Rid.Ref(), 3177 p.QualityLimitationDurations.Ref(), 3178 p.EncoderImplementation.Ref(), 3179 p.ScalabilityMode.Ref(), 3180 p.Kind.Ref(), 3181 p.TransportId.Ref(), 3182 p.CodecId.Ref(), 3183 p.Id.Ref(), 3184 ) 3185 p.Mid = p.Mid.FromRef(js.Undefined) 3186 p.MediaSourceId = p.MediaSourceId.FromRef(js.Undefined) 3187 p.RemoteId = p.RemoteId.FromRef(js.Undefined) 3188 p.Rid = p.Rid.FromRef(js.Undefined) 3189 p.QualityLimitationDurations = p.QualityLimitationDurations.FromRef(js.Undefined) 3190 p.EncoderImplementation = p.EncoderImplementation.FromRef(js.Undefined) 3191 p.ScalabilityMode = p.ScalabilityMode.FromRef(js.Undefined) 3192 p.Kind = p.Kind.FromRef(js.Undefined) 3193 p.TransportId = p.TransportId.FromRef(js.Undefined) 3194 p.CodecId = p.CodecId.FromRef(js.Undefined) 3195 p.Id = p.Id.FromRef(js.Undefined) 3196 } 3197 3198 type RTCSessionDescriptionInit struct { 3199 // Type is "RTCSessionDescriptionInit.type" 3200 // 3201 // Required 3202 Type RTCSdpType 3203 // Sdp is "RTCSessionDescriptionInit.sdp" 3204 // 3205 // Optional, defaults to "". 3206 Sdp js.String 3207 3208 FFI_USE bool 3209 } 3210 3211 // FromRef calls UpdateFrom and returns a RTCSessionDescriptionInit with all fields set. 3212 func (p RTCSessionDescriptionInit) FromRef(ref js.Ref) RTCSessionDescriptionInit { 3213 p.UpdateFrom(ref) 3214 return p 3215 } 3216 3217 // New creates a new RTCSessionDescriptionInit in the application heap. 3218 func (p RTCSessionDescriptionInit) New() js.Ref { 3219 return bindings.RTCSessionDescriptionInitJSLoad( 3220 js.Pointer(&p), js.True, 0, 3221 ) 3222 } 3223 3224 // UpdateFrom copies value of all fields of the heap object to p. 3225 func (p *RTCSessionDescriptionInit) UpdateFrom(ref js.Ref) { 3226 bindings.RTCSessionDescriptionInitJSStore( 3227 js.Pointer(p), ref, 3228 ) 3229 } 3230 3231 // Update writes all fields of the p to the heap object referenced by ref. 3232 func (p *RTCSessionDescriptionInit) Update(ref js.Ref) { 3233 bindings.RTCSessionDescriptionInitJSLoad( 3234 js.Pointer(p), js.False, ref, 3235 ) 3236 } 3237 3238 // FreeMembers frees fields with heap reference, if recursive is true 3239 // free all heap references reachable from p. 3240 func (p *RTCSessionDescriptionInit) FreeMembers(recursive bool) { 3241 js.Free( 3242 p.Sdp.Ref(), 3243 ) 3244 p.Sdp = p.Sdp.FromRef(js.Undefined) 3245 } 3246 3247 type RTCSessionDescriptionCallbackFunc func(this js.Ref, description *RTCSessionDescriptionInit) js.Ref 3248 3249 func (fn RTCSessionDescriptionCallbackFunc) Register() js.Func[func(description *RTCSessionDescriptionInit)] { 3250 return js.RegisterCallback[func(description *RTCSessionDescriptionInit)]( 3251 fn, abi.FuncPCABIInternal(fn), 3252 ) 3253 } 3254 3255 func (fn RTCSessionDescriptionCallbackFunc) DispatchCallback( 3256 targetPC uintptr, ctx *js.CallbackContext, 3257 ) { 3258 args := ctx.Args() 3259 if len(args) != 1+1 /* js this */ || 3260 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3261 js.ThrowInvalidCallbackInvocation() 3262 } 3263 var arg0 RTCSessionDescriptionInit 3264 arg0.UpdateFrom(args[0+1]) 3265 defer arg0.FreeMembers(true) 3266 3267 if ctx.Return(fn( 3268 args[0], 3269 3270 mark.NoEscape(&arg0), 3271 )) { 3272 return 3273 } 3274 3275 js.ThrowCallbackValueNotReturned() 3276 } 3277 3278 type RTCSessionDescriptionCallback[T any] struct { 3279 Fn func(arg T, this js.Ref, description *RTCSessionDescriptionInit) js.Ref 3280 Arg T 3281 } 3282 3283 func (cb *RTCSessionDescriptionCallback[T]) Register() js.Func[func(description *RTCSessionDescriptionInit)] { 3284 return js.RegisterCallback[func(description *RTCSessionDescriptionInit)]( 3285 cb, abi.FuncPCABIInternal(cb.Fn), 3286 ) 3287 } 3288 3289 func (cb *RTCSessionDescriptionCallback[T]) DispatchCallback( 3290 targetPC uintptr, ctx *js.CallbackContext, 3291 ) { 3292 args := ctx.Args() 3293 if len(args) != 1+1 /* js this */ || 3294 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3295 js.ThrowInvalidCallbackInvocation() 3296 } 3297 var arg0 RTCSessionDescriptionInit 3298 arg0.UpdateFrom(args[0+1]) 3299 defer arg0.FreeMembers(true) 3300 3301 if ctx.Return(cb.Fn( 3302 cb.Arg, 3303 args[0], 3304 3305 mark.NoEscape(&arg0), 3306 )) { 3307 return 3308 } 3309 3310 js.ThrowCallbackValueNotReturned() 3311 } 3312 3313 type RTCPeerConnectionErrorCallbackFunc func(this js.Ref, err DOMException) js.Ref 3314 3315 func (fn RTCPeerConnectionErrorCallbackFunc) Register() js.Func[func(err DOMException)] { 3316 return js.RegisterCallback[func(err DOMException)]( 3317 fn, abi.FuncPCABIInternal(fn), 3318 ) 3319 } 3320 3321 func (fn RTCPeerConnectionErrorCallbackFunc) DispatchCallback( 3322 targetPC uintptr, ctx *js.CallbackContext, 3323 ) { 3324 args := ctx.Args() 3325 if len(args) != 1+1 /* js this */ || 3326 targetPC != uintptr(abi.FuncPCABIInternal(fn)) { 3327 js.ThrowInvalidCallbackInvocation() 3328 } 3329 3330 if ctx.Return(fn( 3331 args[0], 3332 3333 DOMException{}.FromRef(args[0+1]), 3334 )) { 3335 return 3336 } 3337 3338 js.ThrowCallbackValueNotReturned() 3339 } 3340 3341 type RTCPeerConnectionErrorCallback[T any] struct { 3342 Fn func(arg T, this js.Ref, err DOMException) js.Ref 3343 Arg T 3344 } 3345 3346 func (cb *RTCPeerConnectionErrorCallback[T]) Register() js.Func[func(err DOMException)] { 3347 return js.RegisterCallback[func(err DOMException)]( 3348 cb, abi.FuncPCABIInternal(cb.Fn), 3349 ) 3350 } 3351 3352 func (cb *RTCPeerConnectionErrorCallback[T]) DispatchCallback( 3353 targetPC uintptr, ctx *js.CallbackContext, 3354 ) { 3355 args := ctx.Args() 3356 if len(args) != 1+1 /* js this */ || 3357 targetPC != uintptr(abi.FuncPCABIInternal(cb.Fn)) { 3358 js.ThrowInvalidCallbackInvocation() 3359 } 3360 3361 if ctx.Return(cb.Fn( 3362 cb.Arg, 3363 args[0], 3364 3365 DOMException{}.FromRef(args[0+1]), 3366 )) { 3367 return 3368 } 3369 3370 js.ThrowCallbackValueNotReturned() 3371 } 3372 3373 type RTCRtpCodecCapability struct { 3374 // MimeType is "RTCRtpCodecCapability.mimeType" 3375 // 3376 // Required 3377 MimeType js.String 3378 // ClockRate is "RTCRtpCodecCapability.clockRate" 3379 // 3380 // Required 3381 ClockRate uint32 3382 // Channels is "RTCRtpCodecCapability.channels" 3383 // 3384 // Optional 3385 // 3386 // NOTE: FFI_USE_Channels MUST be set to true to make this field effective. 3387 Channels uint16 3388 // SdpFmtpLine is "RTCRtpCodecCapability.sdpFmtpLine" 3389 // 3390 // Optional 3391 SdpFmtpLine js.String 3392 3393 FFI_USE_Channels bool // for Channels. 3394 3395 FFI_USE bool 3396 } 3397 3398 // FromRef calls UpdateFrom and returns a RTCRtpCodecCapability with all fields set. 3399 func (p RTCRtpCodecCapability) FromRef(ref js.Ref) RTCRtpCodecCapability { 3400 p.UpdateFrom(ref) 3401 return p 3402 } 3403 3404 // New creates a new RTCRtpCodecCapability in the application heap. 3405 func (p RTCRtpCodecCapability) New() js.Ref { 3406 return bindings.RTCRtpCodecCapabilityJSLoad( 3407 js.Pointer(&p), js.True, 0, 3408 ) 3409 } 3410 3411 // UpdateFrom copies value of all fields of the heap object to p. 3412 func (p *RTCRtpCodecCapability) UpdateFrom(ref js.Ref) { 3413 bindings.RTCRtpCodecCapabilityJSStore( 3414 js.Pointer(p), ref, 3415 ) 3416 } 3417 3418 // Update writes all fields of the p to the heap object referenced by ref. 3419 func (p *RTCRtpCodecCapability) Update(ref js.Ref) { 3420 bindings.RTCRtpCodecCapabilityJSLoad( 3421 js.Pointer(p), js.False, ref, 3422 ) 3423 } 3424 3425 // FreeMembers frees fields with heap reference, if recursive is true 3426 // free all heap references reachable from p. 3427 func (p *RTCRtpCodecCapability) FreeMembers(recursive bool) { 3428 js.Free( 3429 p.MimeType.Ref(), 3430 p.SdpFmtpLine.Ref(), 3431 ) 3432 p.MimeType = p.MimeType.FromRef(js.Undefined) 3433 p.SdpFmtpLine = p.SdpFmtpLine.FromRef(js.Undefined) 3434 } 3435 3436 type RTCRtpHeaderExtensionCapability struct { 3437 // Uri is "RTCRtpHeaderExtensionCapability.uri" 3438 // 3439 // Required 3440 Uri js.String 3441 3442 FFI_USE bool 3443 } 3444 3445 // FromRef calls UpdateFrom and returns a RTCRtpHeaderExtensionCapability with all fields set. 3446 func (p RTCRtpHeaderExtensionCapability) FromRef(ref js.Ref) RTCRtpHeaderExtensionCapability { 3447 p.UpdateFrom(ref) 3448 return p 3449 } 3450 3451 // New creates a new RTCRtpHeaderExtensionCapability in the application heap. 3452 func (p RTCRtpHeaderExtensionCapability) New() js.Ref { 3453 return bindings.RTCRtpHeaderExtensionCapabilityJSLoad( 3454 js.Pointer(&p), js.True, 0, 3455 ) 3456 } 3457 3458 // UpdateFrom copies value of all fields of the heap object to p. 3459 func (p *RTCRtpHeaderExtensionCapability) UpdateFrom(ref js.Ref) { 3460 bindings.RTCRtpHeaderExtensionCapabilityJSStore( 3461 js.Pointer(p), ref, 3462 ) 3463 } 3464 3465 // Update writes all fields of the p to the heap object referenced by ref. 3466 func (p *RTCRtpHeaderExtensionCapability) Update(ref js.Ref) { 3467 bindings.RTCRtpHeaderExtensionCapabilityJSLoad( 3468 js.Pointer(p), js.False, ref, 3469 ) 3470 } 3471 3472 // FreeMembers frees fields with heap reference, if recursive is true 3473 // free all heap references reachable from p. 3474 func (p *RTCRtpHeaderExtensionCapability) FreeMembers(recursive bool) { 3475 js.Free( 3476 p.Uri.Ref(), 3477 ) 3478 p.Uri = p.Uri.FromRef(js.Undefined) 3479 } 3480 3481 type RTCRtpCapabilities struct { 3482 // Codecs is "RTCRtpCapabilities.codecs" 3483 // 3484 // Required 3485 Codecs js.Array[RTCRtpCodecCapability] 3486 // HeaderExtensions is "RTCRtpCapabilities.headerExtensions" 3487 // 3488 // Required 3489 HeaderExtensions js.Array[RTCRtpHeaderExtensionCapability] 3490 3491 FFI_USE bool 3492 } 3493 3494 // FromRef calls UpdateFrom and returns a RTCRtpCapabilities with all fields set. 3495 func (p RTCRtpCapabilities) FromRef(ref js.Ref) RTCRtpCapabilities { 3496 p.UpdateFrom(ref) 3497 return p 3498 } 3499 3500 // New creates a new RTCRtpCapabilities in the application heap. 3501 func (p RTCRtpCapabilities) New() js.Ref { 3502 return bindings.RTCRtpCapabilitiesJSLoad( 3503 js.Pointer(&p), js.True, 0, 3504 ) 3505 } 3506 3507 // UpdateFrom copies value of all fields of the heap object to p. 3508 func (p *RTCRtpCapabilities) UpdateFrom(ref js.Ref) { 3509 bindings.RTCRtpCapabilitiesJSStore( 3510 js.Pointer(p), ref, 3511 ) 3512 } 3513 3514 // Update writes all fields of the p to the heap object referenced by ref. 3515 func (p *RTCRtpCapabilities) Update(ref js.Ref) { 3516 bindings.RTCRtpCapabilitiesJSLoad( 3517 js.Pointer(p), js.False, ref, 3518 ) 3519 } 3520 3521 // FreeMembers frees fields with heap reference, if recursive is true 3522 // free all heap references reachable from p. 3523 func (p *RTCRtpCapabilities) FreeMembers(recursive bool) { 3524 js.Free( 3525 p.Codecs.Ref(), 3526 p.HeaderExtensions.Ref(), 3527 ) 3528 p.Codecs = p.Codecs.FromRef(js.Undefined) 3529 p.HeaderExtensions = p.HeaderExtensions.FromRef(js.Undefined) 3530 }