@supraio/client-daemon-js 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -161854,7 +161854,7 @@ $packages["github.com/supraio/client-daemon/pkg/netclient"] = (function() {
161854
161854
  return $pkg;
161855
161855
  })();
161856
161856
  $packages["github.com/supraio/client-daemon/pkg/netpacket"] = (function() {
161857
- var $pkg = {}, $init, context, websocket, errs, jshelper, netnacltcp, netsamsungwasmtcp, js, time, SamsungWasmTCPConn, NaClTCPConn, JsWebsocketConn, JsWebsocketWorkerConn, Driver, sliceType, ptrType, mapType, funcType, arrayType, sliceType$1, sliceType$2, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, connects, maxPacketSizes, init, ConnectSamsungWasmTCP, init$1, ConnectNaClTCP, init$2, ConnectJsWebsocket;
161857
+ var $pkg = {}, $init, context, websocket, errs, jshelper, netnacltcp, netsamsungwasmtcp, js, time, SamsungWasmTCPConn, NaClTCPConn, JsWebsocketConn, JsWebsocketWorkerConn, Driver, sliceType, ptrType, mapType, funcType, arrayType, sliceType$1, sliceType$2, ptrType$1, ptrType$2, ptrType$3, ptrType$4, ptrType$5, connects, maxPacketSizes, init, ConnectSamsungWasmTCP, init$1, ConnectNaClTCP, init$2, getPerformanceTimestamp, ConnectJsWebsocket;
161858
161858
  context = $packages["context"];
161859
161859
  websocket = $packages["github.com/coder/websocket"];
161860
161860
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
@@ -162249,7 +162249,7 @@ $packages["github.com/supraio/client-daemon/pkg/netpacket"] = (function() {
162249
162249
  };
162250
162250
  JsWebsocketWorkerConn.prototype.Close = function() { return this.$val.Close(); };
162251
162251
  JsWebsocketWorkerConn.ptr.prototype.CollectFrame = function() {
162252
- var {$24r, _r, _r$1, _r$2, _tuple, c, err, frame, $s, $r, $c} = $restore(this, {});
162252
+ var {$24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _tuple, c, err, frame, $s, $r, $c} = $restore(this, {});
162253
162253
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
162254
162254
  c = this;
162255
162255
  _r = $clone(c.conn, js.Value).Call("collectFrame", sliceType.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
@@ -162261,13 +162261,56 @@ $packages["github.com/supraio/client-daemon/pkg/netpacket"] = (function() {
162261
162261
  /* */ $s = 4; continue;
162262
162262
  /* if (!(err === ptrType.nil)) { */ case 3:
162263
162263
  _r$2 = jshelper.GetError(err); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
162264
- $24r = [ptrType.nil, _r$2];
162264
+ $24r = [ptrType.nil, 0, _r$2];
162265
162265
  $s = 6; case 6: return $24r;
162266
162266
  /* } */ case 4:
162267
- $s = -1; return [frame, $ifaceNil];
162268
- /* */ } return; } var $f = {$blk: JsWebsocketWorkerConn.ptr.prototype.CollectFrame, $c: true, $r, $24r, _r, _r$1, _r$2, _tuple, c, err, frame, $s};return $f;
162267
+ /* */ if (frame === ptrType.nil || $clone(frame, js.Value).IsUndefined() || $clone(frame, js.Value).IsNull()) { $s = 7; continue; }
162268
+ /* */ $s = 8; continue;
162269
+ /* if (frame === ptrType.nil || $clone(frame, js.Value).IsUndefined() || $clone(frame, js.Value).IsNull()) { */ case 7:
162270
+ _r$3 = errs.Errorf("Worker frame collection returned no frame", sliceType.nil); /* */ $s = 9; case 9: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
162271
+ $24r$1 = [ptrType.nil, 0, _r$3];
162272
+ $s = 10; case 10: return $24r$1;
162273
+ /* } */ case 8:
162274
+ _r$4 = getPerformanceTimestamp(); /* */ $s = 11; case 11: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
162275
+ $24r$2 = [frame, _r$4, $ifaceNil];
162276
+ $s = 12; case 12: return $24r$2;
162277
+ /* */ } return; } var $f = {$blk: JsWebsocketWorkerConn.ptr.prototype.CollectFrame, $c: true, $r, $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _tuple, c, err, frame, $s};return $f;
162269
162278
  };
162270
162279
  JsWebsocketWorkerConn.prototype.CollectFrame = function() { return this.$val.CollectFrame(); };
162280
+ getPerformanceTimestamp = function() {
162281
+ var {$24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, date, global, now, performance, timeOrigin, $s, $r, $c} = $restore(this, {});
162282
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
162283
+ global = $clone(js.Global(), js.Value);
162284
+ performance = $clone($clone(global, js.Value).Get("performance"), js.Value);
162285
+ /* */ if (!$clone(performance, js.Value).IsUndefined() && !$clone(performance, js.Value).IsNull()) { $s = 1; continue; }
162286
+ /* */ $s = 2; continue;
162287
+ /* if (!$clone(performance, js.Value).IsUndefined() && !$clone(performance, js.Value).IsNull()) { */ case 1:
162288
+ timeOrigin = $clone($clone(performance, js.Value).Get("timeOrigin"), js.Value);
162289
+ now = $clone($clone(performance, js.Value).Get("now"), js.Value);
162290
+ /* */ if (($clone(timeOrigin, js.Value).Type() === 3) && ($clone(now, js.Value).Type() === 7)) { $s = 3; continue; }
162291
+ /* */ $s = 4; continue;
162292
+ /* if (($clone(timeOrigin, js.Value).Type() === 3) && ($clone(now, js.Value).Type() === 7)) { */ case 3:
162293
+ _r = $clone(performance, js.Value).Call("now", sliceType.nil); /* */ $s = 5; case 5: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
162294
+ _r$1 = $clone(_r, js.Value).Float(); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
162295
+ $24r = $clone(timeOrigin, js.Value).Float() + _r$1;
162296
+ $s = 7; case 7: return $24r;
162297
+ /* } */ case 4:
162298
+ /* } */ case 2:
162299
+ date = $clone($clone(global, js.Value).Get("Date"), js.Value);
162300
+ /* */ if (!$clone(date, js.Value).IsUndefined() && !$clone(date, js.Value).IsNull() && ($clone($clone(date, js.Value).Get("now"), js.Value).Type() === 7)) { $s = 8; continue; }
162301
+ /* */ $s = 9; continue;
162302
+ /* if (!$clone(date, js.Value).IsUndefined() && !$clone(date, js.Value).IsNull() && ($clone($clone(date, js.Value).Get("now"), js.Value).Type() === 7)) { */ case 8:
162303
+ _r$2 = $clone(date, js.Value).Call("now", sliceType.nil); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
162304
+ _r$3 = $clone(_r$2, js.Value).Float(); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
162305
+ $24r$1 = _r$3;
162306
+ $s = 12; case 12: return $24r$1;
162307
+ /* } */ case 9:
162308
+ _r$4 = time.Now(); /* */ $s = 13; case 13: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
162309
+ _r$5 = $clone(_r$4, time.Time).UnixNano(); /* */ $s = 14; case 14: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
162310
+ $24r$2 = ($flatten64(_r$5)) / 1e+06;
162311
+ $s = 15; case 15: return $24r$2;
162312
+ /* */ } return; } var $f = {$blk: getPerformanceTimestamp, $c: true, $r, $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _r$4, _r$5, date, global, now, performance, timeOrigin, $s};return $f;
162313
+ };
162271
162314
  ConnectJsWebsocket = function(host, timeout, secure) {
162272
162315
  var {$24r, $24r$1, $24r$2, _r, _r$1, _tuple, _tuple$1, cancel, conn, ctx, err, host, protocol, secure, timeout, url, workerFactory, $s, $deferred, $r, $c} = $restore(this, {host, timeout, secure});
162273
162316
  /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred);
@@ -162306,7 +162349,7 @@ $packages["github.com/supraio/client-daemon/pkg/netpacket"] = (function() {
162306
162349
  ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "GetJSConnection", name: "GetJSConnection", pkg: "", typ: $funcType([], [ptrType], false)}];
162307
162350
  ptrType$2.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "GetJSConnection", name: "GetJSConnection", pkg: "", typ: $funcType([], [ptrType], false)}];
162308
162351
  ptrType$4.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}];
162309
- ptrType$5.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([], [ptrType, $error], false)}];
162352
+ ptrType$5.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Read", name: "Read", pkg: "", typ: $funcType([sliceType$2], [$Int, $error], false)}, {prop: "Close", name: "Close", pkg: "", typ: $funcType([], [$error], false)}, {prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([], [ptrType, $Float64, $error], false)}];
162310
162353
  SamsungWasmTCPConn.init("github.com/supraio/client-daemon/pkg/netpacket", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType, tag: ""}]);
162311
162354
  NaClTCPConn.init("github.com/supraio/client-daemon/pkg/netpacket", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType, tag: ""}]);
162312
162355
  JsWebsocketConn.init("github.com/supraio/client-daemon/pkg/netpacket", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType$3, tag: ""}]);
@@ -186158,15 +186201,14 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/nacldriver"]
186158
186201
  return $pkg;
186159
186202
  })();
186160
186203
  $packages["github.com/supraio/client-daemon/pkg/render/frame"] = (function() {
186161
- var $pkg = {}, $init, time, FrameType, FrameInterface, Frame, sliceType, ptrType, NewFrame;
186204
+ var $pkg = {}, $init, js, time, JSFrame, FrameType, FrameInterface, funcType, arrayType, sliceType, ptrType, NewJSFrame;
186205
+ js = $packages["syscall/js"];
186162
186206
  time = $packages["time"];
186163
- FrameType = $pkg.FrameType = $newType(1, $kindUint8, "frame.FrameType", true, "github.com/supraio/client-daemon/pkg/render/frame", true, null);
186164
- FrameInterface = $pkg.FrameInterface = $newType(8, $kindInterface, "frame.FrameInterface", true, "github.com/supraio/client-daemon/pkg/render/frame", true, null);
186165
- Frame = $pkg.Frame = $newType(0, $kindStruct, "frame.Frame", true, "github.com/supraio/client-daemon/pkg/render/frame", true, function(frameType_, buffer_, timestamp_) {
186207
+ JSFrame = $pkg.JSFrame = $newType(0, $kindStruct, "frame.JSFrame", true, "github.com/supraio/client-daemon/pkg/render/frame", true, function(frameType_, buffer_, timestamp_) {
186166
186208
  this.$val = this;
186167
186209
  if (arguments.length === 0) {
186168
186210
  this.frameType = 0;
186169
- this.buffer = sliceType.nil;
186211
+ this.buffer = new js.Value.ptr(null, false, arrayType.zero());
186170
186212
  this.timestamp = new $Uint64(0, 0);
186171
186213
  return;
186172
186214
  }
@@ -186174,54 +186216,74 @@ $packages["github.com/supraio/client-daemon/pkg/render/frame"] = (function() {
186174
186216
  this.buffer = buffer_;
186175
186217
  this.timestamp = timestamp_;
186176
186218
  });
186219
+ FrameType = $pkg.FrameType = $newType(1, $kindUint8, "frame.FrameType", true, "github.com/supraio/client-daemon/pkg/render/frame", true, null);
186220
+ FrameInterface = $pkg.FrameInterface = $newType(8, $kindInterface, "frame.FrameInterface", true, "github.com/supraio/client-daemon/pkg/render/frame", true, null);
186221
+ funcType = $funcType([], [], false);
186222
+ arrayType = $arrayType(funcType, 0);
186177
186223
  sliceType = $sliceType($Uint8);
186178
- ptrType = $ptrType(Frame);
186179
- NewFrame = function(frameType, buffer, timestamp) {
186224
+ ptrType = $ptrType(JSFrame);
186225
+ NewJSFrame = function(frameType, buffer, timestamp) {
186180
186226
  var buffer, frameType, timestamp;
186181
- return new Frame.ptr(frameType, buffer, timestamp);
186227
+ return new JSFrame.ptr(frameType, $clone(buffer, js.Value), timestamp);
186182
186228
  };
186183
- $pkg.NewFrame = NewFrame;
186184
- Frame.ptr.prototype.FrameType = function() {
186229
+ $pkg.NewJSFrame = NewJSFrame;
186230
+ JSFrame.ptr.prototype.FrameType = function() {
186185
186231
  var f;
186186
186232
  f = this;
186187
186233
  return f.frameType;
186188
186234
  };
186189
- Frame.prototype.FrameType = function() { return this.$val.FrameType(); };
186190
- Frame.ptr.prototype.Buffer = function() {
186235
+ JSFrame.prototype.FrameType = function() { return this.$val.FrameType(); };
186236
+ JSFrame.ptr.prototype.Buffer = function() {
186237
+ var f;
186238
+ f = this;
186239
+ return sliceType.nil;
186240
+ };
186241
+ JSFrame.prototype.Buffer = function() { return this.$val.Buffer(); };
186242
+ JSFrame.ptr.prototype.JSBuffer = function() {
186191
186243
  var f;
186192
186244
  f = this;
186193
186245
  return f.buffer;
186194
186246
  };
186195
- Frame.prototype.Buffer = function() { return this.$val.Buffer(); };
186196
- Frame.ptr.prototype.GetTimestamp = function() {
186247
+ JSFrame.prototype.JSBuffer = function() { return this.$val.JSBuffer(); };
186248
+ JSFrame.ptr.prototype.ByteLength = function() {
186249
+ var f;
186250
+ f = this;
186251
+ return $clone($clone(f.buffer, js.Value).Get("byteLength"), js.Value).Int();
186252
+ };
186253
+ JSFrame.prototype.ByteLength = function() { return this.$val.ByteLength(); };
186254
+ JSFrame.ptr.prototype.GetTimestamp = function() {
186197
186255
  var f, x;
186198
186256
  f = this;
186199
186257
  return time.Unix(new $Int64(0, 0), ((x = f.timestamp, new $Int64(x.$high, x.$low))));
186200
186258
  };
186201
- Frame.prototype.GetTimestamp = function() { return this.$val.GetTimestamp(); };
186202
- ptrType.methods = [{prop: "FrameType", name: "FrameType", pkg: "", typ: $funcType([], [FrameType], false)}, {prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "GetTimestamp", name: "GetTimestamp", pkg: "", typ: $funcType([], [time.Time], false)}];
186259
+ JSFrame.prototype.GetTimestamp = function() { return this.$val.GetTimestamp(); };
186260
+ ptrType.methods = [{prop: "FrameType", name: "FrameType", pkg: "", typ: $funcType([], [FrameType], false)}, {prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "JSBuffer", name: "JSBuffer", pkg: "", typ: $funcType([], [js.Value], false)}, {prop: "ByteLength", name: "ByteLength", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "GetTimestamp", name: "GetTimestamp", pkg: "", typ: $funcType([], [time.Time], false)}];
186261
+ JSFrame.init("github.com/supraio/client-daemon/pkg/render/frame", [{prop: "frameType", name: "frameType", embedded: false, exported: false, typ: FrameType, tag: ""}, {prop: "buffer", name: "buffer", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "timestamp", name: "timestamp", embedded: false, exported: false, typ: $Uint64, tag: ""}]);
186203
186262
  FrameInterface.init([{prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "FrameType", name: "FrameType", pkg: "", typ: $funcType([], [FrameType], false)}, {prop: "GetTimestamp", name: "GetTimestamp", pkg: "", typ: $funcType([], [time.Time], false)}]);
186204
- Frame.init("github.com/supraio/client-daemon/pkg/render/frame", [{prop: "frameType", name: "frameType", embedded: false, exported: false, typ: FrameType, tag: ""}, {prop: "buffer", name: "buffer", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "timestamp", name: "timestamp", embedded: false, exported: false, typ: $Uint64, tag: ""}]);
186205
186263
  $init = function() {
186206
186264
  $pkg.$init = function() {};
186207
186265
  /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
186208
- $r = time.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186266
+ $r = js.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186267
+ $r = time.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186209
186268
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
186210
186269
  };
186211
186270
  $pkg.$init = $init;
186212
186271
  return $pkg;
186213
186272
  })();
186214
186273
  $packages["github.com/supraio/client-daemon/pkg/render/netframe"] = (function() {
186215
- var $pkg = {}, $init, binary, errs, netpacket, frame, frameCollectorFactories, RegisterFrameCollector;
186274
+ var $pkg = {}, $init, binary, errs, netpacket, frame, time, FrameCollectionDurationCallback, frameCollectorFactories, RegisterFrameCollector;
186216
186275
  binary = $packages["encoding/binary"];
186217
186276
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
186218
186277
  netpacket = $packages["github.com/supraio/client-daemon/pkg/netpacket"];
186219
186278
  frame = $packages["github.com/supraio/client-daemon/pkg/render/frame"];
186279
+ time = $packages["time"];
186280
+ FrameCollectionDurationCallback = $pkg.FrameCollectionDurationCallback = $newType(4, $kindFunc, "netframe.FrameCollectionDurationCallback", true, "github.com/supraio/client-daemon/pkg/render/netframe", true, null);
186220
186281
  RegisterFrameCollector = function(name, factory) {
186221
186282
  var _key, factory, name;
186222
186283
  _key = name; (frameCollectorFactories || $throwRuntimeError("assignment to entry in nil map")).set($String.keyFor(_key), { k: _key, v: factory });
186223
186284
  };
186224
186285
  $pkg.RegisterFrameCollector = RegisterFrameCollector;
186286
+ FrameCollectionDurationCallback.init([time.Duration], [], false);
186225
186287
  $init = function() {
186226
186288
  $pkg.$init = function() {};
186227
186289
  /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
@@ -186229,6 +186291,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe"] = (function()
186229
186291
  $r = errs.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186230
186292
  $r = netpacket.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186231
186293
  $r = frame.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186294
+ $r = time.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186232
186295
  frameCollectorFactories = new $global.Map();
186233
186296
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
186234
186297
  };
@@ -186297,8 +186360,8 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/nacltcp"] = (fun
186297
186360
  /* */ } return; } var $f = {$blk: NewNaClTCPFrameCollector, $c: true, $r, _ref, maxPacketSize, screenConn, screenConnTyped, screenConnTyped$1, $s};return $f;
186298
186361
  };
186299
186362
  $pkg.NewNaClTCPFrameCollector = NewNaClTCPFrameCollector;
186300
- NTFrameCollector.ptr.prototype.CollectFrame = function(startCb, endCb) {
186301
- var {$24r, $24r$1, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, onEnd, onStart, opts, startCb, timestampHi, timestampLo, x, $s, $deferred, $r, $c} = $restore(this, {startCb, endCb});
186363
+ NTFrameCollector.ptr.prototype.CollectFrame = function(startCb, endCb, param) {
186364
+ var {$24r, $24r$1, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, onEnd, onStart, opts, param, startCb, timestampHi, timestampLo, x, $s, $deferred, $r, $c} = $restore(this, {startCb, endCb, param});
186302
186365
  /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred);
186303
186366
  endCb = [endCb];
186304
186367
  startCb = [startCb];
@@ -186345,9 +186408,9 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/nacltcp"] = (fun
186345
186408
  frame$1 = new NTFrame.ptr((($clone($clone(collectedFrame, js.Value).Get("frameType"), js.Value).Int() << 24 >>> 24)), (x = $shiftLeft64(timestampHi, 32), new $Uint64(timestampLo.$high | x.$high, (timestampLo.$low | x.$low) >>> 0)), (($clone($clone(collectedFrame, js.Value).Get("dataRef"), js.Value).Int() >>> 0)));
186346
186409
  $24r$1 = [frame$1, $ifaceNil];
186347
186410
  $s = 10; case 10: return $24r$1;
186348
- /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: NTFrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, $24r$1, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, onEnd, onStart, opts, startCb, timestampHi, timestampLo, x, $s, $deferred};return $f; } }
186411
+ /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: NTFrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, $24r$1, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, onEnd, onStart, opts, param, startCb, timestampHi, timestampLo, x, $s, $deferred};return $f; } }
186349
186412
  };
186350
- NTFrameCollector.prototype.CollectFrame = function(startCb, endCb) { return this.$val.CollectFrame(startCb, endCb); };
186413
+ NTFrameCollector.prototype.CollectFrame = function(startCb, endCb, param) { return this.$val.CollectFrame(startCb, endCb, param); };
186351
186414
  NTFrame.ptr.prototype.FrameType = function() {
186352
186415
  var f;
186353
186416
  f = this;
@@ -186375,7 +186438,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/nacltcp"] = (fun
186375
186438
  return f.dataRef;
186376
186439
  };
186377
186440
  NTFrame.prototype.DataRef = function() { return this.$val.DataRef(); };
186378
- ptrType$2.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType], [frame.FrameInterface, $error], false)}];
186441
+ ptrType$2.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType, netframe.FrameCollectionDurationCallback], [frame.FrameInterface, $error], false)}];
186379
186442
  ptrType$3.methods = [{prop: "FrameType", name: "FrameType", pkg: "", typ: $funcType([], [frame.FrameType], false)}, {prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([], [sliceType$1], false)}, {prop: "GetTimestamp", name: "GetTimestamp", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "DataRef", name: "DataRef", pkg: "", typ: $funcType([], [$Uint32], false)}];
186380
186443
  NTFrameCollector.init("github.com/supraio/client-daemon/pkg/render/netframe/nacltcp", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: netpacket.NaClTCPConn, tag: ""}]);
186381
186444
  NTFrame.init("github.com/supraio/client-daemon/pkg/render/netframe/nacltcp", [{prop: "frameType", name: "frameType", embedded: false, exported: false, typ: frame.FrameType, tag: ""}, {prop: "timestamp", name: "timestamp", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "dataRef", name: "dataRef", embedded: false, exported: false, typ: $Uint32, tag: ""}]);
@@ -186398,7 +186461,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/nacltcp"] = (fun
186398
186461
  return $pkg;
186399
186462
  })();
186400
186463
  $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (function() {
186401
- var $pkg = {}, $init, general, jsdecoder, nacldriver, errs, jshelper, frame, nacltcp, sync, js;
186464
+ var $pkg = {}, $init, general, jsdecoder, nacldriver, errs, jshelper, frame, nacltcp, sync, atomic, js;
186402
186465
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
186403
186466
  jsdecoder = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/jsdecoder"];
186404
186467
  nacldriver = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/nacldriver"];
@@ -186407,6 +186470,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
186407
186470
  frame = $packages["github.com/supraio/client-daemon/pkg/render/frame"];
186408
186471
  nacltcp = $packages["github.com/supraio/client-daemon/pkg/render/netframe/nacltcp"];
186409
186472
  sync = $packages["sync"];
186473
+ atomic = $packages["sync/atomic"];
186410
186474
  js = $packages["syscall/js"];
186411
186475
  $init = function() {
186412
186476
  $pkg.$init = function() {};
@@ -186419,7 +186483,8 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
186419
186483
  $r = frame.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186420
186484
  $r = nacltcp.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186421
186485
  $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186422
- $r = js.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186486
+ $r = atomic.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186487
+ $r = js.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186423
186488
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
186424
186489
  };
186425
186490
  $pkg.$init = $init;
@@ -186503,8 +186568,8 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/samsungwasmtcp"]
186503
186568
  /* */ } return; } var $f = {$blk: NewSamsungWasmTCPFrameCollector, $c: true, $r, _ref, maxPacketSize, screenConn, screenConnTyped, screenConnTyped$1, $s};return $f;
186504
186569
  };
186505
186570
  $pkg.NewSamsungWasmTCPFrameCollector = NewSamsungWasmTCPFrameCollector;
186506
- SWTFrameCollector.ptr.prototype.CollectFrame = function(startCb, endCb) {
186507
- var {$24r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, opts, startCb, timestampHi, timestampLo, x, x$1, x$2, $s, $r, $c} = $restore(this, {startCb, endCb});
186571
+ SWTFrameCollector.ptr.prototype.CollectFrame = function(startCb, endCb, param) {
186572
+ var {$24r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, opts, param, startCb, timestampHi, timestampLo, x, x$1, x$2, $s, $r, $c} = $restore(this, {startCb, endCb, param});
186508
186573
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
186509
186574
  endCb = [endCb];
186510
186575
  startCb = [startCb];
@@ -186544,9 +186609,9 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/samsungwasmtcp"]
186544
186609
  timestampHi = (new $Uint64(0, (($clone($clone($clone(collectedFrame, js.Value).Get("timestamp"), js.Value).Get("hi"), js.Value).Int() >>> 0))));
186545
186610
  frame$1 = new SWTFrame.ptr((($clone($clone(collectedFrame, js.Value).Get("frameType"), js.Value).Int() << 24 >>> 24)), (x$2 = $shiftLeft64(timestampHi, 32), new $Uint64(timestampLo.$high | x$2.$high, (timestampLo.$low | x$2.$low) >>> 0)), (($clone($clone(collectedFrame, js.Value).Get("dataRef"), js.Value).Int() >>> 0)));
186546
186611
  $s = -1; return [frame$1, $ifaceNil];
186547
- /* */ } return; } var $f = {$blk: SWTFrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, opts, startCb, timestampHi, timestampLo, x, x$1, x$2, $s};return $f;
186612
+ /* */ } return; } var $f = {$blk: SWTFrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _tuple, c, collectPromise, collectedFrame, endCb, err, frame$1, jsConn, opts, param, startCb, timestampHi, timestampLo, x, x$1, x$2, $s};return $f;
186548
186613
  };
186549
- SWTFrameCollector.prototype.CollectFrame = function(startCb, endCb) { return this.$val.CollectFrame(startCb, endCb); };
186614
+ SWTFrameCollector.prototype.CollectFrame = function(startCb, endCb, param) { return this.$val.CollectFrame(startCb, endCb, param); };
186550
186615
  SWTFrame.ptr.prototype.FrameType = function() {
186551
186616
  var f;
186552
186617
  f = this;
@@ -186574,7 +186639,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/samsungwasmtcp"]
186574
186639
  return f.dataRef;
186575
186640
  };
186576
186641
  SWTFrame.prototype.DataRef = function() { return this.$val.DataRef(); };
186577
- ptrType$2.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType], [frame.FrameInterface, $error], false)}];
186642
+ ptrType$2.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType, netframe.FrameCollectionDurationCallback], [frame.FrameInterface, $error], false)}];
186578
186643
  ptrType$3.methods = [{prop: "FrameType", name: "FrameType", pkg: "", typ: $funcType([], [frame.FrameType], false)}, {prop: "Buffer", name: "Buffer", pkg: "", typ: $funcType([], [sliceType$1], false)}, {prop: "GetTimestamp", name: "GetTimestamp", pkg: "", typ: $funcType([], [time.Time], false)}, {prop: "DataRef", name: "DataRef", pkg: "", typ: $funcType([], [$Uint32], false)}];
186579
186644
  SWTFrameCollector.init("github.com/supraio/client-daemon/pkg/render/netframe/samsungwasmtcp", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: netpacket.SamsungWasmTCPConn, tag: ""}]);
186580
186645
  SWTFrame.init("github.com/supraio/client-daemon/pkg/render/netframe/samsungwasmtcp", [{prop: "frameType", name: "frameType", embedded: false, exported: false, typ: frame.FrameType, tag: ""}, {prop: "timestamp", name: "timestamp", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "dataRef", name: "dataRef", embedded: false, exported: false, typ: $Uint32, tag: ""}]);
@@ -191412,8 +191477,7 @@ $packages["golang.org/x/exp/shiny/driver/canvasdriver"] = (function() {
191412
191477
  return $pkg;
191413
191478
  })();
191414
191479
  $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function() {
191415
- var $pkg = {}, $init, hex, webgl, general, errs, jshelper, frame, canvasdriver, image, js;
191416
- hex = $packages["encoding/hex"];
191480
+ var $pkg = {}, $init, webgl, general, errs, jshelper, frame, canvasdriver, image, js;
191417
191481
  webgl = $packages["github.com/nuberu/webgl"];
191418
191482
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
191419
191483
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
@@ -191425,15 +191489,14 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
191425
191489
  $init = function() {
191426
191490
  $pkg.$init = function() {};
191427
191491
  /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
191428
- $r = hex.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191429
- $r = webgl.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191430
- $r = general.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191431
- $r = errs.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191432
- $r = jshelper.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191433
- $r = frame.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191434
- $r = canvasdriver.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191435
- $r = image.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191436
- $r = js.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191492
+ $r = webgl.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191493
+ $r = general.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191494
+ $r = errs.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191495
+ $r = jshelper.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191496
+ $r = frame.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191497
+ $r = canvasdriver.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191498
+ $r = image.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191499
+ $r = js.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191437
191500
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
191438
191501
  };
191439
191502
  $pkg.$init = $init;
@@ -191476,11 +191539,14 @@ $packages["github.com/supraio/client-daemon/pkg/input"] = (function() {
191476
191539
  return $pkg;
191477
191540
  })();
191478
191541
  $packages["github.com/supraio/client-daemon/pkg/render/netframe/jswebsocketworker"] = (function() {
191479
- var $pkg = {}, $init, netpacket, frame, netframe, js, FrameCollector, ptrType, sliceType, sliceType$1, funcType, ptrType$1, init, NewFrameCollector;
191542
+ var $pkg = {}, $init, errs, netpacket, frame, netframe, math, js, time, FrameCollector, ptrType, sliceType, funcType, ptrType$1, init, NewFrameCollector;
191543
+ errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
191480
191544
  netpacket = $packages["github.com/supraio/client-daemon/pkg/netpacket"];
191481
191545
  frame = $packages["github.com/supraio/client-daemon/pkg/render/frame"];
191482
191546
  netframe = $packages["github.com/supraio/client-daemon/pkg/render/netframe"];
191547
+ math = $packages["math"];
191483
191548
  js = $packages["syscall/js"];
191549
+ time = $packages["time"];
191484
191550
  FrameCollector = $pkg.FrameCollector = $newType(0, $kindStruct, "jswebsocketworker.FrameCollector", true, "github.com/supraio/client-daemon/pkg/render/netframe/jswebsocketworker", true, function(conn_) {
191485
191551
  this.$val = this;
191486
191552
  if (arguments.length === 0) {
@@ -191490,8 +191556,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/jswebsocketworke
191490
191556
  this.conn = conn_;
191491
191557
  });
191492
191558
  ptrType = $ptrType(netpacket.JsWebsocketWorkerConn);
191493
- sliceType = $sliceType($Uint8);
191494
- sliceType$1 = $sliceType($emptyInterface);
191559
+ sliceType = $sliceType($emptyInterface);
191495
191560
  funcType = $funcType([], [], false);
191496
191561
  ptrType$1 = $ptrType(FrameCollector);
191497
191562
  init = function() {
@@ -191508,48 +191573,66 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe/jswebsocketworke
191508
191573
  return new FrameCollector.ptr(conn);
191509
191574
  };
191510
191575
  $pkg.NewFrameCollector = NewFrameCollector;
191511
- FrameCollector.ptr.prototype.CollectFrame = function(startCb, endCb) {
191512
- var {$24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$2, _tuple, buffer, c, collectedFrame, data, endCb, err, frameLength, length, startCb, $s, $deferred, $r, $c} = $restore(this, {startCb, endCb});
191513
- /* */ $s = $s || 0; var $err = null; try { s: while (true) { switch ($s) { case 0: $deferred = []; $curGoroutine.deferStack.push($deferred);
191576
+ FrameCollector.ptr.prototype.CollectFrame = function(param, param$1, durationCb) {
191577
+ var {$24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, byteLength, c, collectedFrame, collectionDurationMs, data, durationCb, err, firstPacketAt, firstPacketAtValue, frameLength, goReceivedAt, length, param, param$1, $s, $r, $c} = $restore(this, {param, param$1, durationCb});
191578
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
191514
191579
  c = this;
191515
- $r = startCb(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191516
- $deferred.push([endCb, []]);
191517
- _r = c.conn.CollectFrame(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
191580
+ _r = c.conn.CollectFrame(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
191518
191581
  _tuple = _r;
191519
191582
  collectedFrame = _tuple[0];
191520
- err = _tuple[1];
191521
- /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 3; continue; }
191522
- /* */ $s = 4; continue;
191523
- /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 3:
191524
- $24r = [$ifaceNil, err];
191525
- $s = 5; case 5: return $24r;
191526
- /* } */ case 4:
191583
+ goReceivedAt = _tuple[1];
191584
+ err = _tuple[2];
191585
+ if (!($interfaceIsEqual(err, $ifaceNil))) {
191586
+ $s = -1; return [$ifaceNil, err];
191587
+ }
191527
191588
  data = $clone($clone(collectedFrame, js.Value).Get("data"), js.Value);
191528
- length = $clone($clone(data, js.Value).Get("byteLength"), js.Value).Int();
191589
+ byteLength = $clone($clone(data, js.Value).Get("byteLength"), js.Value).Int();
191590
+ length = byteLength;
191529
191591
  frameLength = $clone($clone(collectedFrame, js.Value).Get("length"), js.Value);
191530
191592
  if (!$clone(frameLength, js.Value).IsUndefined() && !$clone(frameLength, js.Value).IsNull()) {
191531
191593
  length = $clone(frameLength, js.Value).Int();
191532
191594
  }
191533
- buffer = $makeSlice(sliceType, length);
191534
- _arg = buffer;
191535
- _r$1 = $clone($clone(js.Global(), js.Value).Get("Uint8Array"), js.Value).New(new sliceType$1([new data.constructor.elem(data), new $Int(0), new $Int(length)])); /* */ $s = 6; case 6: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
191536
- _arg$1 = $clone(_r$1, js.Value);
191537
- _r$2 = js.CopyBytesToGo(_arg, _arg$1); /* */ $s = 7; case 7: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
191538
- _r$2;
191539
- $24r$1 = [frame.NewFrame((($clone($clone(collectedFrame, js.Value).Get("frameType"), js.Value).Int() << 24 >>> 24)), buffer, (new $Uint64(0, $clone($clone(collectedFrame, js.Value).Get("timestamp"), js.Value).Float()))), $ifaceNil];
191540
- $s = 8; case 8: return $24r$1;
191541
- /* */ } return; } } catch(err) { $err = err; $s = -1; return [$ifaceNil, $ifaceNil]; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: FrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$2, _tuple, buffer, c, collectedFrame, data, endCb, err, frameLength, length, startCb, $s, $deferred};return $f; } }
191595
+ /* */ if (!((length === byteLength))) { $s = 2; continue; }
191596
+ /* */ $s = 3; continue;
191597
+ /* if (!((length === byteLength))) { */ case 2:
191598
+ _r$1 = errs.Errorf("Worker frame buffer length mismatch: expected %d, received %d", new sliceType([new $Int(length), new $Int(byteLength)])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
191599
+ $24r = [$ifaceNil, _r$1];
191600
+ $s = 5; case 5: return $24r;
191601
+ /* } */ case 3:
191602
+ firstPacketAtValue = $clone($clone(collectedFrame, js.Value).Get("firstPacketAt"), js.Value);
191603
+ /* */ if (!(($clone(firstPacketAtValue, js.Value).Type() === 3))) { $s = 6; continue; }
191604
+ /* */ $s = 7; continue;
191605
+ /* if (!(($clone(firstPacketAtValue, js.Value).Type() === 3))) { */ case 6:
191606
+ _r$2 = errs.Errorf("Worker frame is missing first packet timestamp", sliceType.nil); /* */ $s = 8; case 8: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
191607
+ $24r$1 = [$ifaceNil, _r$2];
191608
+ $s = 9; case 9: return $24r$1;
191609
+ /* } */ case 7:
191610
+ firstPacketAt = $clone(firstPacketAtValue, js.Value).Float();
191611
+ collectionDurationMs = goReceivedAt - firstPacketAt;
191612
+ /* */ if (math.IsNaN(collectionDurationMs) || math.IsInf(collectionDurationMs, 0) || collectionDurationMs < 0) { $s = 10; continue; }
191613
+ /* */ $s = 11; continue;
191614
+ /* if (math.IsNaN(collectionDurationMs) || math.IsInf(collectionDurationMs, 0) || collectionDurationMs < 0) { */ case 10:
191615
+ _r$3 = errs.Errorf("Invalid worker frame collection duration: %fms", new sliceType([new $Float64(collectionDurationMs)])); /* */ $s = 12; case 12: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
191616
+ $24r$2 = [$ifaceNil, _r$3];
191617
+ $s = 13; case 13: return $24r$2;
191618
+ /* } */ case 11:
191619
+ $r = durationCb((new time.Duration(0, collectionDurationMs * 1e+06))); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191620
+ $s = -1; return [frame.NewJSFrame((($clone($clone(collectedFrame, js.Value).Get("frameType"), js.Value).Int() << 24 >>> 24)), $clone(data, js.Value), (new $Uint64(0, $clone($clone(collectedFrame, js.Value).Get("timestamp"), js.Value).Float()))), $ifaceNil];
191621
+ /* */ } return; } var $f = {$blk: FrameCollector.ptr.prototype.CollectFrame, $c: true, $r, $24r, $24r$1, $24r$2, _r, _r$1, _r$2, _r$3, _tuple, byteLength, c, collectedFrame, collectionDurationMs, data, durationCb, err, firstPacketAt, firstPacketAtValue, frameLength, goReceivedAt, length, param, param$1, $s};return $f;
191542
191622
  };
191543
- FrameCollector.prototype.CollectFrame = function(startCb, endCb) { return this.$val.CollectFrame(startCb, endCb); };
191544
- ptrType$1.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType], [frame.FrameInterface, $error], false)}];
191623
+ FrameCollector.prototype.CollectFrame = function(param, param$1, durationCb) { return this.$val.CollectFrame(param, param$1, durationCb); };
191624
+ ptrType$1.methods = [{prop: "CollectFrame", name: "CollectFrame", pkg: "", typ: $funcType([funcType, funcType, netframe.FrameCollectionDurationCallback], [frame.FrameInterface, $error], false)}];
191545
191625
  FrameCollector.init("github.com/supraio/client-daemon/pkg/render/netframe/jswebsocketworker", [{prop: "conn", name: "conn", embedded: false, exported: false, typ: ptrType, tag: ""}]);
191546
191626
  $init = function() {
191547
191627
  $pkg.$init = function() {};
191548
191628
  /* */ var $f, $c = false, $s = 0, $r; if (this !== undefined && this.$blk !== undefined) { $f = this; $c = true; $s = $f.$s; $r = $f.$r; } s: while (true) { switch ($s) { case 0:
191549
- $r = netpacket.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191550
- $r = frame.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191551
- $r = netframe.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191552
- $r = js.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191629
+ $r = errs.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191630
+ $r = netpacket.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191631
+ $r = frame.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191632
+ $r = netframe.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191633
+ $r = math.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191634
+ $r = js.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191635
+ $r = time.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191553
191636
  init();
191554
191637
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
191555
191638
  };