@supraio/client-daemon-js 0.0.0-jvmaster.369 → 0.0.0-jvmaster.374

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.
@@ -33378,7 +33378,7 @@ $packages["os"] = (function() {
33378
33378
  return $pkg;
33379
33379
  })();
33380
33380
  $packages["fmt"] = (function() {
33381
- var $pkg = {}, $init, errors, fmtsort, io, math, os, reflect, strconv, sync, utf8, ScanState, scanError, ss, ssave, State, Formatter, Stringer, GoStringer, buffer, pp, fmtFlags, fmt, wrapError, arrayType, sliceType, sliceType$1, ptrType, ptrType$1, arrayType$1, sliceType$2, ptrType$4, ptrType$24, arrayType$3, funcType, ptrType$26, ptrType$27, space, ssFree, complexError, boolError, ppFree, isSpace, notSpace, indexRune, newPrinter, Fprintf, Printf, Sprintf, Fprint, Sprint, Fprintln, Sprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, Errorf;
33381
+ var $pkg = {}, $init, errors, fmtsort, io, math, os, reflect, strconv, sync, utf8, ScanState, scanError, ss, ssave, State, Formatter, Stringer, GoStringer, buffer, pp, fmtFlags, fmt, wrapError, arrayType, sliceType, sliceType$1, ptrType, ptrType$1, arrayType$1, sliceType$2, ptrType$4, ptrType$24, arrayType$3, funcType, ptrType$26, ptrType$27, space, ssFree, complexError, boolError, ppFree, isSpace, notSpace, indexRune, newPrinter, Fprintf, Printf, Sprintf, Fprint, Sprint, Fprintln, Println, Sprintln, getField, tooLarge, parsenum, intFromArg, parseArgNumber, Errorf;
33382
33382
  errors = $packages["errors"];
33383
33383
  fmtsort = $packages["internal/fmtsort"];
33384
33384
  io = $packages["io"];
@@ -34013,6 +34013,20 @@ $packages["fmt"] = (function() {
34013
34013
  /* */ } return; } var $f = {$blk: Fprintln, $c: true, $r, _r, _r$1, _tuple, a, err, n, p, w, $s};return $f;
34014
34014
  };
34015
34015
  $pkg.Fprintln = Fprintln;
34016
+ Println = function(a) {
34017
+ var {$24r, _r, _tuple, a, err, n, $s, $r, $c} = $restore(this, {a});
34018
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
34019
+ n = 0;
34020
+ err = $ifaceNil;
34021
+ _r = Fprintln(os.Stdout, a); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
34022
+ _tuple = _r;
34023
+ n = _tuple[0];
34024
+ err = _tuple[1];
34025
+ $24r = [n, err];
34026
+ $s = 2; case 2: return $24r;
34027
+ /* */ } return; } var $f = {$blk: Println, $c: true, $r, $24r, _r, _tuple, a, err, n, $s};return $f;
34028
+ };
34029
+ $pkg.Println = Println;
34016
34030
  Sprintln = function(a) {
34017
34031
  var {_r, a, p, s, $s, $r, $c} = $restore(this, {a});
34018
34032
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
@@ -180131,12 +180145,22 @@ $packages["github.com/supraio/client-daemon/pkg/clientscreen"] = (function() {
180131
180145
  return $pkg;
180132
180146
  })();
180133
180147
  $packages["github.com/supraio/client-daemon/pkg/jshelper"] = (function() {
180134
- var $pkg = {}, $init, errs, log, js, ptrType, sliceType, GetError, Await;
180148
+ var $pkg = {}, $init, errs, log, js, sliceType, ptrType, Stringify, GetError, Await;
180135
180149
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
180136
180150
  log = $packages["log"];
180137
180151
  js = $packages["syscall/js"];
180138
- ptrType = $ptrType(js.Value);
180139
180152
  sliceType = $sliceType($emptyInterface);
180153
+ ptrType = $ptrType(js.Value);
180154
+ Stringify = function(value) {
180155
+ var {$24r, _r, _r$1, value, $s, $r, $c} = $restore(this, {value});
180156
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
180157
+ _r = $clone($clone(js.Global(), js.Value).Get("JSON"), js.Value).Call("stringify", new sliceType([new value.constructor.elem(value)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
180158
+ _r$1 = $clone(_r, js.Value).String(); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
180159
+ $24r = _r$1;
180160
+ $s = 3; case 3: return $24r;
180161
+ /* */ } return; } var $f = {$blk: Stringify, $c: true, $r, $24r, _r, _r$1, value, $s};return $f;
180162
+ };
180163
+ $pkg.Stringify = Stringify;
180140
180164
  GetError = function(err) {
180141
180165
  var {$24r, $24r$1, $24r$2, $24r$3, _r, _r$1, _r$2, _r$3, err, $s, $r, $c} = $restore(this, {err});
180142
180166
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
@@ -180447,6 +180471,2418 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/general"] = (function()
180447
180471
  $pkg.$init = $init;
180448
180472
  return $pkg;
180449
180473
  })();
180474
+ $packages["github.com/supraio/client-daemon/pkg/mpeg2/codec"] = (function() {
180475
+ var $pkg = {}, $init, bytes, binary, errors, fmt, BitStream, BitStreamWriter, sliceType, ptrType$8, ptrType$19, crc32table, FindStartCode, SplitFrame, H264NaluTypeWithoutStartCode, H265NaluTypeWithoutStartCode, IsH264IDRFrame, IsH264VCLNaluType, IsH265VCLNaluType, IsH265IDRFrame, CalcCrc32, NewBitStreamWriter;
180476
+ bytes = $packages["bytes"];
180477
+ binary = $packages["encoding/binary"];
180478
+ errors = $packages["errors"];
180479
+ fmt = $packages["fmt"];
180480
+ BitStream = $pkg.BitStream = $newType(0, $kindStruct, "codec.BitStream", true, "github.com/supraio/client-daemon/pkg/mpeg2/codec", true, function(bits_, bytesOffset_, bitsOffset_, bitsmark_, bytemark_) {
180481
+ this.$val = this;
180482
+ if (arguments.length === 0) {
180483
+ this.bits = sliceType.nil;
180484
+ this.bytesOffset = 0;
180485
+ this.bitsOffset = 0;
180486
+ this.bitsmark = 0;
180487
+ this.bytemark = 0;
180488
+ return;
180489
+ }
180490
+ this.bits = bits_;
180491
+ this.bytesOffset = bytesOffset_;
180492
+ this.bitsOffset = bitsOffset_;
180493
+ this.bitsmark = bitsmark_;
180494
+ this.bytemark = bytemark_;
180495
+ });
180496
+ BitStreamWriter = $pkg.BitStreamWriter = $newType(0, $kindStruct, "codec.BitStreamWriter", true, "github.com/supraio/client-daemon/pkg/mpeg2/codec", true, function(bits_, byteoffset_, bitsoffset_, bitsmark_, bytemark_) {
180497
+ this.$val = this;
180498
+ if (arguments.length === 0) {
180499
+ this.bits = sliceType.nil;
180500
+ this.byteoffset = 0;
180501
+ this.bitsoffset = 0;
180502
+ this.bitsmark = 0;
180503
+ this.bytemark = 0;
180504
+ return;
180505
+ }
180506
+ this.bits = bits_;
180507
+ this.byteoffset = byteoffset_;
180508
+ this.bitsoffset = bitsoffset_;
180509
+ this.bitsmark = bitsmark_;
180510
+ this.bytemark = bytemark_;
180511
+ });
180512
+ sliceType = $sliceType($Uint8);
180513
+ ptrType$8 = $ptrType(BitStream);
180514
+ ptrType$19 = $ptrType(BitStreamWriter);
180515
+ FindStartCode = function(nalu, offset) {
180516
+ var idx, nalu, offset, x;
180517
+ idx = bytes.Index($subslice(nalu, offset), new sliceType([0, 0, 1]));
180518
+ if (idx > 0) {
180519
+ if ((x = (offset + idx >> 0) - 1 >> 0, ((x < 0 || x >= nalu.$length) ? ($throwRuntimeError("index out of range"), undefined) : nalu.$array[nalu.$offset + x])) === 0) {
180520
+ return [(offset + idx >> 0) - 1 >> 0, 4];
180521
+ }
180522
+ return [offset + idx >> 0, 3];
180523
+ } else if ((idx === 0)) {
180524
+ return [offset + idx >> 0, 3];
180525
+ }
180526
+ return [-1, 3];
180527
+ };
180528
+ $pkg.FindStartCode = FindStartCode;
180529
+ SplitFrame = function(frames, onFrame) {
180530
+ var {_r, _r$1, _tuple, _tuple$1, _v, beg, end, frames, onFrame, sc, sc2, $s, $r, $c} = $restore(this, {frames, onFrame});
180531
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
180532
+ _tuple = FindStartCode(frames, 0);
180533
+ beg = _tuple[0];
180534
+ sc = _tuple[1];
180535
+ /* while (true) { */ case 1:
180536
+ /* if (!(beg >= 0)) { break; } */ if(!(beg >= 0)) { $s = 2; continue; }
180537
+ _tuple$1 = FindStartCode(frames, beg + ((sc >> 0)) >> 0);
180538
+ end = _tuple$1[0];
180539
+ sc2 = _tuple$1[1];
180540
+ /* */ if (end === -1) { $s = 3; continue; }
180541
+ /* */ $s = 4; continue;
180542
+ /* if (end === -1) { */ case 3:
180543
+ /* */ if (!(onFrame === $throwNilPointerError)) { $s = 5; continue; }
180544
+ /* */ $s = 6; continue;
180545
+ /* if (!(onFrame === $throwNilPointerError)) { */ case 5:
180546
+ _r = onFrame($subslice(frames, (beg + ((sc >> 0)) >> 0))); /* */ $s = 7; case 7: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
180547
+ _r;
180548
+ /* } */ case 6:
180549
+ /* break; */ $s = 2; continue;
180550
+ /* } */ case 4:
180551
+ if (!(!(onFrame === $throwNilPointerError))) { _v = false; $s = 10; continue s; }
180552
+ _r$1 = onFrame($subslice(frames, (beg + ((sc >> 0)) >> 0), end)); /* */ $s = 11; case 11: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
180553
+ _v = _r$1 === false; case 10:
180554
+ /* */ if (_v) { $s = 8; continue; }
180555
+ /* */ $s = 9; continue;
180556
+ /* if (_v) { */ case 8:
180557
+ /* break; */ $s = 2; continue;
180558
+ /* } */ case 9:
180559
+ beg = end;
180560
+ sc = sc2;
180561
+ $s = 1; continue;
180562
+ case 2:
180563
+ $s = -1; return;
180564
+ /* */ } return; } var $f = {$blk: SplitFrame, $c: true, $r, _r, _r$1, _tuple, _tuple$1, _v, beg, end, frames, onFrame, sc, sc2, $s};return $f;
180565
+ };
180566
+ $pkg.SplitFrame = SplitFrame;
180567
+ H264NaluTypeWithoutStartCode = function(h264) {
180568
+ var h264;
180569
+ return (((((0 >= h264.$length ? ($throwRuntimeError("index out of range"), undefined) : h264.$array[h264.$offset + 0]) & 31) >>> 0) >> 0));
180570
+ };
180571
+ $pkg.H264NaluTypeWithoutStartCode = H264NaluTypeWithoutStartCode;
180572
+ H265NaluTypeWithoutStartCode = function(h265) {
180573
+ var h265;
180574
+ return (((((((0 >= h265.$length ? ($throwRuntimeError("index out of range"), undefined) : h265.$array[h265.$offset + 0]) >>> 1 << 24 >>> 24)) & 63) >>> 0) >> 0));
180575
+ };
180576
+ $pkg.H265NaluTypeWithoutStartCode = H265NaluTypeWithoutStartCode;
180577
+ IsH264IDRFrame = function(h264) {
180578
+ var {h264, onnalu, ret, $s, $r, $c} = $restore(this, {h264});
180579
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
180580
+ ret = [ret];
180581
+ ret[0] = false;
180582
+ onnalu = (function(ret) { return function(nalu) {
180583
+ var nal_type, nalu;
180584
+ nal_type = H264NaluTypeWithoutStartCode(nalu);
180585
+ if (nal_type < 5) {
180586
+ return false;
180587
+ } else if (nal_type === 5) {
180588
+ ret[0] = true;
180589
+ return false;
180590
+ } else {
180591
+ return true;
180592
+ }
180593
+ }; })(ret);
180594
+ $r = SplitFrame(h264, onnalu); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
180595
+ $s = -1; return ret[0];
180596
+ /* */ } return; } var $f = {$blk: IsH264IDRFrame, $c: true, $r, h264, onnalu, ret, $s};return $f;
180597
+ };
180598
+ $pkg.IsH264IDRFrame = IsH264IDRFrame;
180599
+ IsH264VCLNaluType = function(nal_type) {
180600
+ var nal_type;
180601
+ if (nal_type <= 5 && nal_type > 0) {
180602
+ return true;
180603
+ }
180604
+ return false;
180605
+ };
180606
+ $pkg.IsH264VCLNaluType = IsH264VCLNaluType;
180607
+ IsH265VCLNaluType = function(nal_type) {
180608
+ var nal_type;
180609
+ if ((nal_type <= 21 && nal_type >= 16) || (nal_type <= 9 && nal_type >= 0)) {
180610
+ return true;
180611
+ }
180612
+ return false;
180613
+ };
180614
+ $pkg.IsH265VCLNaluType = IsH265VCLNaluType;
180615
+ IsH265IDRFrame = function(h265) {
180616
+ var {h265, onnalu, ret, $s, $r, $c} = $restore(this, {h265});
180617
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
180618
+ ret = [ret];
180619
+ ret[0] = false;
180620
+ onnalu = (function(ret) { return function(nalu) {
180621
+ var nal_type, nalu;
180622
+ nal_type = H265NaluTypeWithoutStartCode(nalu);
180623
+ if (nal_type <= 9 && nal_type >= 0) {
180624
+ return false;
180625
+ } else if (nal_type >= 16 && nal_type <= 21) {
180626
+ ret[0] = true;
180627
+ return false;
180628
+ } else {
180629
+ return true;
180630
+ }
180631
+ }; })(ret);
180632
+ $r = SplitFrame(h265, onnalu); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
180633
+ $s = -1; return ret[0];
180634
+ /* */ } return; } var $f = {$blk: IsH265IDRFrame, $c: true, $r, h265, onnalu, ret, $s};return $f;
180635
+ };
180636
+ $pkg.IsH265IDRFrame = IsH265IDRFrame;
180637
+ CalcCrc32 = function(crc, buffer) {
180638
+ var buffer, crc, i, x;
180639
+ i = 0;
180640
+ i = 0;
180641
+ while (true) {
180642
+ if (!(i < buffer.$length)) { break; }
180643
+ crc = ((x = ((((crc ^ ((((i < 0 || i >= buffer.$length) ? ($throwRuntimeError("index out of range"), undefined) : buffer.$array[buffer.$offset + i]) >>> 0))) >>> 0)) & 255) >>> 0, ((x < 0 || x >= crc32table.length) ? ($throwRuntimeError("index out of range"), undefined) : crc32table[x])) ^ ((crc >>> 8 >>> 0))) >>> 0;
180644
+ i = i + (1) >> 0;
180645
+ }
180646
+ return crc;
180647
+ };
180648
+ $pkg.CalcCrc32 = CalcCrc32;
180649
+ BitStream.ptr.prototype.Uint8 = function(n) {
180650
+ var bs, n;
180651
+ bs = this;
180652
+ return ((bs.GetBits(n).$low << 24 >>> 24));
180653
+ };
180654
+ BitStream.prototype.Uint8 = function(n) { return this.$val.Uint8(n); };
180655
+ BitStream.ptr.prototype.Uint16 = function(n) {
180656
+ var bs, n;
180657
+ bs = this;
180658
+ return ((bs.GetBits(n).$low << 16 >>> 16));
180659
+ };
180660
+ BitStream.prototype.Uint16 = function(n) { return this.$val.Uint16(n); };
180661
+ BitStream.ptr.prototype.Uint32 = function(n) {
180662
+ var bs, n;
180663
+ bs = this;
180664
+ return ((bs.GetBits(n).$low >>> 0));
180665
+ };
180666
+ BitStream.prototype.Uint32 = function(n) { return this.$val.Uint32(n); };
180667
+ BitStream.ptr.prototype.GetBytes = function(n) {
180668
+ var bs, data, n;
180669
+ bs = this;
180670
+ if ((bs.bytesOffset + n >> 0) > bs.bits.$length) {
180671
+ $panic(new $String("OUT OF RANGE"));
180672
+ }
180673
+ if (!((bs.bitsOffset === 0))) {
180674
+ $panic(new $String("invaild operation"));
180675
+ }
180676
+ data = $makeSlice(sliceType, n);
180677
+ $copySlice(data, $subslice(bs.bits, bs.bytesOffset, (bs.bytesOffset + n >> 0)));
180678
+ bs.bytesOffset = bs.bytesOffset + (n) >> 0;
180679
+ return data;
180680
+ };
180681
+ BitStream.prototype.GetBytes = function(n) { return this.$val.GetBytes(n); };
180682
+ BitStream.ptr.prototype.GetBits = function(n) {
180683
+ var bs, n, ret, x, x$1, x$10, x$11, x$12, x$13, x$14, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1;
180684
+ bs = this;
180685
+ if (bs.bytesOffset >= bs.bits.$length) {
180686
+ $panic(new $String("OUT OF RANGE"));
180687
+ }
180688
+ ret = new $Uint64(0, 0);
180689
+ if ((8 - bs.bitsOffset >> 0) >= n) {
180690
+ ret = (new $Uint64(0, (((((y = (((8 - bs.bitsOffset >> 0) - n >> 0)), y < 32 ? ((x = bs.bits, x$1 = bs.bytesOffset, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >>> y) : 0) << 24 >>> 24)) & (x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$2]))) >>> 0)));
180691
+ bs.bitsOffset = bs.bitsOffset + (n) >> 0;
180692
+ if (bs.bitsOffset === 8) {
180693
+ bs.bytesOffset = bs.bytesOffset + (1) >> 0;
180694
+ bs.bitsOffset = 0;
180695
+ }
180696
+ } else {
180697
+ ret = (new $Uint64(0, (((x$3 = bs.bits, x$4 = bs.bytesOffset, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4])) & (x$5 = (8 - bs.bitsOffset >> 0) - 1 >> 0, ((x$5 < 0 || x$5 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$5]))) >>> 0)));
180698
+ bs.bytesOffset = bs.bytesOffset + (1) >> 0;
180699
+ n = n - ((8 - bs.bitsOffset >> 0)) >> 0;
180700
+ bs.bitsOffset = 0;
180701
+ while (true) {
180702
+ if (!(n > 0)) { break; }
180703
+ if (bs.bytesOffset >= bs.bits.$length) {
180704
+ $panic(new $String("OUT OF RANGE"));
180705
+ }
180706
+ if (n >= 8) {
180707
+ ret = (x$6 = $shiftLeft64(ret, 8), x$7 = (new $Uint64(0, (x$8 = bs.bits, x$9 = bs.bytesOffset, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9])))), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0));
180708
+ bs.bytesOffset = bs.bytesOffset + (1) >> 0;
180709
+ n = n - (8) >> 0;
180710
+ } else {
180711
+ ret = (x$10 = $shiftLeft64(ret, n), x$11 = (new $Uint64(0, (((((y$1 = ((8 - n >> 0)), y$1 < 32 ? ((x$12 = bs.bits, x$13 = bs.bytesOffset, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13])) >>> y$1) : 0) << 24 >>> 24)) & (x$14 = n - 1 >> 0, ((x$14 < 0 || x$14 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$14]))) >>> 0))), new $Uint64(x$10.$high | x$11.$high, (x$10.$low | x$11.$low) >>> 0));
180712
+ bs.bitsOffset = n;
180713
+ break;
180714
+ }
180715
+ }
180716
+ }
180717
+ return ret;
180718
+ };
180719
+ BitStream.prototype.GetBits = function(n) { return this.$val.GetBits(n); };
180720
+ BitStream.ptr.prototype.GetBit = function() {
180721
+ var bs, ret, x, x$1, y;
180722
+ bs = this;
180723
+ if (bs.bytesOffset >= bs.bits.$length) {
180724
+ $panic(new $String("OUT OF RANGE"));
180725
+ }
180726
+ ret = (((y = ((7 - bs.bitsOffset >> 0)), y < 32 ? ((x = bs.bits, x$1 = bs.bytesOffset, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) >>> y) : 0) << 24 >>> 24) & 1) >>> 0;
180727
+ bs.bitsOffset = bs.bitsOffset + (1) >> 0;
180728
+ if (bs.bitsOffset >= 8) {
180729
+ bs.bytesOffset = bs.bytesOffset + (1) >> 0;
180730
+ bs.bitsOffset = 0;
180731
+ }
180732
+ return ret;
180733
+ };
180734
+ BitStream.prototype.GetBit = function() { return this.$val.GetBit(); };
180735
+ BitStream.ptr.prototype.SkipBits = function(n) {
180736
+ var _q, _r, bitscount, bs, bytecount, n;
180737
+ bs = this;
180738
+ bytecount = (_q = n / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"));
180739
+ bitscount = (_r = n % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero"));
180740
+ bs.bytesOffset = bs.bytesOffset + (bytecount) >> 0;
180741
+ if ((bs.bitsOffset + bitscount >> 0) < 8) {
180742
+ bs.bitsOffset = bs.bitsOffset + (bitscount) >> 0;
180743
+ } else {
180744
+ bs.bytesOffset = bs.bytesOffset + (1) >> 0;
180745
+ bs.bitsOffset = bs.bitsOffset + ((bitscount - 8 >> 0)) >> 0;
180746
+ }
180747
+ };
180748
+ BitStream.prototype.SkipBits = function(n) { return this.$val.SkipBits(n); };
180749
+ BitStream.ptr.prototype.Markdot = function() {
180750
+ var bs;
180751
+ bs = this;
180752
+ bs.bitsmark = bs.bitsOffset;
180753
+ bs.bytemark = bs.bytesOffset;
180754
+ };
180755
+ BitStream.prototype.Markdot = function() { return this.$val.Markdot(); };
180756
+ BitStream.ptr.prototype.DistanceFromMarkDot = function() {
180757
+ var bitscount, bs, bytecount;
180758
+ bs = this;
180759
+ bytecount = (bs.bytesOffset - bs.bytemark >> 0) - 1 >> 0;
180760
+ bitscount = bs.bitsOffset + ((8 - bs.bitsmark >> 0)) >> 0;
180761
+ return ($imul(bytecount, 8)) + bitscount >> 0;
180762
+ };
180763
+ BitStream.prototype.DistanceFromMarkDot = function() { return this.$val.DistanceFromMarkDot(); };
180764
+ BitStream.ptr.prototype.RemainBytes = function() {
180765
+ var bs;
180766
+ bs = this;
180767
+ if (bs.bitsOffset > 0) {
180768
+ return (bs.bits.$length - bs.bytesOffset >> 0) - 1 >> 0;
180769
+ } else {
180770
+ return bs.bits.$length - bs.bytesOffset >> 0;
180771
+ }
180772
+ };
180773
+ BitStream.prototype.RemainBytes = function() { return this.$val.RemainBytes(); };
180774
+ BitStream.ptr.prototype.RemainBits = function() {
180775
+ var bs;
180776
+ bs = this;
180777
+ if (bs.bitsOffset > 0) {
180778
+ return (($imul(bs.RemainBytes(), 8)) + 8 >> 0) - bs.bitsOffset >> 0;
180779
+ } else {
180780
+ return $imul(bs.RemainBytes(), 8);
180781
+ }
180782
+ };
180783
+ BitStream.prototype.RemainBits = function() { return this.$val.RemainBits(); };
180784
+ BitStream.ptr.prototype.Bits = function() {
180785
+ var bs;
180786
+ bs = this;
180787
+ return bs.bits;
180788
+ };
180789
+ BitStream.prototype.Bits = function() { return this.$val.Bits(); };
180790
+ BitStream.ptr.prototype.RemainData = function() {
180791
+ var bs;
180792
+ bs = this;
180793
+ return $subslice(bs.bits, bs.bytesOffset);
180794
+ };
180795
+ BitStream.prototype.RemainData = function() { return this.$val.RemainData(); };
180796
+ BitStream.ptr.prototype.ReadUE = function() {
180797
+ var bs, info, leadingZeroBits, x, x$1;
180798
+ bs = this;
180799
+ leadingZeroBits = 0;
180800
+ while (true) {
180801
+ if (!(bs.GetBit() === 0)) { break; }
180802
+ leadingZeroBits = leadingZeroBits + (1) >> 0;
180803
+ }
180804
+ if (leadingZeroBits === 0) {
180805
+ return new $Uint64(0, 0);
180806
+ }
180807
+ info = bs.GetBits(leadingZeroBits);
180808
+ return (x = (x$1 = $shiftLeft64(new $Uint64(0, 1), leadingZeroBits), new $Uint64(x$1.$high - 0, x$1.$low - 1)), new $Uint64(x.$high + info.$high, x.$low + info.$low));
180809
+ };
180810
+ BitStream.prototype.ReadUE = function() { return this.$val.ReadUE(); };
180811
+ BitStream.ptr.prototype.ReadSE = function() {
180812
+ var bs, v, x, x$1, x$2;
180813
+ bs = this;
180814
+ v = bs.ReadUE();
180815
+ if ((x = $div64(v, new $Uint64(0, 2), true), (x.$high === 0 && x.$low === 0))) {
180816
+ return $mul64(new $Int64(-1, 4294967295), ((x$1 = $div64(v, new $Uint64(0, 2), false), new $Int64(x$1.$high, x$1.$low))));
180817
+ } else {
180818
+ return $div64(((x$2 = new $Uint64(v.$high + 0, v.$low + 1), new $Int64(x$2.$high, x$2.$low))), new $Int64(0, 2), false);
180819
+ }
180820
+ };
180821
+ BitStream.prototype.ReadSE = function() { return this.$val.ReadSE(); };
180822
+ BitStream.ptr.prototype.ByteOffset = function() {
180823
+ var bs;
180824
+ bs = this;
180825
+ return bs.bytesOffset;
180826
+ };
180827
+ BitStream.prototype.ByteOffset = function() { return this.$val.ByteOffset(); };
180828
+ BitStream.ptr.prototype.UnRead = function(n) {
180829
+ var bs, least, n;
180830
+ bs = this;
180831
+ if ((n - bs.bitsOffset >> 0) <= 0) {
180832
+ bs.bitsOffset = bs.bitsOffset - (n) >> 0;
180833
+ } else {
180834
+ least = n - bs.bitsOffset >> 0;
180835
+ while (true) {
180836
+ if (!(least >= 8)) { break; }
180837
+ bs.bytesOffset = bs.bytesOffset - (1) >> 0;
180838
+ least = least - (8) >> 0;
180839
+ }
180840
+ if (least > 0) {
180841
+ bs.bytesOffset = bs.bytesOffset - (1) >> 0;
180842
+ bs.bitsOffset = 8 - least >> 0;
180843
+ }
180844
+ }
180845
+ };
180846
+ BitStream.prototype.UnRead = function(n) { return this.$val.UnRead(n); };
180847
+ BitStream.ptr.prototype.NextBits = function(n) {
180848
+ var bs, n, r;
180849
+ bs = this;
180850
+ r = bs.GetBits(n);
180851
+ bs.UnRead(n);
180852
+ return r;
180853
+ };
180854
+ BitStream.prototype.NextBits = function(n) { return this.$val.NextBits(n); };
180855
+ BitStream.ptr.prototype.EOS = function() {
180856
+ var bs;
180857
+ bs = this;
180858
+ return (bs.bytesOffset === bs.bits.$length) && (bs.bitsOffset === 0);
180859
+ };
180860
+ BitStream.prototype.EOS = function() { return this.$val.EOS(); };
180861
+ NewBitStreamWriter = function(n) {
180862
+ var n;
180863
+ return new BitStreamWriter.ptr($makeSlice(sliceType, n), 0, 0, 0, 0);
180864
+ };
180865
+ $pkg.NewBitStreamWriter = NewBitStreamWriter;
180866
+ BitStreamWriter.ptr.prototype.expandSpace = function(n) {
180867
+ var _q, bsw, n, newlen, tmp;
180868
+ bsw = this;
180869
+ if (((($imul((((bsw.bits.$length - bsw.byteoffset >> 0) - 1 >> 0)), 8)) + 8 >> 0) - bsw.bitsoffset >> 0) < n) {
180870
+ newlen = 0;
180871
+ if (($imul(bsw.bits.$length, 8)) < n) {
180872
+ newlen = (bsw.bits.$length + (_q = n / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) >> 0) + 1 >> 0;
180873
+ } else {
180874
+ newlen = $imul(bsw.bits.$length, 2);
180875
+ }
180876
+ tmp = $makeSlice(sliceType, newlen);
180877
+ $copySlice(tmp, bsw.bits);
180878
+ bsw.bits = tmp;
180879
+ }
180880
+ };
180881
+ BitStreamWriter.prototype.expandSpace = function(n) { return this.$val.expandSpace(n); };
180882
+ BitStreamWriter.ptr.prototype.ByteOffset = function() {
180883
+ var bsw;
180884
+ bsw = this;
180885
+ return bsw.byteoffset;
180886
+ };
180887
+ BitStreamWriter.prototype.ByteOffset = function() { return this.$val.ByteOffset(); };
180888
+ BitStreamWriter.ptr.prototype.BitOffset = function() {
180889
+ var bsw;
180890
+ bsw = this;
180891
+ return bsw.bitsoffset;
180892
+ };
180893
+ BitStreamWriter.prototype.BitOffset = function() { return this.$val.BitOffset(); };
180894
+ BitStreamWriter.ptr.prototype.Markdot = function() {
180895
+ var bsw;
180896
+ bsw = this;
180897
+ bsw.bitsmark = bsw.bitsoffset;
180898
+ bsw.bytemark = bsw.byteoffset;
180899
+ };
180900
+ BitStreamWriter.prototype.Markdot = function() { return this.$val.Markdot(); };
180901
+ BitStreamWriter.ptr.prototype.DistanceFromMarkDot = function() {
180902
+ var bitscount, bsw, bytecount;
180903
+ bsw = this;
180904
+ bytecount = (bsw.byteoffset - bsw.bytemark >> 0) - 1 >> 0;
180905
+ bitscount = bsw.bitsoffset + ((8 - bsw.bitsmark >> 0)) >> 0;
180906
+ return ($imul(bytecount, 8)) + bitscount >> 0;
180907
+ };
180908
+ BitStreamWriter.prototype.DistanceFromMarkDot = function() { return this.$val.DistanceFromMarkDot(); };
180909
+ BitStreamWriter.ptr.prototype.PutByte = function(v) {
180910
+ var bsw, v, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, x$8, y;
180911
+ bsw = this;
180912
+ bsw.expandSpace(8);
180913
+ if (bsw.bitsoffset === 0) {
180914
+ (x = bsw.bits, x$1 = bsw.byteoffset, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = v));
180915
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180916
+ } else {
180917
+ (x$4 = bsw.bits, x$5 = bsw.byteoffset, ((x$5 < 0 || x$5 >= x$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + x$5] = (((x$2 = bsw.bits, x$3 = bsw.byteoffset, ((x$3 < 0 || x$3 >= x$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + x$3])) | (((y = ((bsw.bitsoffset << 24 >>> 24)), y < 32 ? (v >>> y) : 0) << 24 >>> 24))) >>> 0)));
180918
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180919
+ (x$7 = bsw.bits, x$8 = bsw.byteoffset, ((x$8 < 0 || x$8 >= x$7.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + x$8] = ((v & (x$6 = bsw.bitsoffset - 1 >> 0, ((x$6 < 0 || x$6 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$6]))) >>> 0)));
180920
+ }
180921
+ };
180922
+ BitStreamWriter.prototype.PutByte = function(v) { return this.$val.PutByte(v); };
180923
+ BitStreamWriter.ptr.prototype.PutBytes = function(v) {
180924
+ var bsw, v;
180925
+ bsw = this;
180926
+ if (!((bsw.bitsoffset === 0))) {
180927
+ $panic(new $String("bsw.bitsoffset > 0"));
180928
+ }
180929
+ bsw.expandSpace($imul(8, v.$length));
180930
+ $copySlice($subslice(bsw.bits, bsw.byteoffset), v);
180931
+ bsw.byteoffset = bsw.byteoffset + (v.$length) >> 0;
180932
+ };
180933
+ BitStreamWriter.prototype.PutBytes = function(v) { return this.$val.PutBytes(v); };
180934
+ BitStreamWriter.ptr.prototype.PutRepetValue = function(v, n) {
180935
+ var bsw, i, n, v, x, x$1;
180936
+ bsw = this;
180937
+ if (!((bsw.bitsoffset === 0))) {
180938
+ $panic(new $String("bsw.bitsoffset > 0"));
180939
+ }
180940
+ bsw.expandSpace($imul(8, n));
180941
+ i = 0;
180942
+ while (true) {
180943
+ if (!(i < n)) { break; }
180944
+ (x = bsw.bits, x$1 = bsw.byteoffset, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1] = v));
180945
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180946
+ i = i + (1) >> 0;
180947
+ }
180948
+ };
180949
+ BitStreamWriter.prototype.PutRepetValue = function(v, n) { return this.$val.PutRepetValue(v, n); };
180950
+ BitStreamWriter.ptr.prototype.PutUint8 = function(v, n) {
180951
+ var bsw, n, v;
180952
+ bsw = this;
180953
+ bsw.PutUint64((new $Uint64(0, v)), n);
180954
+ };
180955
+ BitStreamWriter.prototype.PutUint8 = function(v, n) { return this.$val.PutUint8(v, n); };
180956
+ BitStreamWriter.ptr.prototype.PutUint16 = function(v, n) {
180957
+ var bsw, n, v;
180958
+ bsw = this;
180959
+ bsw.PutUint64((new $Uint64(0, v)), n);
180960
+ };
180961
+ BitStreamWriter.prototype.PutUint16 = function(v, n) { return this.$val.PutUint16(v, n); };
180962
+ BitStreamWriter.ptr.prototype.PutUint32 = function(v, n) {
180963
+ var bsw, n, v;
180964
+ bsw = this;
180965
+ bsw.PutUint64((new $Uint64(0, v)), n);
180966
+ };
180967
+ BitStreamWriter.prototype.PutUint32 = function(v, n) { return this.$val.PutUint32(v, n); };
180968
+ BitStreamWriter.ptr.prototype.PutUint64 = function(v, n) {
180969
+ var bsw, n, v, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9, y, y$1;
180970
+ bsw = this;
180971
+ bsw.expandSpace(n);
180972
+ if ((8 - bsw.bitsoffset >> 0) >= n) {
180973
+ (x$3 = bsw.bits, x$4 = bsw.byteoffset, ((x$4 < 0 || x$4 >= x$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + x$4] = (((x = bsw.bits, x$1 = bsw.byteoffset, ((x$1 < 0 || x$1 >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + x$1])) | (((y = (((8 - bsw.bitsoffset >> 0) - n >> 0)), y < 32 ? (((((v.$low << 24 >>> 24)) & (x$2 = n - 1 >> 0, ((x$2 < 0 || x$2 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$2]))) >>> 0) << y) : 0) << 24 >>> 24))) >>> 0)));
180974
+ bsw.bitsoffset = bsw.bitsoffset + (n) >> 0;
180975
+ if (bsw.bitsoffset === 8) {
180976
+ bsw.bitsoffset = 0;
180977
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180978
+ }
180979
+ } else {
180980
+ (x$8 = bsw.bits, x$9 = bsw.byteoffset, ((x$9 < 0 || x$9 >= x$8.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$8.$array[x$8.$offset + x$9] = (((x$5 = bsw.bits, x$6 = bsw.byteoffset, ((x$6 < 0 || x$6 >= x$5.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + x$6])) | ((((($shiftRightUint64(v, ((n - ((8 - bsw.bitsoffset >> 0)) >> 0))).$low << 24 >>> 24)) & (x$7 = (8 - bsw.bitsoffset >> 0) - 1 >> 0, ((x$7 < 0 || x$7 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$7]))) >>> 0))) >>> 0)));
180981
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180982
+ n = n - ((8 - bsw.bitsoffset >> 0)) >> 0;
180983
+ while (true) {
180984
+ if (!((n - 8 >> 0) >= 0)) { break; }
180985
+ (x$10 = bsw.bits, x$11 = bsw.byteoffset, ((x$11 < 0 || x$11 >= x$10.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$10.$array[x$10.$offset + x$11] = (((($shiftRightUint64(v, ((n - 8 >> 0))).$low << 24 >>> 24)) & 255) >>> 0)));
180986
+ bsw.byteoffset = bsw.byteoffset + (1) >> 0;
180987
+ n = n - (8) >> 0;
180988
+ }
180989
+ bsw.bitsoffset = n;
180990
+ if (n > 0) {
180991
+ (x$15 = bsw.bits, x$16 = bsw.byteoffset, ((x$16 < 0 || x$16 >= x$15.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$15.$array[x$15.$offset + x$16] = (((x$12 = bsw.bits, x$13 = bsw.byteoffset, ((x$13 < 0 || x$13 >= x$12.$length) ? ($throwRuntimeError("index out of range"), undefined) : x$12.$array[x$12.$offset + x$13])) | (((y$1 = ((8 - n >> 0)), y$1 < 32 ? ((((((v.$low << 24 >>> 24)) & (x$14 = n - 1 >> 0, ((x$14 < 0 || x$14 >= $pkg.BitMask.length) ? ($throwRuntimeError("index out of range"), undefined) : $pkg.BitMask[x$14]))) >>> 0)) << y$1) : 0) << 24 >>> 24))) >>> 0)));
180992
+ }
180993
+ }
180994
+ };
180995
+ BitStreamWriter.prototype.PutUint64 = function(v, n) { return this.$val.PutUint64(v, n); };
180996
+ BitStreamWriter.ptr.prototype.SetByte = function(v, where) {
180997
+ var bsw, v, where, x;
180998
+ bsw = this;
180999
+ (x = bsw.bits, ((where < 0 || where >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + where] = v));
181000
+ };
181001
+ BitStreamWriter.prototype.SetByte = function(v, where) { return this.$val.SetByte(v, where); };
181002
+ BitStreamWriter.ptr.prototype.SetUint16 = function(v, where) {
181003
+ var bsw, v, where;
181004
+ bsw = this;
181005
+ $clone(binary.BigEndian, binary.bigEndian).PutUint16($subslice(bsw.bits, where, (where + 2 >> 0)), v);
181006
+ };
181007
+ BitStreamWriter.prototype.SetUint16 = function(v, where) { return this.$val.SetUint16(v, where); };
181008
+ BitStreamWriter.ptr.prototype.Bits = function() {
181009
+ var bsw;
181010
+ bsw = this;
181011
+ if (bsw.byteoffset === bsw.bits.$length) {
181012
+ return bsw.bits;
181013
+ }
181014
+ if (bsw.bitsoffset > 0) {
181015
+ return $subslice(bsw.bits, 0, (bsw.byteoffset + 1 >> 0));
181016
+ } else {
181017
+ return $subslice(bsw.bits, 0, bsw.byteoffset);
181018
+ }
181019
+ };
181020
+ BitStreamWriter.prototype.Bits = function() { return this.$val.Bits(); };
181021
+ BitStreamWriter.ptr.prototype.FillRemainData = function(v) {
181022
+ var bsw, i, v, x;
181023
+ bsw = this;
181024
+ i = bsw.byteoffset;
181025
+ while (true) {
181026
+ if (!(i < bsw.bits.$length)) { break; }
181027
+ (x = bsw.bits, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = v));
181028
+ i = i + (1) >> 0;
181029
+ }
181030
+ bsw.byteoffset = bsw.bits.$length;
181031
+ bsw.bitsoffset = 0;
181032
+ };
181033
+ BitStreamWriter.prototype.FillRemainData = function(v) { return this.$val.FillRemainData(v); };
181034
+ BitStreamWriter.ptr.prototype.Reset = function() {
181035
+ var bsw, i, x;
181036
+ bsw = this;
181037
+ i = 0;
181038
+ while (true) {
181039
+ if (!(i < bsw.bits.$length)) { break; }
181040
+ (x = bsw.bits, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i] = 0));
181041
+ i = i + (1) >> 0;
181042
+ }
181043
+ bsw.bitsmark = 0;
181044
+ bsw.bytemark = 0;
181045
+ bsw.bitsoffset = 0;
181046
+ bsw.byteoffset = 0;
181047
+ };
181048
+ BitStreamWriter.prototype.Reset = function() { return this.$val.Reset(); };
181049
+ ptrType$8.methods = [{prop: "Uint8", name: "Uint8", pkg: "", typ: $funcType([$Int], [$Uint8], false)}, {prop: "Uint16", name: "Uint16", pkg: "", typ: $funcType([$Int], [$Uint16], false)}, {prop: "Uint32", name: "Uint32", pkg: "", typ: $funcType([$Int], [$Uint32], false)}, {prop: "GetBytes", name: "GetBytes", pkg: "", typ: $funcType([$Int], [sliceType], false)}, {prop: "GetBits", name: "GetBits", pkg: "", typ: $funcType([$Int], [$Uint64], false)}, {prop: "GetBit", name: "GetBit", pkg: "", typ: $funcType([], [$Uint8], false)}, {prop: "SkipBits", name: "SkipBits", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "Markdot", name: "Markdot", pkg: "", typ: $funcType([], [], false)}, {prop: "DistanceFromMarkDot", name: "DistanceFromMarkDot", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "RemainBytes", name: "RemainBytes", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "RemainBits", name: "RemainBits", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "RemainData", name: "RemainData", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "ReadUE", name: "ReadUE", pkg: "", typ: $funcType([], [$Uint64], false)}, {prop: "ReadSE", name: "ReadSE", pkg: "", typ: $funcType([], [$Int64], false)}, {prop: "ByteOffset", name: "ByteOffset", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "UnRead", name: "UnRead", pkg: "", typ: $funcType([$Int], [], false)}, {prop: "NextBits", name: "NextBits", pkg: "", typ: $funcType([$Int], [$Uint64], false)}, {prop: "EOS", name: "EOS", pkg: "", typ: $funcType([], [$Bool], false)}];
181050
+ ptrType$19.methods = [{prop: "expandSpace", name: "expandSpace", pkg: "github.com/supraio/client-daemon/pkg/mpeg2/codec", typ: $funcType([$Int], [], false)}, {prop: "ByteOffset", name: "ByteOffset", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "BitOffset", name: "BitOffset", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "Markdot", name: "Markdot", pkg: "", typ: $funcType([], [], false)}, {prop: "DistanceFromMarkDot", name: "DistanceFromMarkDot", pkg: "", typ: $funcType([], [$Int], false)}, {prop: "PutByte", name: "PutByte", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "PutBytes", name: "PutBytes", pkg: "", typ: $funcType([sliceType], [], false)}, {prop: "PutRepetValue", name: "PutRepetValue", pkg: "", typ: $funcType([$Uint8, $Int], [], false)}, {prop: "PutUint8", name: "PutUint8", pkg: "", typ: $funcType([$Uint8, $Int], [], false)}, {prop: "PutUint16", name: "PutUint16", pkg: "", typ: $funcType([$Uint16, $Int], [], false)}, {prop: "PutUint32", name: "PutUint32", pkg: "", typ: $funcType([$Uint32, $Int], [], false)}, {prop: "PutUint64", name: "PutUint64", pkg: "", typ: $funcType([$Uint64, $Int], [], false)}, {prop: "SetByte", name: "SetByte", pkg: "", typ: $funcType([$Uint8, $Int], [], false)}, {prop: "SetUint16", name: "SetUint16", pkg: "", typ: $funcType([$Uint16, $Int], [], false)}, {prop: "Bits", name: "Bits", pkg: "", typ: $funcType([], [sliceType], false)}, {prop: "FillRemainData", name: "FillRemainData", pkg: "", typ: $funcType([$Uint8], [], false)}, {prop: "Reset", name: "Reset", pkg: "", typ: $funcType([], [], false)}];
181051
+ BitStream.init("github.com/supraio/client-daemon/pkg/mpeg2/codec", [{prop: "bits", name: "bits", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "bytesOffset", name: "bytesOffset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bitsOffset", name: "bitsOffset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bitsmark", name: "bitsmark", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bytemark", name: "bytemark", embedded: false, exported: false, typ: $Int, tag: ""}]);
181052
+ BitStreamWriter.init("github.com/supraio/client-daemon/pkg/mpeg2/codec", [{prop: "bits", name: "bits", embedded: false, exported: false, typ: sliceType, tag: ""}, {prop: "byteoffset", name: "byteoffset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bitsoffset", name: "bitsoffset", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bitsmark", name: "bitsmark", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "bytemark", name: "bytemark", embedded: false, exported: false, typ: $Int, tag: ""}]);
181053
+ $init = function() {
181054
+ $pkg.$init = function() {};
181055
+ /* */ 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:
181056
+ $r = bytes.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
181057
+ $r = binary.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
181058
+ $r = errors.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
181059
+ $r = fmt.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
181060
+ crc32table = $toNativeArray($kindUint32, [0, 3072180484, 1849393673, 3643163405, 3698721811, 1802224919, 2991425050, 89147166, 3102541862, 267438370, 3604384303, 1640713003, 1687882805, 3548826929, 178294332, 3183300408, 1893405004, 3351695432, 518034245, 2851951169, 2897024351, 464573531, 3264649046, 1972065874, 3358988650, 2133579886, 2785909603, 286284391, 339746169, 2740837501, 2054922096, 3446038132, 3770033048, 1470882460, 2391646609, 965763221, 1019225995, 2346575503, 1392223618, 3857081478, 1482369982, 4014402234, 912304567, 2172479667, 2217553837, 858844841, 3927354788, 1561029792, 2423075540, 661713872, 4267094237, 1229681113, 1276851911, 4211537859, 572568782, 2503833034, 679492338, 2677930998, 1186707707, 4054219263, 4109778657, 1139539941, 2597174504, 768638444, 2003863092, 3228387120, 424346685, 2924922169, 2869330471, 471548707, 3309109294, 1914749226, 3483209234, 2021674774, 2712013851, 381406495, 334203393, 2767604485, 2110785544, 3402483980, 128685944, 2964739708, 1771050353, 3733836917, 3688731499, 1824543343, 3051753826, 50057318, 3209076574, 140205658, 3514637655, 1717623891, 1664129869, 3559742025, 218831172, 3122059328, 2546378156, 551249064, 4194117541, 1323361953, 1269866943, 4239220923, 629875638, 2459361970, 791391626, 2553703566, 1091579779, 4128108167, 4083001753, 1145071773, 2640718736, 712764052, 3877483744, 1342207460, 2300983017, 1044117485, 996913395, 2356572663, 1431319290, 3796759550, 1609612486, 3907878338, 835403471, 2262237131, 2206644437, 882604497, 3988601564, 1520499672, 4007660649, 1509805421, 2161872480, 935743332, 848693370, 2240530814, 1554877043, 3954199415, 1443693647, 3775972683, 943097414, 2401978178, 2323316828, 1030144344, 3829432917, 1398621009, 2654674213, 690412577, 4026572588, 1193106984, 1112348982, 4115716146, 745970495, 2607503931, 651564291, 2446054407, 1223530250, 4293940750, 4204794128, 1304285204, 2493223705, 596005405, 240529393, 3108761333, 1617800696, 3614469372, 3525323746, 1698556646, 3155929579, 184969455, 3065718743, 27715283, 3632309726, 1872585946, 1791828932, 3721454272, 83272141, 3018547401, 2123185853, 3381723065, 280411316, 2813033904, 2734373550, 367459242, 3435182247, 2078112163, 3328194203, 1904080799, 2824582290, 524711318, 437662344, 2903241612, 1949151361, 3274731909, 2576386653, 781011801, 4155181140, 1085720912, 1172737614, 4076556106, 735906887, 2629881155, 561873531, 2522891135, 1329987698, 4166762870, 4245390952, 1242974060, 2469397601, 606979429, 3914046225, 1582717461, 2272270616, 812505116, 893230850, 2183159302, 1527127307, 3961248783, 1369871159, 3871035955, 1067258174, 2290143290, 2379257636, 986535456, 3823834413, 1425462313, 2032576965, 3459999937, 387787724, 2684414664, 2773528022, 307064018, 3412799455, 2088169179, 3251347939, 1993760999, 2951750634, 418243310, 498968048, 2862638324, 1938171897, 3298551549, 167622793, 3202382221, 1741044352, 3504077700, 3582704794, 1654029726, 3148889747, 212729751, 2970661039, 101544363, 3744150182, 1748431778, 1835447484, 3665524152, 56440501, 3024156593]);
181061
+ $pkg.BitMask = $toNativeArray($kindUint8, [1, 3, 7, 15, 31, 63, 127, 255]);
181062
+ /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
181063
+ };
181064
+ $pkg.$init = $init;
181065
+ return $pkg;
181066
+ })();
181067
+ $packages["github.com/supraio/client-daemon/pkg/mpeg2"] = (function() {
181068
+ var $pkg = {}, $init, binary, errors, fmt, codec, io, os, TS_STREAM_TYPE, TSPacket, Adaptation_field, PmtPair, Pat, StreamPair, Pmt, pes_stream, table_pmt, table_pat, TSMuxer, needmoreError, parserError, PesPacket, sliceType, sliceType$1, ptrType, sliceType$2, sliceType$3, ptrType$1, sliceType$4, ptrType$2, sliceType$5, ptrType$3, ptrType$4, ptrType$5, ptrType$7, ptrType$18, ptrType$20, ptrType$21, ptrType$22, ptrType$23, funcType, ptrType$25, ptrType$26, errNeedMore, errParser, NewPat, NewPmt, NewPESStream, NewTablePmt, NewTablePat, NewTSMuxer, findPESIDByStreamType, NewPesPacket;
181069
+ binary = $packages["encoding/binary"];
181070
+ errors = $packages["errors"];
181071
+ fmt = $packages["fmt"];
181072
+ codec = $packages["github.com/supraio/client-daemon/pkg/mpeg2/codec"];
181073
+ io = $packages["io"];
181074
+ os = $packages["os"];
181075
+ TS_STREAM_TYPE = $pkg.TS_STREAM_TYPE = $newType(4, $kindInt, "mpeg2.TS_STREAM_TYPE", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, null);
181076
+ TSPacket = $pkg.TSPacket = $newType(0, $kindStruct, "mpeg2.TSPacket", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(Transport_error_indicator_, Payload_unit_start_indicator_, Transport_priority_, PID_, Transport_scrambling_control_, Adaptation_field_control_, Continuity_counter_, Field_, Payload_) {
181077
+ this.$val = this;
181078
+ if (arguments.length === 0) {
181079
+ this.Transport_error_indicator = 0;
181080
+ this.Payload_unit_start_indicator = 0;
181081
+ this.Transport_priority = 0;
181082
+ this.PID = 0;
181083
+ this.Transport_scrambling_control = 0;
181084
+ this.Adaptation_field_control = 0;
181085
+ this.Continuity_counter = 0;
181086
+ this.Field = ptrType.nil;
181087
+ this.Payload = $ifaceNil;
181088
+ return;
181089
+ }
181090
+ this.Transport_error_indicator = Transport_error_indicator_;
181091
+ this.Payload_unit_start_indicator = Payload_unit_start_indicator_;
181092
+ this.Transport_priority = Transport_priority_;
181093
+ this.PID = PID_;
181094
+ this.Transport_scrambling_control = Transport_scrambling_control_;
181095
+ this.Adaptation_field_control = Adaptation_field_control_;
181096
+ this.Continuity_counter = Continuity_counter_;
181097
+ this.Field = Field_;
181098
+ this.Payload = Payload_;
181099
+ });
181100
+ Adaptation_field = $pkg.Adaptation_field = $newType(0, $kindStruct, "mpeg2.Adaptation_field", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(SingleStuffingByte_, Adaptation_field_length_, Discontinuity_indicator_, Random_access_indicator_, Elementary_stream_priority_indicator_, PCR_flag_, OPCR_flag_, Splicing_point_flag_, Transport_private_data_flag_, Adaptation_field_extension_flag_, Program_clock_reference_base_, Program_clock_reference_extension_, Original_program_clock_reference_base_, Original_program_clock_reference_extension_, Splice_countdown_, Transport_private_data_length_, Adaptation_field_extension_length_, Ltw_flag_, Piecewise_rate_flag_, Seamless_splice_flag_, Ltw_valid_flag_, Ltw_offset_, Piecewise_rate_, Splice_type_, DTS_next_AU_, Stuffing_byte_) {
181101
+ this.$val = this;
181102
+ if (arguments.length === 0) {
181103
+ this.SingleStuffingByte = false;
181104
+ this.Adaptation_field_length = 0;
181105
+ this.Discontinuity_indicator = 0;
181106
+ this.Random_access_indicator = 0;
181107
+ this.Elementary_stream_priority_indicator = 0;
181108
+ this.PCR_flag = 0;
181109
+ this.OPCR_flag = 0;
181110
+ this.Splicing_point_flag = 0;
181111
+ this.Transport_private_data_flag = 0;
181112
+ this.Adaptation_field_extension_flag = 0;
181113
+ this.Program_clock_reference_base = new $Uint64(0, 0);
181114
+ this.Program_clock_reference_extension = 0;
181115
+ this.Original_program_clock_reference_base = new $Uint64(0, 0);
181116
+ this.Original_program_clock_reference_extension = 0;
181117
+ this.Splice_countdown = 0;
181118
+ this.Transport_private_data_length = 0;
181119
+ this.Adaptation_field_extension_length = 0;
181120
+ this.Ltw_flag = 0;
181121
+ this.Piecewise_rate_flag = 0;
181122
+ this.Seamless_splice_flag = 0;
181123
+ this.Ltw_valid_flag = 0;
181124
+ this.Ltw_offset = 0;
181125
+ this.Piecewise_rate = 0;
181126
+ this.Splice_type = 0;
181127
+ this.DTS_next_AU = new $Uint64(0, 0);
181128
+ this.Stuffing_byte = 0;
181129
+ return;
181130
+ }
181131
+ this.SingleStuffingByte = SingleStuffingByte_;
181132
+ this.Adaptation_field_length = Adaptation_field_length_;
181133
+ this.Discontinuity_indicator = Discontinuity_indicator_;
181134
+ this.Random_access_indicator = Random_access_indicator_;
181135
+ this.Elementary_stream_priority_indicator = Elementary_stream_priority_indicator_;
181136
+ this.PCR_flag = PCR_flag_;
181137
+ this.OPCR_flag = OPCR_flag_;
181138
+ this.Splicing_point_flag = Splicing_point_flag_;
181139
+ this.Transport_private_data_flag = Transport_private_data_flag_;
181140
+ this.Adaptation_field_extension_flag = Adaptation_field_extension_flag_;
181141
+ this.Program_clock_reference_base = Program_clock_reference_base_;
181142
+ this.Program_clock_reference_extension = Program_clock_reference_extension_;
181143
+ this.Original_program_clock_reference_base = Original_program_clock_reference_base_;
181144
+ this.Original_program_clock_reference_extension = Original_program_clock_reference_extension_;
181145
+ this.Splice_countdown = Splice_countdown_;
181146
+ this.Transport_private_data_length = Transport_private_data_length_;
181147
+ this.Adaptation_field_extension_length = Adaptation_field_extension_length_;
181148
+ this.Ltw_flag = Ltw_flag_;
181149
+ this.Piecewise_rate_flag = Piecewise_rate_flag_;
181150
+ this.Seamless_splice_flag = Seamless_splice_flag_;
181151
+ this.Ltw_valid_flag = Ltw_valid_flag_;
181152
+ this.Ltw_offset = Ltw_offset_;
181153
+ this.Piecewise_rate = Piecewise_rate_;
181154
+ this.Splice_type = Splice_type_;
181155
+ this.DTS_next_AU = DTS_next_AU_;
181156
+ this.Stuffing_byte = Stuffing_byte_;
181157
+ });
181158
+ PmtPair = $pkg.PmtPair = $newType(0, $kindStruct, "mpeg2.PmtPair", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(Program_number_, PID_) {
181159
+ this.$val = this;
181160
+ if (arguments.length === 0) {
181161
+ this.Program_number = 0;
181162
+ this.PID = 0;
181163
+ return;
181164
+ }
181165
+ this.Program_number = Program_number_;
181166
+ this.PID = PID_;
181167
+ });
181168
+ Pat = $pkg.Pat = $newType(0, $kindStruct, "mpeg2.Pat", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(Table_id_, Section_syntax_indicator_, Section_length_, Transport_stream_id_, Version_number_, Current_next_indicator_, Section_number_, Last_section_number_, Pmts_) {
181169
+ this.$val = this;
181170
+ if (arguments.length === 0) {
181171
+ this.Table_id = 0;
181172
+ this.Section_syntax_indicator = 0;
181173
+ this.Section_length = 0;
181174
+ this.Transport_stream_id = 0;
181175
+ this.Version_number = 0;
181176
+ this.Current_next_indicator = 0;
181177
+ this.Section_number = 0;
181178
+ this.Last_section_number = 0;
181179
+ this.Pmts = sliceType$2.nil;
181180
+ return;
181181
+ }
181182
+ this.Table_id = Table_id_;
181183
+ this.Section_syntax_indicator = Section_syntax_indicator_;
181184
+ this.Section_length = Section_length_;
181185
+ this.Transport_stream_id = Transport_stream_id_;
181186
+ this.Version_number = Version_number_;
181187
+ this.Current_next_indicator = Current_next_indicator_;
181188
+ this.Section_number = Section_number_;
181189
+ this.Last_section_number = Last_section_number_;
181190
+ this.Pmts = Pmts_;
181191
+ });
181192
+ StreamPair = $pkg.StreamPair = $newType(0, $kindStruct, "mpeg2.StreamPair", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(StreamType_, Elementary_PID_, ES_Info_Length_) {
181193
+ this.$val = this;
181194
+ if (arguments.length === 0) {
181195
+ this.StreamType = 0;
181196
+ this.Elementary_PID = 0;
181197
+ this.ES_Info_Length = 0;
181198
+ return;
181199
+ }
181200
+ this.StreamType = StreamType_;
181201
+ this.Elementary_PID = Elementary_PID_;
181202
+ this.ES_Info_Length = ES_Info_Length_;
181203
+ });
181204
+ Pmt = $pkg.Pmt = $newType(0, $kindStruct, "mpeg2.Pmt", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(Table_id_, Section_syntax_indicator_, Section_length_, Program_number_, Version_number_, Current_next_indicator_, Section_number_, Last_section_number_, PCR_PID_, Program_info_length_, Streams_) {
181205
+ this.$val = this;
181206
+ if (arguments.length === 0) {
181207
+ this.Table_id = 0;
181208
+ this.Section_syntax_indicator = 0;
181209
+ this.Section_length = 0;
181210
+ this.Program_number = 0;
181211
+ this.Version_number = 0;
181212
+ this.Current_next_indicator = 0;
181213
+ this.Section_number = 0;
181214
+ this.Last_section_number = 0;
181215
+ this.PCR_PID = 0;
181216
+ this.Program_info_length = 0;
181217
+ this.Streams = sliceType$3.nil;
181218
+ return;
181219
+ }
181220
+ this.Table_id = Table_id_;
181221
+ this.Section_syntax_indicator = Section_syntax_indicator_;
181222
+ this.Section_length = Section_length_;
181223
+ this.Program_number = Program_number_;
181224
+ this.Version_number = Version_number_;
181225
+ this.Current_next_indicator = Current_next_indicator_;
181226
+ this.Section_number = Section_number_;
181227
+ this.Last_section_number = Last_section_number_;
181228
+ this.PCR_PID = PCR_PID_;
181229
+ this.Program_info_length = Program_info_length_;
181230
+ this.Streams = Streams_;
181231
+ });
181232
+ pes_stream = $pkg.pes_stream = $newType(0, $kindStruct, "mpeg2.pes_stream", true, "github.com/supraio/client-daemon/pkg/mpeg2", false, function(pid_, cc_, streamtype_) {
181233
+ this.$val = this;
181234
+ if (arguments.length === 0) {
181235
+ this.pid = 0;
181236
+ this.cc = 0;
181237
+ this.streamtype = 0;
181238
+ return;
181239
+ }
181240
+ this.pid = pid_;
181241
+ this.cc = cc_;
181242
+ this.streamtype = streamtype_;
181243
+ });
181244
+ table_pmt = $pkg.table_pmt = $newType(0, $kindStruct, "mpeg2.table_pmt", true, "github.com/supraio/client-daemon/pkg/mpeg2", false, function(pid_, cc_, pcr_pid_, version_number_, pm_, streams_) {
181245
+ this.$val = this;
181246
+ if (arguments.length === 0) {
181247
+ this.pid = 0;
181248
+ this.cc = 0;
181249
+ this.pcr_pid = 0;
181250
+ this.version_number = 0;
181251
+ this.pm = 0;
181252
+ this.streams = sliceType$4.nil;
181253
+ return;
181254
+ }
181255
+ this.pid = pid_;
181256
+ this.cc = cc_;
181257
+ this.pcr_pid = pcr_pid_;
181258
+ this.version_number = version_number_;
181259
+ this.pm = pm_;
181260
+ this.streams = streams_;
181261
+ });
181262
+ table_pat = $pkg.table_pat = $newType(0, $kindStruct, "mpeg2.table_pat", true, "github.com/supraio/client-daemon/pkg/mpeg2", false, function(cc_, version_number_, pmts_) {
181263
+ this.$val = this;
181264
+ if (arguments.length === 0) {
181265
+ this.cc = 0;
181266
+ this.version_number = 0;
181267
+ this.pmts = sliceType$5.nil;
181268
+ return;
181269
+ }
181270
+ this.cc = cc_;
181271
+ this.version_number = version_number_;
181272
+ this.pmts = pmts_;
181273
+ });
181274
+ TSMuxer = $pkg.TSMuxer = $newType(0, $kindStruct, "mpeg2.TSMuxer", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(pat_, stream_pid_, pmt_pid_, pat_period_, OnPacket_) {
181275
+ this.$val = this;
181276
+ if (arguments.length === 0) {
181277
+ this.pat = ptrType$3.nil;
181278
+ this.stream_pid = 0;
181279
+ this.pmt_pid = 0;
181280
+ this.pat_period = new $Uint64(0, 0);
181281
+ this.OnPacket = $throwNilPointerError;
181282
+ return;
181283
+ }
181284
+ this.pat = pat_;
181285
+ this.stream_pid = stream_pid_;
181286
+ this.pmt_pid = pmt_pid_;
181287
+ this.pat_period = pat_period_;
181288
+ this.OnPacket = OnPacket_;
181289
+ });
181290
+ needmoreError = $pkg.needmoreError = $newType(0, $kindStruct, "mpeg2.needmoreError", true, "github.com/supraio/client-daemon/pkg/mpeg2", false, function() {
181291
+ this.$val = this;
181292
+ if (arguments.length === 0) {
181293
+ return;
181294
+ }
181295
+ });
181296
+ parserError = $pkg.parserError = $newType(0, $kindStruct, "mpeg2.parserError", true, "github.com/supraio/client-daemon/pkg/mpeg2", false, function() {
181297
+ this.$val = this;
181298
+ if (arguments.length === 0) {
181299
+ return;
181300
+ }
181301
+ });
181302
+ PesPacket = $pkg.PesPacket = $newType(0, $kindStruct, "mpeg2.PesPacket", true, "github.com/supraio/client-daemon/pkg/mpeg2", true, function(Stream_id_, PES_packet_length_, PES_scrambling_control_, PES_priority_, Data_alignment_indicator_, Copyright_, Original_or_copy_, PTS_DTS_flags_, ESCR_flag_, ES_rate_flag_, DSM_trick_mode_flag_, Additional_copy_info_flag_, PES_CRC_flag_, PES_extension_flag_, PES_header_data_length_, Pts_, Dts_, ESCR_base_, ESCR_extension_, ES_rate_, Trick_mode_control_, Trick_value_, Additional_copy_info_, Previous_PES_packet_CRC_, Pes_payload_) {
181303
+ this.$val = this;
181304
+ if (arguments.length === 0) {
181305
+ this.Stream_id = 0;
181306
+ this.PES_packet_length = 0;
181307
+ this.PES_scrambling_control = 0;
181308
+ this.PES_priority = 0;
181309
+ this.Data_alignment_indicator = 0;
181310
+ this.Copyright = 0;
181311
+ this.Original_or_copy = 0;
181312
+ this.PTS_DTS_flags = 0;
181313
+ this.ESCR_flag = 0;
181314
+ this.ES_rate_flag = 0;
181315
+ this.DSM_trick_mode_flag = 0;
181316
+ this.Additional_copy_info_flag = 0;
181317
+ this.PES_CRC_flag = 0;
181318
+ this.PES_extension_flag = 0;
181319
+ this.PES_header_data_length = 0;
181320
+ this.Pts = new $Uint64(0, 0);
181321
+ this.Dts = new $Uint64(0, 0);
181322
+ this.ESCR_base = new $Uint64(0, 0);
181323
+ this.ESCR_extension = 0;
181324
+ this.ES_rate = 0;
181325
+ this.Trick_mode_control = 0;
181326
+ this.Trick_value = 0;
181327
+ this.Additional_copy_info = 0;
181328
+ this.Previous_PES_packet_CRC = 0;
181329
+ this.Pes_payload = sliceType.nil;
181330
+ return;
181331
+ }
181332
+ this.Stream_id = Stream_id_;
181333
+ this.PES_packet_length = PES_packet_length_;
181334
+ this.PES_scrambling_control = PES_scrambling_control_;
181335
+ this.PES_priority = PES_priority_;
181336
+ this.Data_alignment_indicator = Data_alignment_indicator_;
181337
+ this.Copyright = Copyright_;
181338
+ this.Original_or_copy = Original_or_copy_;
181339
+ this.PTS_DTS_flags = PTS_DTS_flags_;
181340
+ this.ESCR_flag = ESCR_flag_;
181341
+ this.ES_rate_flag = ES_rate_flag_;
181342
+ this.DSM_trick_mode_flag = DSM_trick_mode_flag_;
181343
+ this.Additional_copy_info_flag = Additional_copy_info_flag_;
181344
+ this.PES_CRC_flag = PES_CRC_flag_;
181345
+ this.PES_extension_flag = PES_extension_flag_;
181346
+ this.PES_header_data_length = PES_header_data_length_;
181347
+ this.Pts = Pts_;
181348
+ this.Dts = Dts_;
181349
+ this.ESCR_base = ESCR_base_;
181350
+ this.ESCR_extension = ESCR_extension_;
181351
+ this.ES_rate = ES_rate_;
181352
+ this.Trick_mode_control = Trick_mode_control_;
181353
+ this.Trick_value = Trick_value_;
181354
+ this.Additional_copy_info = Additional_copy_info_;
181355
+ this.Previous_PES_packet_CRC = Previous_PES_packet_CRC_;
181356
+ this.Pes_payload = Pes_payload_;
181357
+ });
181358
+ sliceType = $sliceType($Uint8);
181359
+ sliceType$1 = $sliceType($emptyInterface);
181360
+ ptrType = $ptrType(Adaptation_field);
181361
+ sliceType$2 = $sliceType(PmtPair);
181362
+ sliceType$3 = $sliceType(StreamPair);
181363
+ ptrType$1 = $ptrType(pes_stream);
181364
+ sliceType$4 = $sliceType(ptrType$1);
181365
+ ptrType$2 = $ptrType(table_pmt);
181366
+ sliceType$5 = $sliceType(ptrType$2);
181367
+ ptrType$3 = $ptrType(table_pat);
181368
+ ptrType$4 = $ptrType(PesPacket);
181369
+ ptrType$5 = $ptrType(Pat);
181370
+ ptrType$7 = $ptrType(Pmt);
181371
+ ptrType$18 = $ptrType(codec.BitStream);
181372
+ ptrType$20 = $ptrType(os.File);
181373
+ ptrType$21 = $ptrType(codec.BitStreamWriter);
181374
+ ptrType$22 = $ptrType(TSPacket);
181375
+ ptrType$23 = $ptrType(TSMuxer);
181376
+ funcType = $funcType([sliceType], [], false);
181377
+ ptrType$25 = $ptrType(needmoreError);
181378
+ ptrType$26 = $ptrType(parserError);
181379
+ TSPacket.ptr.prototype.PrettyPrint = function(file) {
181380
+ var {_r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, file, pkg, $s, $r, $c} = $restore(this, {file});
181381
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
181382
+ pkg = this;
181383
+ _r = fmt.Sprintf("Transport_error_indicator:%d\n", new sliceType$1([new $Uint8(pkg.Transport_error_indicator)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
181384
+ _r$1 = file.WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
181385
+ _r$1;
181386
+ _r$2 = fmt.Sprintf("Payload_unit_start_indicator:%d\n", new sliceType$1([new $Uint8(pkg.Payload_unit_start_indicator)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
181387
+ _r$3 = file.WriteString(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
181388
+ _r$3;
181389
+ _r$4 = fmt.Sprintf("Transport_priority:%d\n", new sliceType$1([new $Uint8(pkg.Transport_priority)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
181390
+ _r$5 = file.WriteString(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
181391
+ _r$5;
181392
+ _r$6 = fmt.Sprintf("PID:%d\n", new sliceType$1([new $Uint16(pkg.PID)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
181393
+ _r$7 = file.WriteString(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; }
181394
+ _r$7;
181395
+ _r$8 = fmt.Sprintf("Transport_scrambling_control:%d\n", new sliceType$1([new $Uint8(pkg.Transport_scrambling_control)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
181396
+ _r$9 = file.WriteString(_r$8); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
181397
+ _r$9;
181398
+ _r$10 = fmt.Sprintf("Adaptation_field_control:%d\n", new sliceType$1([new $Uint8(pkg.Adaptation_field_control)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
181399
+ _r$11 = file.WriteString(_r$10); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; }
181400
+ _r$11;
181401
+ _r$12 = fmt.Sprintf("Continuity_counter:%d\n", new sliceType$1([new $Uint8(pkg.Continuity_counter)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; }
181402
+ _r$13 = file.WriteString(_r$12); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; }
181403
+ _r$13;
181404
+ $s = -1; return;
181405
+ /* */ } return; } var $f = {$blk: TSPacket.ptr.prototype.PrettyPrint, $c: true, $r, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, file, pkg, $s};return $f;
181406
+ };
181407
+ TSPacket.prototype.PrettyPrint = function(file) { return this.$val.PrettyPrint(file); };
181408
+ TSPacket.ptr.prototype.EncodeHeader = function(bsw) {
181409
+ var bsw, pkg;
181410
+ pkg = this;
181411
+ bsw.PutByte(71);
181412
+ bsw.PutUint8(pkg.Transport_error_indicator, 1);
181413
+ bsw.PutUint8(pkg.Payload_unit_start_indicator, 1);
181414
+ bsw.PutUint8(pkg.Transport_priority, 1);
181415
+ bsw.PutUint16(pkg.PID, 13);
181416
+ bsw.PutUint8(pkg.Transport_scrambling_control, 2);
181417
+ bsw.PutUint8(pkg.Adaptation_field_control, 2);
181418
+ bsw.PutUint8(pkg.Continuity_counter, 4);
181419
+ if (!(pkg.Field === ptrType.nil) && !(((((pkg.Adaptation_field_control & 2) >>> 0)) === 0))) {
181420
+ pkg.Field.Encode(bsw);
181421
+ }
181422
+ };
181423
+ TSPacket.prototype.EncodeHeader = function(bsw) { return this.$val.EncodeHeader(bsw); };
181424
+ TSPacket.ptr.prototype.DecodeHeader = function(bs) {
181425
+ var bs, err, pkg, sync_byte;
181426
+ pkg = this;
181427
+ sync_byte = bs.Uint8(8);
181428
+ if (!((sync_byte === 71))) {
181429
+ return errors.New("ts packet must start with 0x47");
181430
+ }
181431
+ pkg.Transport_error_indicator = bs.GetBit();
181432
+ pkg.Payload_unit_start_indicator = bs.GetBit();
181433
+ pkg.Transport_priority = bs.GetBit();
181434
+ pkg.PID = bs.Uint16(13);
181435
+ pkg.Transport_scrambling_control = bs.Uint8(2);
181436
+ pkg.Adaptation_field_control = bs.Uint8(2);
181437
+ pkg.Continuity_counter = bs.Uint8(4);
181438
+ if (pkg.PID === 8191) {
181439
+ return $ifaceNil;
181440
+ }
181441
+ if ((pkg.Adaptation_field_control === 2) || (pkg.Adaptation_field_control === 3)) {
181442
+ if (pkg.Field === ptrType.nil) {
181443
+ pkg.Field = new Adaptation_field.ptr(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0, new $Uint64(0, 0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0);
181444
+ }
181445
+ err = pkg.Field.Decode(bs);
181446
+ if (!($interfaceIsEqual(err, $ifaceNil))) {
181447
+ return err;
181448
+ }
181449
+ }
181450
+ return $ifaceNil;
181451
+ };
181452
+ TSPacket.prototype.DecodeHeader = function(bs) { return this.$val.DecodeHeader(bs); };
181453
+ Adaptation_field.ptr.prototype.PrettyPrint = function(file) {
181454
+ var {_r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$5, _r$6, _r$7, _r$8, _r$9, adaptation, file, $s, $r, $c} = $restore(this, {file});
181455
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
181456
+ adaptation = this;
181457
+ _r = fmt.Sprintf("Adaptation_field_length:%d\n", new sliceType$1([new $Uint8(adaptation.Adaptation_field_length)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
181458
+ _r$1 = file.WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
181459
+ _r$1;
181460
+ _r$2 = fmt.Sprintf("Discontinuity_indicator:%d\n", new sliceType$1([new $Uint8(adaptation.Discontinuity_indicator)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
181461
+ _r$3 = file.WriteString(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
181462
+ _r$3;
181463
+ _r$4 = fmt.Sprintf("Random_access_indicator:%d\n", new sliceType$1([new $Uint8(adaptation.Random_access_indicator)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
181464
+ _r$5 = file.WriteString(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
181465
+ _r$5;
181466
+ _r$6 = fmt.Sprintf("Elementary_stream_priority_indicator:%d\n", new sliceType$1([new $Uint8(adaptation.Elementary_stream_priority_indicator)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
181467
+ _r$7 = file.WriteString(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; }
181468
+ _r$7;
181469
+ _r$8 = fmt.Sprintf("PCR_flag:%d\n", new sliceType$1([new $Uint8(adaptation.PCR_flag)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
181470
+ _r$9 = file.WriteString(_r$8); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
181471
+ _r$9;
181472
+ _r$10 = fmt.Sprintf("OPCR_flag:%d\n", new sliceType$1([new $Uint8(adaptation.OPCR_flag)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
181473
+ _r$11 = file.WriteString(_r$10); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; }
181474
+ _r$11;
181475
+ _r$12 = fmt.Sprintf("Splicing_point_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Splicing_point_flag)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; }
181476
+ _r$13 = file.WriteString(_r$12); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; }
181477
+ _r$13;
181478
+ _r$14 = fmt.Sprintf("Transport_private_data_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Transport_private_data_flag)])); /* */ $s = 15; case 15: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; }
181479
+ _r$15 = file.WriteString(_r$14); /* */ $s = 16; case 16: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; }
181480
+ _r$15;
181481
+ _r$16 = fmt.Sprintf("Adaptation_field_extension_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Adaptation_field_extension_flag)])); /* */ $s = 17; case 17: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; }
181482
+ _r$17 = file.WriteString(_r$16); /* */ $s = 18; case 18: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; }
181483
+ _r$17;
181484
+ /* */ if (adaptation.PCR_flag === 1) { $s = 19; continue; }
181485
+ /* */ $s = 20; continue;
181486
+ /* if (adaptation.PCR_flag === 1) { */ case 19:
181487
+ _r$18 = fmt.Sprintf("Program_clock_reference_base:%d\n", new sliceType$1([adaptation.Program_clock_reference_base])); /* */ $s = 21; case 21: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; }
181488
+ _r$19 = file.WriteString(_r$18); /* */ $s = 22; case 22: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; }
181489
+ _r$19;
181490
+ _r$20 = fmt.Sprintf("Program_clock_reference_extension:%d\n", new sliceType$1([new $Uint16(adaptation.Program_clock_reference_extension)])); /* */ $s = 23; case 23: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; }
181491
+ _r$21 = file.WriteString(_r$20); /* */ $s = 24; case 24: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; }
181492
+ _r$21;
181493
+ /* } */ case 20:
181494
+ /* */ if (adaptation.OPCR_flag === 1) { $s = 25; continue; }
181495
+ /* */ $s = 26; continue;
181496
+ /* if (adaptation.OPCR_flag === 1) { */ case 25:
181497
+ _r$22 = fmt.Sprintf("Original_program_clock_reference_base:%d\n", new sliceType$1([adaptation.Original_program_clock_reference_base])); /* */ $s = 27; case 27: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; }
181498
+ _r$23 = file.WriteString(_r$22); /* */ $s = 28; case 28: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; }
181499
+ _r$23;
181500
+ _r$24 = fmt.Sprintf("Original_program_clock_reference_extension:%d\n", new sliceType$1([new $Uint16(adaptation.Original_program_clock_reference_extension)])); /* */ $s = 29; case 29: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; }
181501
+ _r$25 = file.WriteString(_r$24); /* */ $s = 30; case 30: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; }
181502
+ _r$25;
181503
+ /* } */ case 26:
181504
+ /* */ if (adaptation.Splicing_point_flag === 1) { $s = 31; continue; }
181505
+ /* */ $s = 32; continue;
181506
+ /* if (adaptation.Splicing_point_flag === 1) { */ case 31:
181507
+ _r$26 = fmt.Sprintf("Splice_countdown:%d\n", new sliceType$1([new $Uint8(adaptation.Splice_countdown)])); /* */ $s = 33; case 33: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; }
181508
+ _r$27 = file.WriteString(_r$26); /* */ $s = 34; case 34: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; }
181509
+ _r$27;
181510
+ /* } */ case 32:
181511
+ /* */ if (adaptation.Transport_private_data_flag === 1) { $s = 35; continue; }
181512
+ /* */ $s = 36; continue;
181513
+ /* if (adaptation.Transport_private_data_flag === 1) { */ case 35:
181514
+ _r$28 = fmt.Sprintf("Transport_private_data_length:%d\n", new sliceType$1([new $Uint8(adaptation.Transport_private_data_length)])); /* */ $s = 37; case 37: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; }
181515
+ _r$29 = file.WriteString(_r$28); /* */ $s = 38; case 38: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; }
181516
+ _r$29;
181517
+ /* } */ case 36:
181518
+ /* */ if (adaptation.Adaptation_field_extension_flag === 1) { $s = 39; continue; }
181519
+ /* */ $s = 40; continue;
181520
+ /* if (adaptation.Adaptation_field_extension_flag === 1) { */ case 39:
181521
+ _r$30 = fmt.Sprintf("Adaptation_field_extension_length:%d\n", new sliceType$1([new $Uint8(adaptation.Adaptation_field_extension_length)])); /* */ $s = 41; case 41: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; }
181522
+ _r$31 = file.WriteString(_r$30); /* */ $s = 42; case 42: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; }
181523
+ _r$31;
181524
+ _r$32 = fmt.Sprintf("Ltw_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Ltw_flag)])); /* */ $s = 43; case 43: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; }
181525
+ _r$33 = file.WriteString(_r$32); /* */ $s = 44; case 44: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; }
181526
+ _r$33;
181527
+ _r$34 = fmt.Sprintf("Piecewise_rate_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Piecewise_rate_flag)])); /* */ $s = 45; case 45: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; }
181528
+ _r$35 = file.WriteString(_r$34); /* */ $s = 46; case 46: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; }
181529
+ _r$35;
181530
+ _r$36 = fmt.Sprintf("Seamless_splice_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Seamless_splice_flag)])); /* */ $s = 47; case 47: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; }
181531
+ _r$37 = file.WriteString(_r$36); /* */ $s = 48; case 48: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; }
181532
+ _r$37;
181533
+ /* */ if (adaptation.Ltw_flag === 1) { $s = 49; continue; }
181534
+ /* */ $s = 50; continue;
181535
+ /* if (adaptation.Ltw_flag === 1) { */ case 49:
181536
+ _r$38 = fmt.Sprintf("Ltw_valid_flag:%d\n", new sliceType$1([new $Uint8(adaptation.Ltw_valid_flag)])); /* */ $s = 51; case 51: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; }
181537
+ _r$39 = file.WriteString(_r$38); /* */ $s = 52; case 52: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; }
181538
+ _r$39;
181539
+ _r$40 = fmt.Sprintf("Ltw_offset:%d\n", new sliceType$1([new $Uint16(adaptation.Ltw_offset)])); /* */ $s = 53; case 53: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; }
181540
+ _r$41 = file.WriteString(_r$40); /* */ $s = 54; case 54: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; }
181541
+ _r$41;
181542
+ /* } */ case 50:
181543
+ /* */ if (adaptation.Piecewise_rate_flag === 1) { $s = 55; continue; }
181544
+ /* */ $s = 56; continue;
181545
+ /* if (adaptation.Piecewise_rate_flag === 1) { */ case 55:
181546
+ _r$42 = fmt.Sprintf("Piecewise_rate:%d\n", new sliceType$1([new $Uint32(adaptation.Piecewise_rate)])); /* */ $s = 57; case 57: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; }
181547
+ _r$43 = file.WriteString(_r$42); /* */ $s = 58; case 58: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; }
181548
+ _r$43;
181549
+ /* } */ case 56:
181550
+ /* */ if (adaptation.Seamless_splice_flag === 1) { $s = 59; continue; }
181551
+ /* */ $s = 60; continue;
181552
+ /* if (adaptation.Seamless_splice_flag === 1) { */ case 59:
181553
+ _r$44 = fmt.Sprintf("Splice_type:%d\n", new sliceType$1([new $Uint8(adaptation.Splice_type)])); /* */ $s = 61; case 61: if($c) { $c = false; _r$44 = _r$44.$blk(); } if (_r$44 && _r$44.$blk !== undefined) { break s; }
181554
+ _r$45 = file.WriteString(_r$44); /* */ $s = 62; case 62: if($c) { $c = false; _r$45 = _r$45.$blk(); } if (_r$45 && _r$45.$blk !== undefined) { break s; }
181555
+ _r$45;
181556
+ _r$46 = fmt.Sprintf("DTS_next_AU:%d\n", new sliceType$1([adaptation.DTS_next_AU])); /* */ $s = 63; case 63: if($c) { $c = false; _r$46 = _r$46.$blk(); } if (_r$46 && _r$46.$blk !== undefined) { break s; }
181557
+ _r$47 = file.WriteString(_r$46); /* */ $s = 64; case 64: if($c) { $c = false; _r$47 = _r$47.$blk(); } if (_r$47 && _r$47.$blk !== undefined) { break s; }
181558
+ _r$47;
181559
+ /* } */ case 60:
181560
+ /* } */ case 40:
181561
+ $s = -1; return;
181562
+ /* */ } return; } var $f = {$blk: Adaptation_field.ptr.prototype.PrettyPrint, $c: true, $r, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$5, _r$6, _r$7, _r$8, _r$9, adaptation, file, $s};return $f;
181563
+ };
181564
+ Adaptation_field.prototype.PrettyPrint = function(file) { return this.$val.PrettyPrint(file); };
181565
+ Adaptation_field.ptr.prototype.Encode = function(bsw) {
181566
+ var _q, adaptation, bsw, loc;
181567
+ adaptation = this;
181568
+ loc = bsw.ByteOffset();
181569
+ bsw.PutUint8(adaptation.Adaptation_field_length, 8);
181570
+ if (adaptation.SingleStuffingByte) {
181571
+ return;
181572
+ }
181573
+ bsw.Markdot();
181574
+ bsw.PutUint8(adaptation.Discontinuity_indicator, 1);
181575
+ bsw.PutUint8(adaptation.Random_access_indicator, 1);
181576
+ bsw.PutUint8(adaptation.Elementary_stream_priority_indicator, 1);
181577
+ bsw.PutUint8(adaptation.PCR_flag, 1);
181578
+ bsw.PutUint8(adaptation.OPCR_flag, 1);
181579
+ bsw.PutUint8(adaptation.Splicing_point_flag, 1);
181580
+ bsw.PutUint8(0, 1);
181581
+ bsw.PutUint8(0, 1);
181582
+ if (adaptation.PCR_flag === 1) {
181583
+ bsw.PutUint64(adaptation.Program_clock_reference_base, 33);
181584
+ bsw.PutUint8(0, 6);
181585
+ bsw.PutUint16(adaptation.Program_clock_reference_extension, 9);
181586
+ }
181587
+ if (adaptation.OPCR_flag === 1) {
181588
+ bsw.PutUint64(adaptation.Original_program_clock_reference_base, 33);
181589
+ bsw.PutUint8(0, 6);
181590
+ bsw.PutUint16(adaptation.Original_program_clock_reference_extension, 9);
181591
+ }
181592
+ if (adaptation.Splicing_point_flag === 1) {
181593
+ bsw.PutUint8(adaptation.Splice_countdown, 8);
181594
+ }
181595
+ adaptation.Adaptation_field_length = (((_q = bsw.DistanceFromMarkDot() / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero")) << 24 >>> 24));
181596
+ bsw.PutRepetValue(255, ((adaptation.Stuffing_byte >> 0)));
181597
+ adaptation.Adaptation_field_length = adaptation.Adaptation_field_length + (adaptation.Stuffing_byte) << 24 >>> 24;
181598
+ bsw.SetByte(adaptation.Adaptation_field_length, loc);
181599
+ };
181600
+ Adaptation_field.prototype.Encode = function(bsw) { return this.$val.Encode(bsw); };
181601
+ Adaptation_field.ptr.prototype.Decode = function(bs) {
181602
+ var _r, adaptation, bitscount, bs, endoffset, startoffset, x, x$1, x$2, x$3;
181603
+ adaptation = this;
181604
+ if (bs.RemainBytes() < 1) {
181605
+ return errors.New("len of data < 1 byte");
181606
+ }
181607
+ adaptation.Adaptation_field_length = bs.Uint8(8);
181608
+ startoffset = bs.ByteOffset();
181609
+ if (bs.RemainBytes() < ((adaptation.Adaptation_field_length >> 0))) {
181610
+ return errors.New("len of data < Adaptation_field_length");
181611
+ }
181612
+ if (adaptation.Adaptation_field_length === 0) {
181613
+ return $ifaceNil;
181614
+ }
181615
+ adaptation.Discontinuity_indicator = bs.GetBit();
181616
+ adaptation.Random_access_indicator = bs.GetBit();
181617
+ adaptation.Elementary_stream_priority_indicator = bs.GetBit();
181618
+ adaptation.PCR_flag = bs.GetBit();
181619
+ adaptation.OPCR_flag = bs.GetBit();
181620
+ adaptation.Splicing_point_flag = bs.GetBit();
181621
+ adaptation.Transport_private_data_flag = bs.GetBit();
181622
+ adaptation.Adaptation_field_extension_flag = bs.GetBit();
181623
+ if (adaptation.PCR_flag === 1) {
181624
+ adaptation.Program_clock_reference_base = bs.GetBits(33);
181625
+ bs.SkipBits(6);
181626
+ adaptation.Program_clock_reference_extension = ((bs.GetBits(9).$low << 16 >>> 16));
181627
+ }
181628
+ if (adaptation.OPCR_flag === 1) {
181629
+ adaptation.Original_program_clock_reference_base = bs.GetBits(33);
181630
+ bs.SkipBits(6);
181631
+ adaptation.Original_program_clock_reference_extension = ((bs.GetBits(9).$low << 16 >>> 16));
181632
+ }
181633
+ if (adaptation.Splicing_point_flag === 1) {
181634
+ adaptation.Splice_countdown = bs.Uint8(8);
181635
+ }
181636
+ if (adaptation.Transport_private_data_flag === 1) {
181637
+ adaptation.Transport_private_data_length = bs.Uint8(8);
181638
+ bs.SkipBits($imul(8, ((adaptation.Transport_private_data_length >> 0))));
181639
+ }
181640
+ if (adaptation.Adaptation_field_extension_flag === 1) {
181641
+ adaptation.Adaptation_field_extension_length = bs.Uint8(8);
181642
+ bs.Markdot();
181643
+ adaptation.Ltw_flag = bs.GetBit();
181644
+ adaptation.Piecewise_rate_flag = bs.GetBit();
181645
+ adaptation.Seamless_splice_flag = bs.GetBit();
181646
+ bs.SkipBits(5);
181647
+ if (adaptation.Ltw_flag === 1) {
181648
+ adaptation.Ltw_valid_flag = bs.GetBit();
181649
+ adaptation.Ltw_offset = ((bs.GetBits(15).$low << 16 >>> 16));
181650
+ }
181651
+ if (adaptation.Piecewise_rate_flag === 1) {
181652
+ bs.SkipBits(2);
181653
+ adaptation.Piecewise_rate = ((bs.GetBits(22).$low >>> 0));
181654
+ }
181655
+ if (adaptation.Seamless_splice_flag === 1) {
181656
+ adaptation.Splice_type = ((bs.GetBits(4).$low << 24 >>> 24));
181657
+ adaptation.DTS_next_AU = bs.GetBits(3);
181658
+ bs.SkipBits(1);
181659
+ adaptation.DTS_next_AU = (x = $shiftLeft64(adaptation.DTS_next_AU, 15), x$1 = bs.GetBits(15), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0));
181660
+ bs.SkipBits(1);
181661
+ adaptation.DTS_next_AU = (x$2 = $shiftLeft64(adaptation.DTS_next_AU, 15), x$3 = bs.GetBits(15), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0));
181662
+ bs.SkipBits(1);
181663
+ }
181664
+ bitscount = bs.DistanceFromMarkDot();
181665
+ if ((_r = bitscount % 8, _r === _r ? _r : $throwRuntimeError("integer divide by zero")) > 0) {
181666
+ $panic(new $String("maybe parser ts file failed"));
181667
+ }
181668
+ bs.SkipBits(((((adaptation.Adaptation_field_extension_length * 8 << 24 >>> 24) - ((bitscount << 24 >>> 24)) << 24 >>> 24) >> 0)));
181669
+ }
181670
+ endoffset = bs.ByteOffset();
181671
+ bs.SkipBits($imul(((((adaptation.Adaptation_field_length >> 0)) - ((endoffset - startoffset >> 0)) >> 0)), 8));
181672
+ return $ifaceNil;
181673
+ };
181674
+ Adaptation_field.prototype.Decode = function(bs) { return this.$val.Decode(bs); };
181675
+ NewPat = function() {
181676
+ return new Pat.ptr(0, 1, 0, 0, 0, 1, 0, 0, $makeSlice(sliceType$2, 0, 8));
181677
+ };
181678
+ $pkg.NewPat = NewPat;
181679
+ Pat.ptr.prototype.PrettyPrint = function(file) {
181680
+ var {_i, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, file, i, pat, pmt, $s, $r, $c} = $restore(this, {file});
181681
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
181682
+ pat = this;
181683
+ _r = fmt.Sprintf("Table id:%d\n", new sliceType$1([new $Uint8(pat.Table_id)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
181684
+ _r$1 = file.WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
181685
+ _r$1;
181686
+ _r$2 = fmt.Sprintf("Section_syntax_indicator:%d\n", new sliceType$1([new $Uint8(pat.Section_syntax_indicator)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
181687
+ _r$3 = file.WriteString(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
181688
+ _r$3;
181689
+ _r$4 = fmt.Sprintf("Section_length:%d\n", new sliceType$1([new $Uint16(pat.Section_length)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
181690
+ _r$5 = file.WriteString(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
181691
+ _r$5;
181692
+ _r$6 = fmt.Sprintf("Transport_stream_id:%d\n", new sliceType$1([new $Uint16(pat.Transport_stream_id)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
181693
+ _r$7 = file.WriteString(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; }
181694
+ _r$7;
181695
+ _r$8 = fmt.Sprintf("Version_number:%d\n", new sliceType$1([new $Uint8(pat.Version_number)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
181696
+ _r$9 = file.WriteString(_r$8); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
181697
+ _r$9;
181698
+ _r$10 = fmt.Sprintf("Current_next_indicator:%d\n", new sliceType$1([new $Uint8(pat.Current_next_indicator)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
181699
+ _r$11 = file.WriteString(_r$10); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; }
181700
+ _r$11;
181701
+ _r$12 = fmt.Sprintf("Section_number:%d\n", new sliceType$1([new $Uint8(pat.Section_number)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; }
181702
+ _r$13 = file.WriteString(_r$12); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; }
181703
+ _r$13;
181704
+ _r$14 = fmt.Sprintf("Last_section_number:%d\n", new sliceType$1([new $Uint8(pat.Last_section_number)])); /* */ $s = 15; case 15: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; }
181705
+ _r$15 = file.WriteString(_r$14); /* */ $s = 16; case 16: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; }
181706
+ _r$15;
181707
+ _ref = pat.Pmts;
181708
+ _i = 0;
181709
+ /* while (true) { */ case 17:
181710
+ /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 18; continue; }
181711
+ i = _i;
181712
+ pmt = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), PmtPair);
181713
+ _r$16 = fmt.Sprintf("----pmt %d\n", new sliceType$1([new $Int(i)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; }
181714
+ _r$17 = file.WriteString(_r$16); /* */ $s = 20; case 20: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; }
181715
+ _r$17;
181716
+ _r$18 = fmt.Sprintf(" program_number:%d\n", new sliceType$1([new $Uint16(pmt.Program_number)])); /* */ $s = 21; case 21: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; }
181717
+ _r$19 = file.WriteString(_r$18); /* */ $s = 22; case 22: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; }
181718
+ _r$19;
181719
+ /* */ if (pmt.Program_number === 0) { $s = 23; continue; }
181720
+ /* */ $s = 24; continue;
181721
+ /* if (pmt.Program_number === 0) { */ case 23:
181722
+ _r$20 = fmt.Sprintf(" network_PID:%d\n", new sliceType$1([new $Uint16(pmt.PID)])); /* */ $s = 26; case 26: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; }
181723
+ _r$21 = file.WriteString(_r$20); /* */ $s = 27; case 27: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; }
181724
+ _r$21;
181725
+ $s = 25; continue;
181726
+ /* } else { */ case 24:
181727
+ _r$22 = fmt.Sprintf(" program_map_PID:%d\n", new sliceType$1([new $Uint16(pmt.PID)])); /* */ $s = 28; case 28: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; }
181728
+ _r$23 = file.WriteString(_r$22); /* */ $s = 29; case 29: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; }
181729
+ _r$23;
181730
+ /* } */ case 25:
181731
+ _i++;
181732
+ $s = 17; continue;
181733
+ case 18:
181734
+ $s = -1; return;
181735
+ /* */ } return; } var $f = {$blk: Pat.ptr.prototype.PrettyPrint, $c: true, $r, _i, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, file, i, pat, pmt, $s};return $f;
181736
+ };
181737
+ Pat.prototype.PrettyPrint = function(file) { return this.$val.PrettyPrint(file); };
181738
+ Pat.ptr.prototype.Encode = function(bsw) {
181739
+ var _i, _q, _ref, bsw, crc, length, loc, pat, pms, tmpcrc;
181740
+ pat = this;
181741
+ bsw.PutUint8(0, 8);
181742
+ loc = bsw.ByteOffset();
181743
+ bsw.PutUint8(pat.Section_syntax_indicator, 1);
181744
+ bsw.PutUint8(0, 1);
181745
+ bsw.PutUint8(3, 2);
181746
+ bsw.PutUint16(0, 12);
181747
+ bsw.Markdot();
181748
+ bsw.PutUint16(pat.Transport_stream_id, 16);
181749
+ bsw.PutUint8(3, 2);
181750
+ bsw.PutUint8(pat.Version_number, 5);
181751
+ bsw.PutUint8(pat.Current_next_indicator, 1);
181752
+ bsw.PutUint8(pat.Section_number, 8);
181753
+ bsw.PutUint8(pat.Last_section_number, 8);
181754
+ _ref = pat.Pmts;
181755
+ _i = 0;
181756
+ while (true) {
181757
+ if (!(_i < _ref.$length)) { break; }
181758
+ pms = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), PmtPair);
181759
+ bsw.PutUint16(pms.Program_number, 16);
181760
+ bsw.PutUint8(7, 3);
181761
+ bsw.PutUint16(pms.PID, 13);
181762
+ _i++;
181763
+ }
181764
+ length = bsw.DistanceFromMarkDot();
181765
+ pat.Section_length = (_q = ((length << 16 >>> 16)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) + 4 << 16 >>> 16;
181766
+ bsw.SetUint16((((((pat.Section_length & 4095) >>> 0) | ((((pat.Section_syntax_indicator << 16 >>> 16)) << 15 << 16 >>> 16))) >>> 0) | 12288) >>> 0, loc);
181767
+ crc = codec.CalcCrc32(4294967295, $subslice(bsw.Bits(), ((bsw.ByteOffset() - (((pat.Section_length - 4 << 16 >>> 16) >> 0)) >> 0) - 3 >> 0), bsw.ByteOffset()));
181768
+ tmpcrc = $makeSlice(sliceType, 4);
181769
+ $clone(binary.LittleEndian, binary.littleEndian).PutUint32(tmpcrc, crc);
181770
+ bsw.PutBytes(tmpcrc);
181771
+ };
181772
+ Pat.prototype.Encode = function(bsw) { return this.$val.Encode(bsw); };
181773
+ Pat.ptr.prototype.Decode = function(bs) {
181774
+ var bs, i, pat, tmp;
181775
+ pat = this;
181776
+ pat.Table_id = bs.Uint8(8);
181777
+ if (!((pat.Table_id === 0))) {
181778
+ return errors.New("table id is Not TS_TID_PAS");
181779
+ }
181780
+ pat.Section_syntax_indicator = bs.Uint8(1);
181781
+ bs.SkipBits(3);
181782
+ pat.Section_length = bs.Uint16(12);
181783
+ pat.Transport_stream_id = bs.Uint16(16);
181784
+ bs.SkipBits(2);
181785
+ pat.Version_number = bs.Uint8(5);
181786
+ pat.Current_next_indicator = bs.Uint8(1);
181787
+ pat.Section_number = bs.Uint8(8);
181788
+ pat.Last_section_number = bs.Uint8(8);
181789
+ i = 0;
181790
+ while (true) {
181791
+ if (!((i + 4 >> 0) <= ((((pat.Section_length >> 0)) - 5 >> 0) - 4 >> 0))) { break; }
181792
+ tmp = new PmtPair.ptr(0, 0);
181793
+ tmp.Program_number = bs.Uint16(16);
181794
+ bs.SkipBits(3);
181795
+ tmp.PID = bs.Uint16(13);
181796
+ pat.Pmts = $append(pat.Pmts, tmp);
181797
+ i = i + 4 >> 0;
181798
+ }
181799
+ return $ifaceNil;
181800
+ };
181801
+ Pat.prototype.Decode = function(bs) { return this.$val.Decode(bs); };
181802
+ NewPmt = function() {
181803
+ return new Pmt.ptr(2, 1, 0, 0, 0, 1, 0, 0, 0, 0, $makeSlice(sliceType$3, 0, 8));
181804
+ };
181805
+ $pkg.NewPmt = NewPmt;
181806
+ Pmt.ptr.prototype.PrettyPrint = function(file) {
181807
+ var {_i, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, file, i, pmt, stream, $s, $r, $c} = $restore(this, {file});
181808
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
181809
+ pmt = this;
181810
+ _r = fmt.Sprintf("Table id:%d\n", new sliceType$1([new $Uint8(pmt.Table_id)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
181811
+ _r$1 = file.WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
181812
+ _r$1;
181813
+ _r$2 = fmt.Sprintf("Section_syntax_indicator:%d\n", new sliceType$1([new $Uint8(pmt.Section_syntax_indicator)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
181814
+ _r$3 = file.WriteString(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
181815
+ _r$3;
181816
+ _r$4 = fmt.Sprintf("Section_length:%d\n", new sliceType$1([new $Uint16(pmt.Section_length)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
181817
+ _r$5 = file.WriteString(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
181818
+ _r$5;
181819
+ _r$6 = fmt.Sprintf("Program_number:%d\n", new sliceType$1([new $Uint16(pmt.Program_number)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
181820
+ _r$7 = file.WriteString(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; }
181821
+ _r$7;
181822
+ _r$8 = fmt.Sprintf("Version_number:%d\n", new sliceType$1([new $Uint8(pmt.Version_number)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
181823
+ _r$9 = file.WriteString(_r$8); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
181824
+ _r$9;
181825
+ _r$10 = fmt.Sprintf("Current_next_indicator:%d\n", new sliceType$1([new $Uint8(pmt.Current_next_indicator)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
181826
+ _r$11 = file.WriteString(_r$10); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; }
181827
+ _r$11;
181828
+ _r$12 = fmt.Sprintf("Section_number:%d\n", new sliceType$1([new $Uint8(pmt.Section_number)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; }
181829
+ _r$13 = file.WriteString(_r$12); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; }
181830
+ _r$13;
181831
+ _r$14 = fmt.Sprintf("Last_section_number:%d\n", new sliceType$1([new $Uint8(pmt.Last_section_number)])); /* */ $s = 15; case 15: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; }
181832
+ _r$15 = file.WriteString(_r$14); /* */ $s = 16; case 16: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; }
181833
+ _r$15;
181834
+ _r$16 = fmt.Sprintf("PCR_PID:%d\n", new sliceType$1([new $Uint16(pmt.PCR_PID)])); /* */ $s = 17; case 17: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; }
181835
+ _r$17 = file.WriteString(_r$16); /* */ $s = 18; case 18: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; }
181836
+ _r$17;
181837
+ _r$18 = fmt.Sprintf("program_info_length:%d\n", new sliceType$1([new $Uint16(pmt.Program_info_length)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; }
181838
+ _r$19 = file.WriteString(_r$18); /* */ $s = 20; case 20: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; }
181839
+ _r$19;
181840
+ _ref = pmt.Streams;
181841
+ _i = 0;
181842
+ /* while (true) { */ case 21:
181843
+ /* if (!(_i < _ref.$length)) { break; } */ if(!(_i < _ref.$length)) { $s = 22; continue; }
181844
+ i = _i;
181845
+ stream = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), StreamPair);
181846
+ _r$20 = fmt.Sprintf("----stream %d\n", new sliceType$1([new $Int(i)])); /* */ $s = 23; case 23: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; }
181847
+ _r$21 = file.WriteString(_r$20); /* */ $s = 24; case 24: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; }
181848
+ _r$21;
181849
+ /* */ if (stream.StreamType === 15) { $s = 25; continue; }
181850
+ /* */ if (stream.StreamType === 3) { $s = 26; continue; }
181851
+ /* */ if (stream.StreamType === 4) { $s = 27; continue; }
181852
+ /* */ if (stream.StreamType === 27) { $s = 28; continue; }
181853
+ /* */ if (stream.StreamType === 36) { $s = 29; continue; }
181854
+ /* */ $s = 30; continue;
181855
+ /* if (stream.StreamType === 15) { */ case 25:
181856
+ _r$22 = file.WriteString(" stream_type:AAC\n"); /* */ $s = 32; case 32: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; }
181857
+ _r$22;
181858
+ $s = 31; continue;
181859
+ /* } else if (stream.StreamType === 3) { */ case 26:
181860
+ _r$23 = file.WriteString(" stream_type:MPEG1\n"); /* */ $s = 33; case 33: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; }
181861
+ _r$23;
181862
+ $s = 31; continue;
181863
+ /* } else if (stream.StreamType === 4) { */ case 27:
181864
+ _r$24 = file.WriteString(" stream_type:MPEG2,mp3\n"); /* */ $s = 34; case 34: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; }
181865
+ _r$24;
181866
+ $s = 31; continue;
181867
+ /* } else if (stream.StreamType === 27) { */ case 28:
181868
+ _r$25 = file.WriteString(" stream_type:H264\n"); /* */ $s = 35; case 35: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; }
181869
+ _r$25;
181870
+ $s = 31; continue;
181871
+ /* } else if (stream.StreamType === 36) { */ case 29:
181872
+ _r$26 = file.WriteString(" stream_type:H265\n"); /* */ $s = 36; case 36: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; }
181873
+ _r$26;
181874
+ $s = 31; continue;
181875
+ /* } else { */ case 30:
181876
+ _r$27 = fmt.Sprintf(" stream_type:UnSupport streamtype:%d\n", new sliceType$1([new $Uint8(stream.StreamType)])); /* */ $s = 37; case 37: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; }
181877
+ _r$28 = file.WriteString(_r$27); /* */ $s = 38; case 38: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; }
181878
+ _r$28;
181879
+ /* } */ case 31:
181880
+ _r$29 = fmt.Sprintf(" elementary_PID:%d\n", new sliceType$1([new $Uint16(stream.Elementary_PID)])); /* */ $s = 39; case 39: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; }
181881
+ _r$30 = file.WriteString(_r$29); /* */ $s = 40; case 40: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; }
181882
+ _r$30;
181883
+ _r$31 = fmt.Sprintf(" ES_info_length:%d\n", new sliceType$1([new $Uint16(stream.ES_Info_Length)])); /* */ $s = 41; case 41: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; }
181884
+ _r$32 = file.WriteString(_r$31); /* */ $s = 42; case 42: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; }
181885
+ _r$32;
181886
+ _i++;
181887
+ $s = 21; continue;
181888
+ case 22:
181889
+ $s = -1; return;
181890
+ /* */ } return; } var $f = {$blk: Pmt.ptr.prototype.PrettyPrint, $c: true, $r, _i, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _ref, file, i, pmt, stream, $s};return $f;
181891
+ };
181892
+ Pmt.prototype.PrettyPrint = function(file) { return this.$val.PrettyPrint(file); };
181893
+ Pmt.ptr.prototype.Encode = function(bsw) {
181894
+ var _i, _q, _ref, bsw, crc, length, loc, pmt, stream, tmpcrc;
181895
+ pmt = this;
181896
+ bsw.PutUint8(pmt.Table_id, 8);
181897
+ loc = bsw.ByteOffset();
181898
+ bsw.PutUint8(pmt.Section_syntax_indicator, 1);
181899
+ bsw.PutUint8(0, 1);
181900
+ bsw.PutUint8(3, 2);
181901
+ bsw.PutUint16(pmt.Section_length, 12);
181902
+ bsw.Markdot();
181903
+ bsw.PutUint16(pmt.Program_number, 16);
181904
+ bsw.PutUint8(3, 2);
181905
+ bsw.PutUint8(pmt.Version_number, 5);
181906
+ bsw.PutUint8(pmt.Current_next_indicator, 1);
181907
+ bsw.PutUint8(pmt.Section_number, 8);
181908
+ bsw.PutUint8(pmt.Last_section_number, 8);
181909
+ bsw.PutUint8(7, 3);
181910
+ bsw.PutUint16(pmt.PCR_PID, 13);
181911
+ bsw.PutUint8(15, 4);
181912
+ bsw.PutUint16(0, 12);
181913
+ _ref = pmt.Streams;
181914
+ _i = 0;
181915
+ while (true) {
181916
+ if (!(_i < _ref.$length)) { break; }
181917
+ stream = $clone(((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]), StreamPair);
181918
+ bsw.PutUint8(stream.StreamType, 8);
181919
+ bsw.PutUint8(0, 3);
181920
+ bsw.PutUint16(stream.Elementary_PID, 13);
181921
+ bsw.PutUint8(0, 4);
181922
+ bsw.PutUint8(0, 12);
181923
+ _i++;
181924
+ }
181925
+ length = bsw.DistanceFromMarkDot();
181926
+ pmt.Section_length = (_q = ((length << 16 >>> 16)) / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >>> 0 : $throwRuntimeError("integer divide by zero")) + 4 << 16 >>> 16;
181927
+ bsw.SetUint16((((((pmt.Section_length & 4095) >>> 0) | ((((pmt.Section_syntax_indicator << 16 >>> 16)) << 15 << 16 >>> 16))) >>> 0) | 12288) >>> 0, loc);
181928
+ crc = codec.CalcCrc32(4294967295, $subslice(bsw.Bits(), ((bsw.ByteOffset() - (((pmt.Section_length - 4 << 16 >>> 16) >> 0)) >> 0) - 3 >> 0), bsw.ByteOffset()));
181929
+ tmpcrc = $makeSlice(sliceType, 4);
181930
+ $clone(binary.LittleEndian, binary.littleEndian).PutUint32(tmpcrc, crc);
181931
+ bsw.PutBytes(tmpcrc);
181932
+ };
181933
+ Pmt.prototype.Encode = function(bsw) { return this.$val.Encode(bsw); };
181934
+ Pmt.ptr.prototype.Decode = function(bs) {
181935
+ var bs, i, pmt, tmp;
181936
+ pmt = this;
181937
+ pmt.Table_id = bs.Uint8(8);
181938
+ if (!((pmt.Table_id === 2))) {
181939
+ return errors.New("table id is Not TS_TID_PAS");
181940
+ }
181941
+ pmt.Section_syntax_indicator = bs.Uint8(1);
181942
+ bs.SkipBits(3);
181943
+ pmt.Section_length = bs.Uint16(12);
181944
+ pmt.Program_number = bs.Uint16(16);
181945
+ bs.SkipBits(2);
181946
+ pmt.Version_number = bs.Uint8(5);
181947
+ pmt.Current_next_indicator = bs.Uint8(1);
181948
+ pmt.Section_number = bs.Uint8(8);
181949
+ pmt.Last_section_number = bs.Uint8(8);
181950
+ bs.SkipBits(3);
181951
+ pmt.PCR_PID = bs.Uint16(13);
181952
+ bs.SkipBits(4);
181953
+ pmt.Program_info_length = bs.Uint16(12);
181954
+ bs.SkipBits($imul(((pmt.Program_info_length >> 0)), 8));
181955
+ i = 0;
181956
+ while (true) {
181957
+ if (!(i < (((((pmt.Section_length >> 0)) - 9 >> 0) - ((pmt.Program_info_length >> 0)) >> 0) - 4 >> 0))) { break; }
181958
+ tmp = new StreamPair.ptr(0, 0, 0);
181959
+ tmp.StreamType = bs.Uint8(8);
181960
+ bs.SkipBits(3);
181961
+ tmp.Elementary_PID = bs.Uint16(13);
181962
+ bs.SkipBits(4);
181963
+ tmp.ES_Info_Length = bs.Uint16(12);
181964
+ bs.SkipBits($imul(((tmp.ES_Info_Length >> 0)), 8));
181965
+ pmt.Streams = $append(pmt.Streams, tmp);
181966
+ i = i + ((5 + ((tmp.ES_Info_Length >> 0)) >> 0)) >> 0;
181967
+ }
181968
+ return $ifaceNil;
181969
+ };
181970
+ Pmt.prototype.Decode = function(bs) { return this.$val.Decode(bs); };
181971
+ NewPESStream = function(pid, cid) {
181972
+ var cid, pid;
181973
+ return new pes_stream.ptr(pid, 0, cid);
181974
+ };
181975
+ $pkg.NewPESStream = NewPESStream;
181976
+ NewTablePmt = function() {
181977
+ return new table_pmt.ptr(0, 0, 0, 0, 0, $makeSlice(sliceType$4, 0, 2));
181978
+ };
181979
+ $pkg.NewTablePmt = NewTablePmt;
181980
+ NewTablePat = function() {
181981
+ return new table_pat.ptr(0, 0, $makeSlice(sliceType$5, 0, 8));
181982
+ };
181983
+ $pkg.NewTablePat = NewTablePat;
181984
+ NewTSMuxer = function() {
181985
+ return new TSMuxer.ptr(NewTablePat(), 256, 512, new $Uint64(0, 0), $throwNilPointerError);
181986
+ };
181987
+ $pkg.NewTSMuxer = NewTSMuxer;
181988
+ TSMuxer.ptr.prototype.AddStream = function(cid) {
181989
+ var cid, mux, sid, tmppmt, tmpstream, x, x$1;
181990
+ mux = this;
181991
+ if (mux.pat === ptrType$3.nil) {
181992
+ mux.pat = NewTablePat();
181993
+ }
181994
+ if (mux.pat.pmts.$length === 0) {
181995
+ tmppmt = NewTablePmt();
181996
+ tmppmt.pid = mux.pmt_pid;
181997
+ tmppmt.pm = 1;
181998
+ mux.pmt_pid = mux.pmt_pid + (1) << 16 >>> 16;
181999
+ mux.pat.pmts = $append(mux.pat.pmts, tmppmt);
182000
+ }
182001
+ sid = mux.stream_pid;
182002
+ tmpstream = NewPESStream(sid, cid);
182003
+ mux.stream_pid = mux.stream_pid + (1) << 16 >>> 16;
182004
+ (x$1 = mux.pat.pmts, (0 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 0])).streams = $append((x = mux.pat.pmts, (0 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 0])).streams, tmpstream);
182005
+ return sid;
182006
+ };
182007
+ TSMuxer.prototype.AddStream = function(cid) { return this.$val.AddStream(cid); };
182008
+ TSMuxer.ptr.prototype.Write = function(pid, data, pts, dts) {
182009
+ var {_1, _i, _i$1, _i$2, _i$3, _i$4, _r, _r$1, _ref, _ref$1, _ref$2, _ref$3, _ref$4, data, dts, flag, mux, pid, pmt, pmt$1, pmt$2, pts, sp, stream, stream$1, tmppat, tmppm, tmppmt, whichpmt, whichstream, withaud, x, x$1, x$2, x$3, $s, $r, $c} = $restore(this, {pid, data, pts, dts});
182010
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182011
+ whichstream = [whichstream];
182012
+ withaud = [withaud];
182013
+ mux = this;
182014
+ whichpmt = ptrType$2.nil;
182015
+ whichstream[0] = ptrType$1.nil;
182016
+ _ref = mux.pat.pmts;
182017
+ _i = 0;
182018
+ while (true) {
182019
+ if (!(_i < _ref.$length)) { break; }
182020
+ pmt = ((_i < 0 || _i >= _ref.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref.$array[_ref.$offset + _i]);
182021
+ _ref$1 = pmt.streams;
182022
+ _i$1 = 0;
182023
+ while (true) {
182024
+ if (!(_i$1 < _ref$1.$length)) { break; }
182025
+ stream = ((_i$1 < 0 || _i$1 >= _ref$1.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$1.$array[_ref$1.$offset + _i$1]);
182026
+ if (stream.pid === pid) {
182027
+ whichpmt = pmt;
182028
+ whichstream[0] = stream;
182029
+ break;
182030
+ }
182031
+ _i$1++;
182032
+ }
182033
+ _i++;
182034
+ }
182035
+ if (whichpmt === ptrType$2.nil || whichstream[0] === ptrType$1.nil) {
182036
+ $s = -1; return errors.New("not Found pid stream");
182037
+ }
182038
+ if ((whichpmt.pcr_pid === 0) || ((findPESIDByStreamType(whichstream[0].streamtype) === 224) && !((whichpmt.pcr_pid === pid)))) {
182039
+ whichpmt.pcr_pid = pid;
182040
+ }
182041
+ withaud[0] = false;
182042
+ /* */ if ((whichstream[0].streamtype === 27) || (whichstream[0].streamtype === 36)) { $s = 1; continue; }
182043
+ /* */ $s = 2; continue;
182044
+ /* if ((whichstream[0].streamtype === 27) || (whichstream[0].streamtype === 36)) { */ case 1:
182045
+ $r = codec.SplitFrame(data, (function(whichstream, withaud) { return function(nalu) {
182046
+ var nalu, nalu_type, nalu_type$1;
182047
+ if (whichstream[0].streamtype === 27) {
182048
+ nalu_type = codec.H264NaluTypeWithoutStartCode(nalu);
182049
+ if (nalu_type === 9) {
182050
+ withaud[0] = true;
182051
+ return false;
182052
+ } else if (codec.IsH264VCLNaluType(nalu_type)) {
182053
+ return false;
182054
+ }
182055
+ return true;
182056
+ } else {
182057
+ nalu_type$1 = codec.H265NaluTypeWithoutStartCode(nalu);
182058
+ if (nalu_type$1 === 35) {
182059
+ withaud[0] = true;
182060
+ return false;
182061
+ } else if (codec.IsH265VCLNaluType(nalu_type$1)) {
182062
+ return false;
182063
+ }
182064
+ return true;
182065
+ }
182066
+ }; })(whichstream, withaud)); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182067
+ /* } */ case 2:
182068
+ /* */ if ((x = mux.pat_period, (x.$high === 0 && x.$low === 0)) || (x$1 = (x$2 = mux.pat_period, new $Uint64(x$2.$high + 0, x$2.$low + 400)), (x$1.$high < dts.$high || (x$1.$high === dts.$high && x$1.$low < dts.$low)))) { $s = 4; continue; }
182069
+ /* */ $s = 5; continue;
182070
+ /* if ((x = mux.pat_period, (x.$high === 0 && x.$low === 0)) || (x$1 = (x$2 = mux.pat_period, new $Uint64(x$2.$high + 0, x$2.$low + 400)), (x$1.$high < dts.$high || (x$1.$high === dts.$high && x$1.$low < dts.$low)))) { */ case 4:
182071
+ mux.pat_period = dts;
182072
+ if ((x$3 = mux.pat_period, (x$3.$high === 0 && x$3.$low === 0))) {
182073
+ mux.pat_period = new $Uint64(0, 1);
182074
+ }
182075
+ tmppat = NewPat();
182076
+ tmppat.Version_number = mux.pat.version_number;
182077
+ _ref$2 = mux.pat.pmts;
182078
+ _i$2 = 0;
182079
+ while (true) {
182080
+ if (!(_i$2 < _ref$2.$length)) { break; }
182081
+ pmt$1 = ((_i$2 < 0 || _i$2 >= _ref$2.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$2.$array[_ref$2.$offset + _i$2]);
182082
+ tmppm = new PmtPair.ptr(pmt$1.pm, pmt$1.pid);
182083
+ tmppat.Pmts = $append(tmppat.Pmts, tmppm);
182084
+ _i$2++;
182085
+ }
182086
+ $r = mux.writePat(tmppat); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182087
+ _ref$3 = mux.pat.pmts;
182088
+ _i$3 = 0;
182089
+ /* while (true) { */ case 7:
182090
+ /* if (!(_i$3 < _ref$3.$length)) { break; } */ if(!(_i$3 < _ref$3.$length)) { $s = 8; continue; }
182091
+ pmt$2 = ((_i$3 < 0 || _i$3 >= _ref$3.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$3.$array[_ref$3.$offset + _i$3]);
182092
+ tmppmt = NewPmt();
182093
+ tmppmt.Program_number = pmt$2.pm;
182094
+ tmppmt.Version_number = pmt$2.version_number;
182095
+ tmppmt.PCR_PID = pmt$2.pcr_pid;
182096
+ _ref$4 = pmt$2.streams;
182097
+ _i$4 = 0;
182098
+ while (true) {
182099
+ if (!(_i$4 < _ref$4.$length)) { break; }
182100
+ stream$1 = ((_i$4 < 0 || _i$4 >= _ref$4.$length) ? ($throwRuntimeError("index out of range"), undefined) : _ref$4.$array[_ref$4.$offset + _i$4]);
182101
+ sp = new StreamPair.ptr(0, 0, 0);
182102
+ sp.StreamType = ((stream$1.streamtype << 24 >>> 24));
182103
+ sp.Elementary_PID = stream$1.pid;
182104
+ sp.ES_Info_Length = 0;
182105
+ tmppmt.Streams = $append(tmppmt.Streams, sp);
182106
+ _i$4++;
182107
+ }
182108
+ $r = mux.writePmt(tmppmt, pmt$2); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182109
+ _i$3++;
182110
+ $s = 7; continue;
182111
+ case 8:
182112
+ /* } */ case 5:
182113
+ flag = false;
182114
+ _1 = whichstream[0].streamtype;
182115
+ /* */ if (_1 === (27)) { $s = 11; continue; }
182116
+ /* */ if (_1 === (36)) { $s = 12; continue; }
182117
+ /* */ $s = 13; continue;
182118
+ /* if (_1 === (27)) { */ case 11:
182119
+ _r = codec.IsH264IDRFrame(data); /* */ $s = 14; case 14: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182120
+ flag = _r;
182121
+ $s = 13; continue;
182122
+ /* } else if (_1 === (36)) { */ case 12:
182123
+ _r$1 = codec.IsH265IDRFrame(data); /* */ $s = 15; case 15: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
182124
+ flag = _r$1;
182125
+ /* } */ case 13:
182126
+ case 10:
182127
+ $r = mux.writePES(whichstream[0], whichpmt, data, $mul64(pts, new $Uint64(0, 90)), $mul64(dts, new $Uint64(0, 90)), flag, withaud[0]); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182128
+ $s = -1; return $ifaceNil;
182129
+ /* */ } return; } var $f = {$blk: TSMuxer.ptr.prototype.Write, $c: true, $r, _1, _i, _i$1, _i$2, _i$3, _i$4, _r, _r$1, _ref, _ref$1, _ref$2, _ref$3, _ref$4, data, dts, flag, mux, pid, pmt, pmt$1, pmt$2, pts, sp, stream, stream$1, tmppat, tmppm, tmppmt, whichpmt, whichstream, withaud, x, x$1, x$2, x$3, $s};return $f;
182130
+ };
182131
+ TSMuxer.prototype.Write = function(pid, data, pts, dts) { return this.$val.Write(pid, data, pts, dts); };
182132
+ TSMuxer.ptr.prototype.writePat = function(pat) {
182133
+ var {_r, bsw, mux, pat, tshdr, $s, $r, $c} = $restore(this, {pat});
182134
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182135
+ mux = this;
182136
+ tshdr = new TSPacket.ptr(0, 0, 0, 0, 0, 0, 0, ptrType.nil, $ifaceNil);
182137
+ tshdr.Payload_unit_start_indicator = 1;
182138
+ tshdr.PID = 0;
182139
+ tshdr.Adaptation_field_control = 1;
182140
+ tshdr.Continuity_counter = mux.pat.cc;
182141
+ mux.pat.cc = (_r = ((mux.pat.cc + 1 << 24 >>> 24)) % 16, _r === _r ? _r : $throwRuntimeError("integer divide by zero"));
182142
+ bsw = codec.NewBitStreamWriter(188);
182143
+ tshdr.EncodeHeader(bsw);
182144
+ bsw.PutByte(0);
182145
+ pat.Encode(bsw);
182146
+ bsw.FillRemainData(255);
182147
+ /* */ if (!(mux.OnPacket === $throwNilPointerError)) { $s = 1; continue; }
182148
+ /* */ $s = 2; continue;
182149
+ /* if (!(mux.OnPacket === $throwNilPointerError)) { */ case 1:
182150
+ $r = mux.OnPacket(bsw.Bits()); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182151
+ /* } */ case 2:
182152
+ $s = -1; return;
182153
+ /* */ } return; } var $f = {$blk: TSMuxer.ptr.prototype.writePat, $c: true, $r, _r, bsw, mux, pat, tshdr, $s};return $f;
182154
+ };
182155
+ TSMuxer.prototype.writePat = function(pat) { return this.$val.writePat(pat); };
182156
+ TSMuxer.ptr.prototype.writePmt = function(pmt, t_pmt) {
182157
+ var {_r, bsw, mux, pmt, t_pmt, tshdr, $s, $r, $c} = $restore(this, {pmt, t_pmt});
182158
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182159
+ mux = this;
182160
+ tshdr = new TSPacket.ptr(0, 0, 0, 0, 0, 0, 0, ptrType.nil, $ifaceNil);
182161
+ tshdr.Payload_unit_start_indicator = 1;
182162
+ tshdr.PID = t_pmt.pid;
182163
+ tshdr.Adaptation_field_control = 1;
182164
+ tshdr.Continuity_counter = t_pmt.cc;
182165
+ t_pmt.cc = (_r = ((t_pmt.cc + 1 << 24 >>> 24)) % 16, _r === _r ? _r : $throwRuntimeError("integer divide by zero"));
182166
+ bsw = codec.NewBitStreamWriter(188);
182167
+ tshdr.EncodeHeader(bsw);
182168
+ bsw.PutByte(0);
182169
+ pmt.Encode(bsw);
182170
+ bsw.FillRemainData(255);
182171
+ /* */ if (!(mux.OnPacket === $throwNilPointerError)) { $s = 1; continue; }
182172
+ /* */ $s = 2; continue;
182173
+ /* if (!(mux.OnPacket === $throwNilPointerError)) { */ case 1:
182174
+ $r = mux.OnPacket(bsw.Bits()); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182175
+ /* } */ case 2:
182176
+ $s = -1; return;
182177
+ /* */ } return; } var $f = {$blk: TSMuxer.ptr.prototype.writePmt, $c: true, $r, _r, bsw, mux, pmt, t_pmt, tshdr, $s};return $f;
182178
+ };
182179
+ TSMuxer.prototype.writePmt = function(pmt, t_pmt) { return this.$val.writePmt(pmt, t_pmt); };
182180
+ TSMuxer.ptr.prototype.writePES = function(pes, pmt, data, pts, dts, idr_flag, withaud) {
182181
+ var {_r, adaptation, bsw, data, dts, firstPesPacket, headlen, idr_flag, mux, oldheadlen, payload, pcr_base, pcr_ext, pes, pespkg, pmt, pts, tshdr, withaud, $s, $r, $c} = $restore(this, {pes, pmt, data, pts, dts, idr_flag, withaud});
182182
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182183
+ mux = this;
182184
+ firstPesPacket = true;
182185
+ bsw = codec.NewBitStreamWriter(188);
182186
+ /* while (true) { */ case 1:
182187
+ bsw.Reset();
182188
+ tshdr = new TSPacket.ptr(0, 0, 0, 0, 0, 0, 0, ptrType.nil, $ifaceNil);
182189
+ if (firstPesPacket) {
182190
+ tshdr.Payload_unit_start_indicator = 1;
182191
+ }
182192
+ tshdr.PID = pes.pid;
182193
+ tshdr.Adaptation_field_control = 1;
182194
+ tshdr.Continuity_counter = pes.cc;
182195
+ headlen = 4;
182196
+ pes.cc = (_r = ((pes.cc + 1 << 24 >>> 24)) % 16, _r === _r ? _r : $throwRuntimeError("integer divide by zero"));
182197
+ adaptation = ptrType.nil;
182198
+ if (firstPesPacket && idr_flag) {
182199
+ adaptation = new Adaptation_field.ptr(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0, new $Uint64(0, 0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0);
182200
+ tshdr.Adaptation_field_control = (tshdr.Adaptation_field_control | 32) >>> 0;
182201
+ adaptation.Random_access_indicator = 1;
182202
+ headlen = headlen + (2) >> 0;
182203
+ }
182204
+ if (firstPesPacket && (pes.pid === pmt.pcr_pid)) {
182205
+ if (adaptation === ptrType.nil) {
182206
+ adaptation = new Adaptation_field.ptr(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0, new $Uint64(0, 0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0);
182207
+ headlen = headlen + (2) >> 0;
182208
+ }
182209
+ tshdr.Adaptation_field_control = (tshdr.Adaptation_field_control | 32) >>> 0;
182210
+ adaptation.PCR_flag = 1;
182211
+ pcr_base = new $Uint64(0, 0);
182212
+ pcr_ext = 0;
182213
+ if ((dts.$high === 0 && dts.$low === 0)) {
182214
+ pcr_base = $div64($mul64(pts, new $Uint64(0, 300)), new $Uint64(0, 300), false);
182215
+ pcr_ext = (($div64($mul64(pts, new $Uint64(0, 300)), new $Uint64(0, 300), true).$low << 16 >>> 16));
182216
+ } else {
182217
+ pcr_base = $div64($mul64(dts, new $Uint64(0, 300)), new $Uint64(0, 300), false);
182218
+ pcr_ext = (($div64($mul64(dts, new $Uint64(0, 300)), new $Uint64(0, 300), true).$low << 16 >>> 16));
182219
+ }
182220
+ adaptation.Program_clock_reference_base = pcr_base;
182221
+ adaptation.Program_clock_reference_extension = pcr_ext;
182222
+ headlen = headlen + (6) >> 0;
182223
+ }
182224
+ payload = sliceType.nil;
182225
+ pespkg = ptrType$4.nil;
182226
+ if (firstPesPacket) {
182227
+ oldheadlen = headlen;
182228
+ headlen = headlen + (19) >> 0;
182229
+ if (!withaud && (pes.streamtype === 27)) {
182230
+ headlen = headlen + (6) >> 0;
182231
+ payload = $appendSlice(payload, $pkg.H264_AUD_NALU);
182232
+ } else if (!withaud && (pes.streamtype === 36)) {
182233
+ payload = $appendSlice(payload, $pkg.H265_AUD_NALU);
182234
+ headlen = headlen + (7) >> 0;
182235
+ }
182236
+ pespkg = NewPesPacket();
182237
+ pespkg.PTS_DTS_flags = 3;
182238
+ pespkg.PES_header_data_length = 10;
182239
+ pespkg.Pts = pts;
182240
+ pespkg.Dts = dts;
182241
+ pespkg.Stream_id = ((findPESIDByStreamType(pes.streamtype) << 24 >>> 24));
182242
+ if (idr_flag) {
182243
+ pespkg.Data_alignment_indicator = 1;
182244
+ }
182245
+ if ((((headlen - oldheadlen >> 0) - 6 >> 0) + data.$length >> 0) > 65535) {
182246
+ pespkg.PES_packet_length = 0;
182247
+ } else {
182248
+ pespkg.PES_packet_length = (((((data.$length + headlen >> 0) - oldheadlen >> 0) - 6 >> 0) << 16 >>> 16));
182249
+ }
182250
+ }
182251
+ if ((data.$length + headlen >> 0) < 188) {
182252
+ if (adaptation === ptrType.nil) {
182253
+ adaptation = new Adaptation_field.ptr(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0, new $Uint64(0, 0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), 0);
182254
+ headlen = headlen + (1) >> 0;
182255
+ if (((188 - data.$length >> 0) - headlen >> 0) >= 1) {
182256
+ headlen = headlen + (1) >> 0;
182257
+ } else {
182258
+ adaptation.SingleStuffingByte = true;
182259
+ }
182260
+ }
182261
+ adaptation.Stuffing_byte = ((((188 - data.$length >> 0) - headlen >> 0) << 24 >>> 24));
182262
+ payload = $appendSlice(payload, data);
182263
+ data = $subslice(data, 0, 0);
182264
+ } else {
182265
+ payload = $appendSlice(payload, $subslice(data, 0, (188 - headlen >> 0)));
182266
+ data = $subslice(data, (188 - headlen >> 0));
182267
+ }
182268
+ if (!(adaptation === ptrType.nil)) {
182269
+ tshdr.Field = adaptation;
182270
+ tshdr.Adaptation_field_control = (tshdr.Adaptation_field_control | (2)) >>> 0;
182271
+ }
182272
+ tshdr.EncodeHeader(bsw);
182273
+ if (!(pespkg === ptrType$4.nil)) {
182274
+ pespkg.Pes_payload = payload;
182275
+ pespkg.Encode(bsw);
182276
+ } else {
182277
+ bsw.PutBytes(payload);
182278
+ }
182279
+ firstPesPacket = false;
182280
+ /* */ if (!(mux.OnPacket === $throwNilPointerError)) { $s = 3; continue; }
182281
+ /* */ $s = 4; continue;
182282
+ /* if (!(mux.OnPacket === $throwNilPointerError)) { */ case 3:
182283
+ if (!((bsw.Bits().$length === 188))) {
182284
+ $panic(new $String("packet ts packet failed"));
182285
+ }
182286
+ $r = mux.OnPacket(bsw.Bits()); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182287
+ /* } */ case 4:
182288
+ if (data.$length === 0) {
182289
+ /* break; */ $s = 2; continue;
182290
+ }
182291
+ $s = 1; continue;
182292
+ case 2:
182293
+ $s = -1; return;
182294
+ /* */ } return; } var $f = {$blk: TSMuxer.ptr.prototype.writePES, $c: true, $r, _r, adaptation, bsw, data, dts, firstPesPacket, headlen, idr_flag, mux, oldheadlen, payload, pcr_base, pcr_ext, pes, pespkg, pmt, pts, tshdr, withaud, $s};return $f;
182295
+ };
182296
+ TSMuxer.prototype.writePES = function(pes, pmt, data, pts, dts, idr_flag, withaud) { return this.$val.writePES(pes, pmt, data, pts, dts, idr_flag, withaud); };
182297
+ needmoreError.ptr.prototype.Error = function() {
182298
+ var e;
182299
+ e = this;
182300
+ return "need more bytes";
182301
+ };
182302
+ needmoreError.prototype.Error = function() { return this.$val.Error(); };
182303
+ needmoreError.ptr.prototype.NeedMore = function() {
182304
+ var e;
182305
+ e = this;
182306
+ return true;
182307
+ };
182308
+ needmoreError.prototype.NeedMore = function() { return this.$val.NeedMore(); };
182309
+ needmoreError.ptr.prototype.ParserError = function() {
182310
+ var e;
182311
+ e = this;
182312
+ return false;
182313
+ };
182314
+ needmoreError.prototype.ParserError = function() { return this.$val.ParserError(); };
182315
+ needmoreError.ptr.prototype.StreamIdNotFound = function() {
182316
+ var e;
182317
+ e = this;
182318
+ return false;
182319
+ };
182320
+ needmoreError.prototype.StreamIdNotFound = function() { return this.$val.StreamIdNotFound(); };
182321
+ parserError.ptr.prototype.Error = function() {
182322
+ var e;
182323
+ e = this;
182324
+ return "parser packet error";
182325
+ };
182326
+ parserError.prototype.Error = function() { return this.$val.Error(); };
182327
+ parserError.ptr.prototype.NeedMore = function() {
182328
+ var e;
182329
+ e = this;
182330
+ return false;
182331
+ };
182332
+ parserError.prototype.NeedMore = function() { return this.$val.NeedMore(); };
182333
+ parserError.ptr.prototype.ParserError = function() {
182334
+ var e;
182335
+ e = this;
182336
+ return true;
182337
+ };
182338
+ parserError.prototype.ParserError = function() { return this.$val.ParserError(); };
182339
+ parserError.ptr.prototype.StreamIdNotFound = function() {
182340
+ var e;
182341
+ e = this;
182342
+ return false;
182343
+ };
182344
+ parserError.prototype.StreamIdNotFound = function() { return this.$val.StreamIdNotFound(); };
182345
+ findPESIDByStreamType = function(cid) {
182346
+ var _1, cid;
182347
+ _1 = cid;
182348
+ if ((_1 === (15)) || (_1 === (3)) || (_1 === (4))) {
182349
+ return 192;
182350
+ } else if ((_1 === (27)) || (_1 === (36))) {
182351
+ return 224;
182352
+ } else {
182353
+ return 189;
182354
+ }
182355
+ };
182356
+ NewPesPacket = function() {
182357
+ return new PesPacket.ptr(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, new $Uint64(0, 0), new $Uint64(0, 0), new $Uint64(0, 0), 0, 0, 0, 0, 0, 0, sliceType.nil);
182358
+ };
182359
+ $pkg.NewPesPacket = NewPesPacket;
182360
+ PesPacket.ptr.prototype.PrettyPrint = function(file) {
182361
+ var {_r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$48, _r$49, _r$5, _r$50, _r$51, _r$52, _r$53, _r$54, _r$55, _r$6, _r$7, _r$8, _r$9, file, i, pkg, x, $s, $r, $c} = $restore(this, {file});
182362
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182363
+ pkg = this;
182364
+ _r = fmt.Sprintf("stream_id:%d\n", new sliceType$1([new $Uint8(pkg.Stream_id)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182365
+ _r$1 = file.WriteString(_r); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
182366
+ _r$1;
182367
+ _r$2 = fmt.Sprintf("PES_packet_length:%d\n", new sliceType$1([new $Uint16(pkg.PES_packet_length)])); /* */ $s = 3; case 3: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
182368
+ _r$3 = file.WriteString(_r$2); /* */ $s = 4; case 4: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
182369
+ _r$3;
182370
+ _r$4 = fmt.Sprintf("PES_scrambling_control:%d\n", new sliceType$1([new $Uint8(pkg.PES_scrambling_control)])); /* */ $s = 5; case 5: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
182371
+ _r$5 = file.WriteString(_r$4); /* */ $s = 6; case 6: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
182372
+ _r$5;
182373
+ _r$6 = fmt.Sprintf("PES_priority:%d\n", new sliceType$1([new $Uint8(pkg.PES_priority)])); /* */ $s = 7; case 7: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
182374
+ _r$7 = file.WriteString(_r$6); /* */ $s = 8; case 8: if($c) { $c = false; _r$7 = _r$7.$blk(); } if (_r$7 && _r$7.$blk !== undefined) { break s; }
182375
+ _r$7;
182376
+ _r$8 = fmt.Sprintf("data_alignment_indicator:%d\n", new sliceType$1([new $Uint8(pkg.Data_alignment_indicator)])); /* */ $s = 9; case 9: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
182377
+ _r$9 = file.WriteString(_r$8); /* */ $s = 10; case 10: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
182378
+ _r$9;
182379
+ _r$10 = fmt.Sprintf("copyright:%d\n", new sliceType$1([new $Uint8(pkg.Copyright)])); /* */ $s = 11; case 11: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
182380
+ _r$11 = file.WriteString(_r$10); /* */ $s = 12; case 12: if($c) { $c = false; _r$11 = _r$11.$blk(); } if (_r$11 && _r$11.$blk !== undefined) { break s; }
182381
+ _r$11;
182382
+ _r$12 = fmt.Sprintf("original_or_copy:%d\n", new sliceType$1([new $Uint8(pkg.Original_or_copy)])); /* */ $s = 13; case 13: if($c) { $c = false; _r$12 = _r$12.$blk(); } if (_r$12 && _r$12.$blk !== undefined) { break s; }
182383
+ _r$13 = file.WriteString(_r$12); /* */ $s = 14; case 14: if($c) { $c = false; _r$13 = _r$13.$blk(); } if (_r$13 && _r$13.$blk !== undefined) { break s; }
182384
+ _r$13;
182385
+ _r$14 = fmt.Sprintf("PTS_DTS_flags:%d\n", new sliceType$1([new $Uint8(pkg.PTS_DTS_flags)])); /* */ $s = 15; case 15: if($c) { $c = false; _r$14 = _r$14.$blk(); } if (_r$14 && _r$14.$blk !== undefined) { break s; }
182386
+ _r$15 = file.WriteString(_r$14); /* */ $s = 16; case 16: if($c) { $c = false; _r$15 = _r$15.$blk(); } if (_r$15 && _r$15.$blk !== undefined) { break s; }
182387
+ _r$15;
182388
+ _r$16 = fmt.Sprintf("ESCR_flag:%d\n", new sliceType$1([new $Uint8(pkg.ESCR_flag)])); /* */ $s = 17; case 17: if($c) { $c = false; _r$16 = _r$16.$blk(); } if (_r$16 && _r$16.$blk !== undefined) { break s; }
182389
+ _r$17 = file.WriteString(_r$16); /* */ $s = 18; case 18: if($c) { $c = false; _r$17 = _r$17.$blk(); } if (_r$17 && _r$17.$blk !== undefined) { break s; }
182390
+ _r$17;
182391
+ _r$18 = fmt.Sprintf("ES_rate_flag:%d\n", new sliceType$1([new $Uint8(pkg.ES_rate_flag)])); /* */ $s = 19; case 19: if($c) { $c = false; _r$18 = _r$18.$blk(); } if (_r$18 && _r$18.$blk !== undefined) { break s; }
182392
+ _r$19 = file.WriteString(_r$18); /* */ $s = 20; case 20: if($c) { $c = false; _r$19 = _r$19.$blk(); } if (_r$19 && _r$19.$blk !== undefined) { break s; }
182393
+ _r$19;
182394
+ _r$20 = fmt.Sprintf("DSM_trick_mode_flag:%d\n", new sliceType$1([new $Uint8(pkg.DSM_trick_mode_flag)])); /* */ $s = 21; case 21: if($c) { $c = false; _r$20 = _r$20.$blk(); } if (_r$20 && _r$20.$blk !== undefined) { break s; }
182395
+ _r$21 = file.WriteString(_r$20); /* */ $s = 22; case 22: if($c) { $c = false; _r$21 = _r$21.$blk(); } if (_r$21 && _r$21.$blk !== undefined) { break s; }
182396
+ _r$21;
182397
+ _r$22 = fmt.Sprintf("additional_copy_info_flag:%d\n", new sliceType$1([new $Uint8(pkg.Additional_copy_info_flag)])); /* */ $s = 23; case 23: if($c) { $c = false; _r$22 = _r$22.$blk(); } if (_r$22 && _r$22.$blk !== undefined) { break s; }
182398
+ _r$23 = file.WriteString(_r$22); /* */ $s = 24; case 24: if($c) { $c = false; _r$23 = _r$23.$blk(); } if (_r$23 && _r$23.$blk !== undefined) { break s; }
182399
+ _r$23;
182400
+ _r$24 = fmt.Sprintf("PES_CRC_flag:%d\n", new sliceType$1([new $Uint8(pkg.PES_CRC_flag)])); /* */ $s = 25; case 25: if($c) { $c = false; _r$24 = _r$24.$blk(); } if (_r$24 && _r$24.$blk !== undefined) { break s; }
182401
+ _r$25 = file.WriteString(_r$24); /* */ $s = 26; case 26: if($c) { $c = false; _r$25 = _r$25.$blk(); } if (_r$25 && _r$25.$blk !== undefined) { break s; }
182402
+ _r$25;
182403
+ _r$26 = fmt.Sprintf("PES_extension_flag:%d\n", new sliceType$1([new $Uint8(pkg.PES_extension_flag)])); /* */ $s = 27; case 27: if($c) { $c = false; _r$26 = _r$26.$blk(); } if (_r$26 && _r$26.$blk !== undefined) { break s; }
182404
+ _r$27 = file.WriteString(_r$26); /* */ $s = 28; case 28: if($c) { $c = false; _r$27 = _r$27.$blk(); } if (_r$27 && _r$27.$blk !== undefined) { break s; }
182405
+ _r$27;
182406
+ _r$28 = fmt.Sprintf("PES_header_data_length:%d\n", new sliceType$1([new $Uint8(pkg.PES_header_data_length)])); /* */ $s = 29; case 29: if($c) { $c = false; _r$28 = _r$28.$blk(); } if (_r$28 && _r$28.$blk !== undefined) { break s; }
182407
+ _r$29 = file.WriteString(_r$28); /* */ $s = 30; case 30: if($c) { $c = false; _r$29 = _r$29.$blk(); } if (_r$29 && _r$29.$blk !== undefined) { break s; }
182408
+ _r$29;
182409
+ /* */ if (((pkg.PTS_DTS_flags & 2) >>> 0) === 2) { $s = 31; continue; }
182410
+ /* */ $s = 32; continue;
182411
+ /* if (((pkg.PTS_DTS_flags & 2) >>> 0) === 2) { */ case 31:
182412
+ _r$30 = fmt.Sprintf("PTS:%d\n", new sliceType$1([pkg.Pts])); /* */ $s = 33; case 33: if($c) { $c = false; _r$30 = _r$30.$blk(); } if (_r$30 && _r$30.$blk !== undefined) { break s; }
182413
+ _r$31 = file.WriteString(_r$30); /* */ $s = 34; case 34: if($c) { $c = false; _r$31 = _r$31.$blk(); } if (_r$31 && _r$31.$blk !== undefined) { break s; }
182414
+ _r$31;
182415
+ /* } */ case 32:
182416
+ /* */ if (((pkg.PTS_DTS_flags & 3) >>> 0) === 3) { $s = 35; continue; }
182417
+ /* */ $s = 36; continue;
182418
+ /* if (((pkg.PTS_DTS_flags & 3) >>> 0) === 3) { */ case 35:
182419
+ _r$32 = fmt.Sprintf("DTS:%d\n", new sliceType$1([pkg.Dts])); /* */ $s = 37; case 37: if($c) { $c = false; _r$32 = _r$32.$blk(); } if (_r$32 && _r$32.$blk !== undefined) { break s; }
182420
+ _r$33 = file.WriteString(_r$32); /* */ $s = 38; case 38: if($c) { $c = false; _r$33 = _r$33.$blk(); } if (_r$33 && _r$33.$blk !== undefined) { break s; }
182421
+ _r$33;
182422
+ /* } */ case 36:
182423
+ /* */ if (pkg.ESCR_flag === 1) { $s = 39; continue; }
182424
+ /* */ $s = 40; continue;
182425
+ /* if (pkg.ESCR_flag === 1) { */ case 39:
182426
+ _r$34 = fmt.Sprintf("ESCR_base:%d\n", new sliceType$1([pkg.ESCR_base])); /* */ $s = 41; case 41: if($c) { $c = false; _r$34 = _r$34.$blk(); } if (_r$34 && _r$34.$blk !== undefined) { break s; }
182427
+ _r$35 = file.WriteString(_r$34); /* */ $s = 42; case 42: if($c) { $c = false; _r$35 = _r$35.$blk(); } if (_r$35 && _r$35.$blk !== undefined) { break s; }
182428
+ _r$35;
182429
+ _r$36 = fmt.Sprintf("ESCR_extension:%d\n", new sliceType$1([new $Uint16(pkg.ESCR_extension)])); /* */ $s = 43; case 43: if($c) { $c = false; _r$36 = _r$36.$blk(); } if (_r$36 && _r$36.$blk !== undefined) { break s; }
182430
+ _r$37 = file.WriteString(_r$36); /* */ $s = 44; case 44: if($c) { $c = false; _r$37 = _r$37.$blk(); } if (_r$37 && _r$37.$blk !== undefined) { break s; }
182431
+ _r$37;
182432
+ /* } */ case 40:
182433
+ /* */ if (pkg.ES_rate_flag === 1) { $s = 45; continue; }
182434
+ /* */ $s = 46; continue;
182435
+ /* if (pkg.ES_rate_flag === 1) { */ case 45:
182436
+ _r$38 = fmt.Sprintf("ES_rate:%d\n", new sliceType$1([new $Uint32(pkg.ES_rate)])); /* */ $s = 47; case 47: if($c) { $c = false; _r$38 = _r$38.$blk(); } if (_r$38 && _r$38.$blk !== undefined) { break s; }
182437
+ _r$39 = file.WriteString(_r$38); /* */ $s = 48; case 48: if($c) { $c = false; _r$39 = _r$39.$blk(); } if (_r$39 && _r$39.$blk !== undefined) { break s; }
182438
+ _r$39;
182439
+ /* } */ case 46:
182440
+ /* */ if (pkg.DSM_trick_mode_flag === 1) { $s = 49; continue; }
182441
+ /* */ $s = 50; continue;
182442
+ /* if (pkg.DSM_trick_mode_flag === 1) { */ case 49:
182443
+ _r$40 = fmt.Sprintf("trick_mode_control:%d\n", new sliceType$1([new $Uint8(pkg.Trick_mode_control)])); /* */ $s = 51; case 51: if($c) { $c = false; _r$40 = _r$40.$blk(); } if (_r$40 && _r$40.$blk !== undefined) { break s; }
182444
+ _r$41 = file.WriteString(_r$40); /* */ $s = 52; case 52: if($c) { $c = false; _r$41 = _r$41.$blk(); } if (_r$41 && _r$41.$blk !== undefined) { break s; }
182445
+ _r$41;
182446
+ /* } */ case 50:
182447
+ /* */ if (pkg.Additional_copy_info_flag === 1) { $s = 53; continue; }
182448
+ /* */ $s = 54; continue;
182449
+ /* if (pkg.Additional_copy_info_flag === 1) { */ case 53:
182450
+ _r$42 = fmt.Sprintf("additional_copy_info:%d\n", new sliceType$1([new $Uint8(pkg.Additional_copy_info)])); /* */ $s = 55; case 55: if($c) { $c = false; _r$42 = _r$42.$blk(); } if (_r$42 && _r$42.$blk !== undefined) { break s; }
182451
+ _r$43 = file.WriteString(_r$42); /* */ $s = 56; case 56: if($c) { $c = false; _r$43 = _r$43.$blk(); } if (_r$43 && _r$43.$blk !== undefined) { break s; }
182452
+ _r$43;
182453
+ /* } */ case 54:
182454
+ /* */ if (pkg.PES_CRC_flag === 1) { $s = 57; continue; }
182455
+ /* */ $s = 58; continue;
182456
+ /* if (pkg.PES_CRC_flag === 1) { */ case 57:
182457
+ _r$44 = fmt.Sprintf("previous_PES_packet_CRC:%d\n", new sliceType$1([new $Uint16(pkg.Previous_PES_packet_CRC)])); /* */ $s = 59; case 59: if($c) { $c = false; _r$44 = _r$44.$blk(); } if (_r$44 && _r$44.$blk !== undefined) { break s; }
182458
+ _r$45 = file.WriteString(_r$44); /* */ $s = 60; case 60: if($c) { $c = false; _r$45 = _r$45.$blk(); } if (_r$45 && _r$45.$blk !== undefined) { break s; }
182459
+ _r$45;
182460
+ /* } */ case 58:
182461
+ _r$46 = file.WriteString("PES_packet_data_byte:\n"); /* */ $s = 61; case 61: if($c) { $c = false; _r$46 = _r$46.$blk(); } if (_r$46 && _r$46.$blk !== undefined) { break s; }
182462
+ _r$46;
182463
+ _r$47 = fmt.Sprintf(" Size: %d\n", new sliceType$1([new $Int(pkg.Pes_payload.$length)])); /* */ $s = 62; case 62: if($c) { $c = false; _r$47 = _r$47.$blk(); } if (_r$47 && _r$47.$blk !== undefined) { break s; }
182464
+ _r$48 = file.WriteString(_r$47); /* */ $s = 63; case 63: if($c) { $c = false; _r$48 = _r$48.$blk(); } if (_r$48 && _r$48.$blk !== undefined) { break s; }
182465
+ _r$48;
182466
+ _r$49 = file.WriteString(" data:"); /* */ $s = 64; case 64: if($c) { $c = false; _r$49 = _r$49.$blk(); } if (_r$49 && _r$49.$blk !== undefined) { break s; }
182467
+ _r$49;
182468
+ i = 0;
182469
+ /* while (true) { */ case 65:
182470
+ /* if (!(i < 12 && i < pkg.Pes_payload.$length)) { break; } */ if(!(i < 12 && i < pkg.Pes_payload.$length)) { $s = 66; continue; }
182471
+ /* */ if ((_r$50 = i % 4, _r$50 === _r$50 ? _r$50 : $throwRuntimeError("integer divide by zero")) === 0) { $s = 67; continue; }
182472
+ /* */ $s = 68; continue;
182473
+ /* if ((_r$50 = i % 4, _r$50 === _r$50 ? _r$50 : $throwRuntimeError("integer divide by zero")) === 0) { */ case 67:
182474
+ _r$51 = file.WriteString("\n"); /* */ $s = 69; case 69: if($c) { $c = false; _r$51 = _r$51.$blk(); } if (_r$51 && _r$51.$blk !== undefined) { break s; }
182475
+ _r$51;
182476
+ _r$52 = file.WriteString(" "); /* */ $s = 70; case 70: if($c) { $c = false; _r$52 = _r$52.$blk(); } if (_r$52 && _r$52.$blk !== undefined) { break s; }
182477
+ _r$52;
182478
+ /* } */ case 68:
182479
+ _r$53 = fmt.Sprintf("0x%02x ", new sliceType$1([new $Uint8((x = pkg.Pes_payload, ((i < 0 || i >= x.$length) ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + i])))])); /* */ $s = 71; case 71: if($c) { $c = false; _r$53 = _r$53.$blk(); } if (_r$53 && _r$53.$blk !== undefined) { break s; }
182480
+ _r$54 = file.WriteString(_r$53); /* */ $s = 72; case 72: if($c) { $c = false; _r$54 = _r$54.$blk(); } if (_r$54 && _r$54.$blk !== undefined) { break s; }
182481
+ _r$54;
182482
+ i = i + (1) >> 0;
182483
+ $s = 65; continue;
182484
+ case 66:
182485
+ _r$55 = file.WriteString("\n"); /* */ $s = 73; case 73: if($c) { $c = false; _r$55 = _r$55.$blk(); } if (_r$55 && _r$55.$blk !== undefined) { break s; }
182486
+ _r$55;
182487
+ $s = -1; return;
182488
+ /* */ } return; } var $f = {$blk: PesPacket.ptr.prototype.PrettyPrint, $c: true, $r, _r, _r$1, _r$10, _r$11, _r$12, _r$13, _r$14, _r$15, _r$16, _r$17, _r$18, _r$19, _r$2, _r$20, _r$21, _r$22, _r$23, _r$24, _r$25, _r$26, _r$27, _r$28, _r$29, _r$3, _r$30, _r$31, _r$32, _r$33, _r$34, _r$35, _r$36, _r$37, _r$38, _r$39, _r$4, _r$40, _r$41, _r$42, _r$43, _r$44, _r$45, _r$46, _r$47, _r$48, _r$49, _r$5, _r$50, _r$51, _r$52, _r$53, _r$54, _r$55, _r$6, _r$7, _r$8, _r$9, file, i, pkg, x, $s};return $f;
182489
+ };
182490
+ PesPacket.prototype.PrettyPrint = function(file) { return this.$val.PrettyPrint(file); };
182491
+ PesPacket.ptr.prototype.Decode = function(bs) {
182492
+ var bs, dataLen, loc, pkg, x, x$1, x$10, x$11, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9;
182493
+ pkg = this;
182494
+ if (bs.RemainBytes() < 9) {
182495
+ return errNeedMore;
182496
+ }
182497
+ bs.SkipBits(24);
182498
+ pkg.Stream_id = bs.Uint8(8);
182499
+ pkg.PES_packet_length = bs.Uint16(16);
182500
+ bs.SkipBits(2);
182501
+ pkg.PES_scrambling_control = bs.Uint8(2);
182502
+ pkg.PES_priority = bs.Uint8(1);
182503
+ pkg.Data_alignment_indicator = bs.Uint8(1);
182504
+ pkg.Copyright = bs.Uint8(1);
182505
+ pkg.Original_or_copy = bs.Uint8(1);
182506
+ pkg.PTS_DTS_flags = bs.Uint8(2);
182507
+ pkg.ESCR_flag = bs.Uint8(1);
182508
+ pkg.ES_rate_flag = bs.Uint8(1);
182509
+ pkg.DSM_trick_mode_flag = bs.Uint8(1);
182510
+ pkg.Additional_copy_info_flag = bs.Uint8(1);
182511
+ pkg.PES_CRC_flag = bs.Uint8(1);
182512
+ pkg.PES_extension_flag = bs.Uint8(1);
182513
+ pkg.PES_header_data_length = bs.Uint8(8);
182514
+ if (bs.RemainBytes() < ((pkg.PES_header_data_length >> 0))) {
182515
+ bs.UnRead(72);
182516
+ return errNeedMore;
182517
+ }
182518
+ bs.Markdot();
182519
+ if (((pkg.PTS_DTS_flags & 2) >>> 0) === 2) {
182520
+ bs.SkipBits(4);
182521
+ pkg.Pts = bs.GetBits(3);
182522
+ bs.SkipBits(1);
182523
+ pkg.Pts = (x = $shiftLeft64(pkg.Pts, 15), x$1 = bs.GetBits(15), new $Uint64(x.$high | x$1.$high, (x.$low | x$1.$low) >>> 0));
182524
+ bs.SkipBits(1);
182525
+ pkg.Pts = (x$2 = $shiftLeft64(pkg.Pts, 15), x$3 = bs.GetBits(15), new $Uint64(x$2.$high | x$3.$high, (x$2.$low | x$3.$low) >>> 0));
182526
+ bs.SkipBits(1);
182527
+ }
182528
+ if (((pkg.PTS_DTS_flags & 3) >>> 0) === 3) {
182529
+ bs.SkipBits(4);
182530
+ pkg.Dts = bs.GetBits(3);
182531
+ bs.SkipBits(1);
182532
+ pkg.Dts = (x$4 = $shiftLeft64(pkg.Dts, 15), x$5 = bs.GetBits(15), new $Uint64(x$4.$high | x$5.$high, (x$4.$low | x$5.$low) >>> 0));
182533
+ bs.SkipBits(1);
182534
+ pkg.Dts = (x$6 = $shiftLeft64(pkg.Dts, 15), x$7 = bs.GetBits(15), new $Uint64(x$6.$high | x$7.$high, (x$6.$low | x$7.$low) >>> 0));
182535
+ bs.SkipBits(1);
182536
+ } else {
182537
+ pkg.Dts = pkg.Pts;
182538
+ }
182539
+ if (pkg.ESCR_flag === 1) {
182540
+ bs.SkipBits(2);
182541
+ pkg.ESCR_base = bs.GetBits(3);
182542
+ bs.SkipBits(1);
182543
+ pkg.ESCR_base = (x$8 = $shiftLeft64(pkg.Pts, 15), x$9 = bs.GetBits(15), new $Uint64(x$8.$high | x$9.$high, (x$8.$low | x$9.$low) >>> 0));
182544
+ bs.SkipBits(1);
182545
+ pkg.ESCR_base = (x$10 = $shiftLeft64(pkg.Pts, 15), x$11 = bs.GetBits(15), new $Uint64(x$10.$high | x$11.$high, (x$10.$low | x$11.$low) >>> 0));
182546
+ bs.SkipBits(1);
182547
+ pkg.ESCR_extension = bs.Uint16(9);
182548
+ bs.SkipBits(1);
182549
+ }
182550
+ if (pkg.ES_rate_flag === 1) {
182551
+ bs.SkipBits(1);
182552
+ pkg.ES_rate = bs.Uint32(22);
182553
+ bs.SkipBits(1);
182554
+ }
182555
+ if (pkg.DSM_trick_mode_flag === 1) {
182556
+ pkg.Trick_mode_control = bs.Uint8(3);
182557
+ pkg.Trick_value = bs.Uint8(5);
182558
+ }
182559
+ if (pkg.Additional_copy_info_flag === 1) {
182560
+ pkg.Additional_copy_info = bs.Uint8(7);
182561
+ }
182562
+ if (pkg.PES_CRC_flag === 1) {
182563
+ pkg.Previous_PES_packet_CRC = bs.Uint16(16);
182564
+ }
182565
+ loc = bs.DistanceFromMarkDot();
182566
+ bs.SkipBits(($imul(((pkg.PES_header_data_length >> 0)), 8)) - loc >> 0);
182567
+ dataLen = ((((pkg.PES_packet_length - 3 << 16 >>> 16) - ((pkg.PES_header_data_length << 16 >>> 16)) << 16 >>> 16) >> 0));
182568
+ if (bs.RemainBytes() < dataLen) {
182569
+ pkg.Pes_payload = bs.RemainData();
182570
+ bs.UnRead($imul(((9 + ((pkg.PES_header_data_length >> 0)) >> 0)), 8));
182571
+ return errNeedMore;
182572
+ }
182573
+ if ((pkg.PES_packet_length === 0) || bs.RemainBytes() <= dataLen) {
182574
+ pkg.Pes_payload = bs.RemainData();
182575
+ bs.SkipBits(bs.RemainBits());
182576
+ } else {
182577
+ pkg.Pes_payload = $subslice(bs.RemainData(), 0, dataLen);
182578
+ bs.SkipBits($imul(dataLen, 8));
182579
+ }
182580
+ return $ifaceNil;
182581
+ };
182582
+ PesPacket.prototype.Decode = function(bs) { return this.$val.Decode(bs); };
182583
+ PesPacket.ptr.prototype.DecodeMpeg1 = function(bs) {
182584
+ var _q, bs, loc, pkg, x, x$1, x$10, x$11, x$12, x$13, x$14, x$15, x$16, x$2, x$3, x$4, x$5, x$6, x$7, x$8, x$9;
182585
+ pkg = this;
182586
+ if (bs.RemainBytes() < 6) {
182587
+ return errNeedMore;
182588
+ }
182589
+ bs.SkipBits(24);
182590
+ pkg.Stream_id = bs.Uint8(8);
182591
+ pkg.PES_packet_length = bs.Uint16(16);
182592
+ if (!((pkg.PES_packet_length === 0)) && bs.RemainBytes() < ((pkg.PES_packet_length >> 0))) {
182593
+ bs.UnRead(48);
182594
+ return errNeedMore;
182595
+ }
182596
+ bs.Markdot();
182597
+ while (true) {
182598
+ if (!((x = bs.NextBits(8), (x.$high === 0 && x.$low === 255)))) { break; }
182599
+ bs.SkipBits(8);
182600
+ }
182601
+ if ((x$1 = bs.NextBits(2), (x$1.$high === 0 && x$1.$low === 1))) {
182602
+ bs.SkipBits(16);
182603
+ }
182604
+ if ((x$2 = bs.NextBits(4), (x$2.$high === 0 && x$2.$low === 2))) {
182605
+ bs.SkipBits(4);
182606
+ pkg.Pts = bs.GetBits(3);
182607
+ bs.SkipBits(1);
182608
+ pkg.Pts = (x$5 = $shiftLeft64(pkg.Pts, 15), x$6 = bs.GetBits(15), new $Uint64(x$5.$high | x$6.$high, (x$5.$low | x$6.$low) >>> 0));
182609
+ bs.SkipBits(1);
182610
+ pkg.Pts = (x$7 = $shiftLeft64(pkg.Pts, 15), x$8 = bs.GetBits(15), new $Uint64(x$7.$high | x$8.$high, (x$7.$low | x$8.$low) >>> 0));
182611
+ bs.SkipBits(1);
182612
+ } else if ((x$3 = bs.NextBits(4), (x$3.$high === 0 && x$3.$low === 3))) {
182613
+ bs.SkipBits(4);
182614
+ pkg.Pts = bs.GetBits(3);
182615
+ bs.SkipBits(1);
182616
+ pkg.Pts = (x$9 = $shiftLeft64(pkg.Pts, 15), x$10 = bs.GetBits(15), new $Uint64(x$9.$high | x$10.$high, (x$9.$low | x$10.$low) >>> 0));
182617
+ bs.SkipBits(1);
182618
+ pkg.Pts = (x$11 = $shiftLeft64(pkg.Pts, 15), x$12 = bs.GetBits(15), new $Uint64(x$11.$high | x$12.$high, (x$11.$low | x$12.$low) >>> 0));
182619
+ bs.SkipBits(1);
182620
+ pkg.Dts = bs.GetBits(3);
182621
+ bs.SkipBits(1);
182622
+ pkg.Dts = (x$13 = $shiftLeft64(pkg.Pts, 15), x$14 = bs.GetBits(15), new $Uint64(x$13.$high | x$14.$high, (x$13.$low | x$14.$low) >>> 0));
182623
+ bs.SkipBits(1);
182624
+ pkg.Dts = (x$15 = $shiftLeft64(pkg.Pts, 15), x$16 = bs.GetBits(15), new $Uint64(x$15.$high | x$16.$high, (x$15.$low | x$16.$low) >>> 0));
182625
+ bs.SkipBits(1);
182626
+ } else if ((x$4 = bs.NextBits(8), (x$4.$high === 0 && x$4.$low === 15))) {
182627
+ bs.SkipBits(8);
182628
+ } else {
182629
+ return errParser;
182630
+ }
182631
+ loc = (_q = bs.DistanceFromMarkDot() / 8, (_q === _q && _q !== 1/0 && _q !== -1/0) ? _q >> 0 : $throwRuntimeError("integer divide by zero"));
182632
+ if (pkg.PES_packet_length < ((loc << 16 >>> 16))) {
182633
+ return errParser;
182634
+ }
182635
+ if ((pkg.PES_packet_length === 0) || bs.RemainBits() <= ($imul((((pkg.PES_packet_length - ((loc << 16 >>> 16)) << 16 >>> 16) >> 0)), 8))) {
182636
+ pkg.Pes_payload = bs.RemainData();
182637
+ bs.SkipBits(bs.RemainBits());
182638
+ } else {
182639
+ pkg.Pes_payload = $subslice(bs.RemainData(), 0, (pkg.PES_packet_length - ((loc << 16 >>> 16)) << 16 >>> 16));
182640
+ bs.SkipBits($imul((((pkg.PES_packet_length - ((loc << 16 >>> 16)) << 16 >>> 16) >> 0)), 8));
182641
+ }
182642
+ return $ifaceNil;
182643
+ };
182644
+ PesPacket.prototype.DecodeMpeg1 = function(bs) { return this.$val.DecodeMpeg1(bs); };
182645
+ PesPacket.ptr.prototype.Encode = function(bsw) {
182646
+ var bsw, pkg;
182647
+ pkg = this;
182648
+ bsw.PutBytes(new sliceType([0, 0, 1]));
182649
+ bsw.PutByte(pkg.Stream_id);
182650
+ bsw.PutUint16(pkg.PES_packet_length, 16);
182651
+ bsw.PutUint8(2, 2);
182652
+ bsw.PutUint8(pkg.PES_scrambling_control, 2);
182653
+ bsw.PutUint8(pkg.PES_priority, 1);
182654
+ bsw.PutUint8(pkg.Data_alignment_indicator, 1);
182655
+ bsw.PutUint8(pkg.Copyright, 1);
182656
+ bsw.PutUint8(pkg.Original_or_copy, 1);
182657
+ bsw.PutUint8(pkg.PTS_DTS_flags, 2);
182658
+ bsw.PutUint8(pkg.ESCR_flag, 1);
182659
+ bsw.PutUint8(pkg.ES_rate_flag, 1);
182660
+ bsw.PutUint8(pkg.DSM_trick_mode_flag, 1);
182661
+ bsw.PutUint8(pkg.Additional_copy_info_flag, 1);
182662
+ bsw.PutUint8(pkg.PES_CRC_flag, 1);
182663
+ bsw.PutUint8(pkg.PES_extension_flag, 1);
182664
+ bsw.PutByte(pkg.PES_header_data_length);
182665
+ if (pkg.PTS_DTS_flags === 2) {
182666
+ bsw.PutUint8(2, 4);
182667
+ bsw.PutUint64($shiftRightUint64(pkg.Pts, 30), 3);
182668
+ bsw.PutUint8(1, 1);
182669
+ bsw.PutUint64($shiftRightUint64(pkg.Pts, 15), 15);
182670
+ bsw.PutUint8(1, 1);
182671
+ bsw.PutUint64(pkg.Pts, 15);
182672
+ bsw.PutUint8(1, 1);
182673
+ }
182674
+ if (pkg.PTS_DTS_flags === 3) {
182675
+ bsw.PutUint8(3, 4);
182676
+ bsw.PutUint64($shiftRightUint64(pkg.Pts, 30), 3);
182677
+ bsw.PutUint8(1, 1);
182678
+ bsw.PutUint64($shiftRightUint64(pkg.Pts, 15), 15);
182679
+ bsw.PutUint8(1, 1);
182680
+ bsw.PutUint64(pkg.Pts, 15);
182681
+ bsw.PutUint8(1, 1);
182682
+ bsw.PutUint8(1, 4);
182683
+ bsw.PutUint64($shiftRightUint64(pkg.Dts, 30), 3);
182684
+ bsw.PutUint8(1, 1);
182685
+ bsw.PutUint64($shiftRightUint64(pkg.Dts, 15), 15);
182686
+ bsw.PutUint8(1, 1);
182687
+ bsw.PutUint64(pkg.Dts, 15);
182688
+ bsw.PutUint8(1, 1);
182689
+ }
182690
+ if (pkg.ESCR_flag === 1) {
182691
+ bsw.PutUint8(3, 2);
182692
+ bsw.PutUint64($shiftRightUint64(pkg.ESCR_base, 30), 3);
182693
+ bsw.PutUint8(1, 1);
182694
+ bsw.PutUint64($shiftRightUint64(pkg.ESCR_base, 15), 15);
182695
+ bsw.PutUint8(1, 1);
182696
+ bsw.PutUint64(pkg.ESCR_base, 15);
182697
+ bsw.PutUint8(1, 1);
182698
+ }
182699
+ bsw.PutBytes(pkg.Pes_payload);
182700
+ };
182701
+ PesPacket.prototype.Encode = function(bsw) { return this.$val.Encode(bsw); };
182702
+ ptrType$22.methods = [{prop: "PrettyPrint", name: "PrettyPrint", pkg: "", typ: $funcType([ptrType$20], [], false)}, {prop: "EncodeHeader", name: "EncodeHeader", pkg: "", typ: $funcType([ptrType$21], [], false)}, {prop: "DecodeHeader", name: "DecodeHeader", pkg: "", typ: $funcType([ptrType$18], [$error], false)}];
182703
+ ptrType.methods = [{prop: "PrettyPrint", name: "PrettyPrint", pkg: "", typ: $funcType([ptrType$20], [], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([ptrType$21], [], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([ptrType$18], [$error], false)}];
182704
+ ptrType$5.methods = [{prop: "PrettyPrint", name: "PrettyPrint", pkg: "", typ: $funcType([ptrType$20], [], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([ptrType$21], [], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([ptrType$18], [$error], false)}];
182705
+ ptrType$7.methods = [{prop: "PrettyPrint", name: "PrettyPrint", pkg: "", typ: $funcType([ptrType$20], [], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([ptrType$21], [], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([ptrType$18], [$error], false)}];
182706
+ ptrType$23.methods = [{prop: "AddStream", name: "AddStream", pkg: "", typ: $funcType([TS_STREAM_TYPE], [$Uint16], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([$Uint16, sliceType, $Uint64, $Uint64], [$error], false)}, {prop: "writePat", name: "writePat", pkg: "github.com/supraio/client-daemon/pkg/mpeg2", typ: $funcType([ptrType$5], [], false)}, {prop: "writePmt", name: "writePmt", pkg: "github.com/supraio/client-daemon/pkg/mpeg2", typ: $funcType([ptrType$7, ptrType$2], [], false)}, {prop: "writePES", name: "writePES", pkg: "github.com/supraio/client-daemon/pkg/mpeg2", typ: $funcType([ptrType$1, ptrType$2, sliceType, $Uint64, $Uint64, $Bool, $Bool], [], false)}];
182707
+ ptrType$25.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NeedMore", name: "NeedMore", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ParserError", name: "ParserError", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "StreamIdNotFound", name: "StreamIdNotFound", pkg: "", typ: $funcType([], [$Bool], false)}];
182708
+ ptrType$26.methods = [{prop: "Error", name: "Error", pkg: "", typ: $funcType([], [$String], false)}, {prop: "NeedMore", name: "NeedMore", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "ParserError", name: "ParserError", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "StreamIdNotFound", name: "StreamIdNotFound", pkg: "", typ: $funcType([], [$Bool], false)}];
182709
+ ptrType$4.methods = [{prop: "PrettyPrint", name: "PrettyPrint", pkg: "", typ: $funcType([ptrType$20], [], false)}, {prop: "Decode", name: "Decode", pkg: "", typ: $funcType([ptrType$18], [$error], false)}, {prop: "DecodeMpeg1", name: "DecodeMpeg1", pkg: "", typ: $funcType([ptrType$18], [$error], false)}, {prop: "Encode", name: "Encode", pkg: "", typ: $funcType([ptrType$21], [], false)}];
182710
+ TSPacket.init("", [{prop: "Transport_error_indicator", name: "Transport_error_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Payload_unit_start_indicator", name: "Payload_unit_start_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Transport_priority", name: "Transport_priority", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PID", name: "PID", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Transport_scrambling_control", name: "Transport_scrambling_control", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Adaptation_field_control", name: "Adaptation_field_control", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Continuity_counter", name: "Continuity_counter", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Field", name: "Field", embedded: false, exported: true, typ: ptrType, tag: ""}, {prop: "Payload", name: "Payload", embedded: false, exported: true, typ: $emptyInterface, tag: ""}]);
182711
+ Adaptation_field.init("", [{prop: "SingleStuffingByte", name: "SingleStuffingByte", embedded: false, exported: true, typ: $Bool, tag: ""}, {prop: "Adaptation_field_length", name: "Adaptation_field_length", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Discontinuity_indicator", name: "Discontinuity_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Random_access_indicator", name: "Random_access_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Elementary_stream_priority_indicator", name: "Elementary_stream_priority_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PCR_flag", name: "PCR_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "OPCR_flag", name: "OPCR_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Splicing_point_flag", name: "Splicing_point_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Transport_private_data_flag", name: "Transport_private_data_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Adaptation_field_extension_flag", name: "Adaptation_field_extension_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Program_clock_reference_base", name: "Program_clock_reference_base", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Program_clock_reference_extension", name: "Program_clock_reference_extension", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Original_program_clock_reference_base", name: "Original_program_clock_reference_base", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Original_program_clock_reference_extension", name: "Original_program_clock_reference_extension", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Splice_countdown", name: "Splice_countdown", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Transport_private_data_length", name: "Transport_private_data_length", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Adaptation_field_extension_length", name: "Adaptation_field_extension_length", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Ltw_flag", name: "Ltw_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Piecewise_rate_flag", name: "Piecewise_rate_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Seamless_splice_flag", name: "Seamless_splice_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Ltw_valid_flag", name: "Ltw_valid_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Ltw_offset", name: "Ltw_offset", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Piecewise_rate", name: "Piecewise_rate", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Splice_type", name: "Splice_type", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "DTS_next_AU", name: "DTS_next_AU", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Stuffing_byte", name: "Stuffing_byte", embedded: false, exported: true, typ: $Uint8, tag: ""}]);
182712
+ PmtPair.init("", [{prop: "Program_number", name: "Program_number", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "PID", name: "PID", embedded: false, exported: true, typ: $Uint16, tag: ""}]);
182713
+ Pat.init("", [{prop: "Table_id", name: "Table_id", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_syntax_indicator", name: "Section_syntax_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_length", name: "Section_length", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Transport_stream_id", name: "Transport_stream_id", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Version_number", name: "Version_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Current_next_indicator", name: "Current_next_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_number", name: "Section_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Last_section_number", name: "Last_section_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Pmts", name: "Pmts", embedded: false, exported: true, typ: sliceType$2, tag: ""}]);
182714
+ StreamPair.init("", [{prop: "StreamType", name: "StreamType", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Elementary_PID", name: "Elementary_PID", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "ES_Info_Length", name: "ES_Info_Length", embedded: false, exported: true, typ: $Uint16, tag: ""}]);
182715
+ Pmt.init("", [{prop: "Table_id", name: "Table_id", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_syntax_indicator", name: "Section_syntax_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_length", name: "Section_length", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Program_number", name: "Program_number", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Version_number", name: "Version_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Current_next_indicator", name: "Current_next_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Section_number", name: "Section_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Last_section_number", name: "Last_section_number", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PCR_PID", name: "PCR_PID", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Program_info_length", name: "Program_info_length", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Streams", name: "Streams", embedded: false, exported: true, typ: sliceType$3, tag: ""}]);
182716
+ pes_stream.init("github.com/supraio/client-daemon/pkg/mpeg2", [{prop: "pid", name: "pid", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "cc", name: "cc", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "streamtype", name: "streamtype", embedded: false, exported: false, typ: TS_STREAM_TYPE, tag: ""}]);
182717
+ table_pmt.init("github.com/supraio/client-daemon/pkg/mpeg2", [{prop: "pid", name: "pid", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "cc", name: "cc", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "pcr_pid", name: "pcr_pid", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "version_number", name: "version_number", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "pm", name: "pm", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "streams", name: "streams", embedded: false, exported: false, typ: sliceType$4, tag: ""}]);
182718
+ table_pat.init("github.com/supraio/client-daemon/pkg/mpeg2", [{prop: "cc", name: "cc", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "version_number", name: "version_number", embedded: false, exported: false, typ: $Uint8, tag: ""}, {prop: "pmts", name: "pmts", embedded: false, exported: false, typ: sliceType$5, tag: ""}]);
182719
+ TSMuxer.init("github.com/supraio/client-daemon/pkg/mpeg2", [{prop: "pat", name: "pat", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "stream_pid", name: "stream_pid", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "pmt_pid", name: "pmt_pid", embedded: false, exported: false, typ: $Uint16, tag: ""}, {prop: "pat_period", name: "pat_period", embedded: false, exported: false, typ: $Uint64, tag: ""}, {prop: "OnPacket", name: "OnPacket", embedded: false, exported: true, typ: funcType, tag: ""}]);
182720
+ needmoreError.init("", []);
182721
+ parserError.init("", []);
182722
+ PesPacket.init("", [{prop: "Stream_id", name: "Stream_id", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PES_packet_length", name: "PES_packet_length", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "PES_scrambling_control", name: "PES_scrambling_control", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PES_priority", name: "PES_priority", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Data_alignment_indicator", name: "Data_alignment_indicator", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Copyright", name: "Copyright", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Original_or_copy", name: "Original_or_copy", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PTS_DTS_flags", name: "PTS_DTS_flags", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "ESCR_flag", name: "ESCR_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "ES_rate_flag", name: "ES_rate_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "DSM_trick_mode_flag", name: "DSM_trick_mode_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Additional_copy_info_flag", name: "Additional_copy_info_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PES_CRC_flag", name: "PES_CRC_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PES_extension_flag", name: "PES_extension_flag", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "PES_header_data_length", name: "PES_header_data_length", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Pts", name: "Pts", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "Dts", name: "Dts", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "ESCR_base", name: "ESCR_base", embedded: false, exported: true, typ: $Uint64, tag: ""}, {prop: "ESCR_extension", name: "ESCR_extension", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "ES_rate", name: "ES_rate", embedded: false, exported: true, typ: $Uint32, tag: ""}, {prop: "Trick_mode_control", name: "Trick_mode_control", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Trick_value", name: "Trick_value", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Additional_copy_info", name: "Additional_copy_info", embedded: false, exported: true, typ: $Uint8, tag: ""}, {prop: "Previous_PES_packet_CRC", name: "Previous_PES_packet_CRC", embedded: false, exported: true, typ: $Uint16, tag: ""}, {prop: "Pes_payload", name: "Pes_payload", embedded: false, exported: true, typ: sliceType, tag: ""}]);
182723
+ $init = function() {
182724
+ $pkg.$init = function() {};
182725
+ /* */ 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:
182726
+ $r = binary.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182727
+ $r = errors.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182728
+ $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182729
+ $r = codec.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182730
+ $r = io.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182731
+ $r = os.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182732
+ errNeedMore = new needmoreError.ptr();
182733
+ errParser = new parserError.ptr();
182734
+ $pkg.H264_AUD_NALU = new sliceType([0, 0, 0, 1, 9, 240]);
182735
+ $pkg.H265_AUD_NALU = new sliceType([0, 0, 0, 1, 70, 1, 80]);
182736
+ /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
182737
+ };
182738
+ $pkg.$init = $init;
182739
+ return $pkg;
182740
+ })();
182741
+ $packages["github.com/supraio/client-daemon/pkg/decoder/android"] = (function() {
182742
+ var $pkg = {}, $init, base64, fmt, general, mpeg2, js, time, AndroidDecoder, sliceType, funcType, arrayType, ptrType, sliceType$1, ptrType$1, init, initFakeBridge, IsAvailable, NewDecoder;
182743
+ base64 = $packages["encoding/base64"];
182744
+ fmt = $packages["fmt"];
182745
+ general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
182746
+ mpeg2 = $packages["github.com/supraio/client-daemon/pkg/mpeg2"];
182747
+ js = $packages["syscall/js"];
182748
+ time = $packages["time"];
182749
+ AndroidDecoder = $pkg.AndroidDecoder = $newType(0, $kindStruct, "android.AndroidDecoder", true, "github.com/supraio/client-daemon/pkg/decoder/android", true, function(androidPlayer_, started_, sos_, tsMuxer_, videoStreamID_) {
182750
+ this.$val = this;
182751
+ if (arguments.length === 0) {
182752
+ this.androidPlayer = new js.Value.ptr(null, false, arrayType.zero());
182753
+ this.started = false;
182754
+ this.sos = new js.Value.ptr(null, false, arrayType.zero());
182755
+ this.tsMuxer = ptrType.nil;
182756
+ this.videoStreamID = 0;
182757
+ return;
182758
+ }
182759
+ this.androidPlayer = androidPlayer_;
182760
+ this.started = started_;
182761
+ this.sos = sos_;
182762
+ this.tsMuxer = tsMuxer_;
182763
+ this.videoStreamID = videoStreamID_;
182764
+ });
182765
+ sliceType = $sliceType($emptyInterface);
182766
+ funcType = $funcType([], [], false);
182767
+ arrayType = $arrayType(funcType, 0);
182768
+ ptrType = $ptrType(mpeg2.TSMuxer);
182769
+ sliceType$1 = $sliceType($Uint8);
182770
+ ptrType$1 = $ptrType(AndroidDecoder);
182771
+ init = function() {
182772
+ var {$s, $r, $c} = $restore(this, {});
182773
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182774
+ /* */ if ($clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).IsUndefined()) { $s = 1; continue; }
182775
+ /* */ $s = 2; continue;
182776
+ /* if ($clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).IsUndefined()) { */ case 1:
182777
+ $r = initFakeBridge(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182778
+ /* } */ case 2:
182779
+ $s = -1; return;
182780
+ /* */ } return; } var $f = {$blk: init, $c: true, $r, $s};return $f;
182781
+ };
182782
+ initFakeBridge = function() {
182783
+ var {_r, _r$1, fakeBridge, onMpeg2Packet, startLocalMpeg2Stream, stopLocalMpeg2Stream, $s, $r, $c} = $restore(this, {});
182784
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182785
+ _r = fmt.Println(new sliceType([new $String("Initializing fake"), new $String("AndroidSupraMedia"), new $String("bridge")])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182786
+ _r;
182787
+ _r$1 = $clone($clone(js.Global(), js.Value).Get("Object"), js.Value).New(sliceType.nil); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
182788
+ fakeBridge = $clone(_r$1, js.Value);
182789
+ $clone(js.Global(), js.Value).Set("AndroidSupraMedia", new fakeBridge.constructor.elem(fakeBridge));
182790
+ onMpeg2Packet = $clone(js.FuncOf((function(this$1, args) {
182791
+ var args, this$1;
182792
+ return $ifaceNil;
182793
+ })), js.Func);
182794
+ $clone(fakeBridge, js.Value).Set("serveData", new onMpeg2Packet.constructor.elem(onMpeg2Packet));
182795
+ startLocalMpeg2Stream = $clone(js.FuncOf((function(this$1, args) {
182796
+ var args, this$1;
182797
+ return $ifaceNil;
182798
+ })), js.Func);
182799
+ $clone(fakeBridge, js.Value).Set("startLocalStreaming", new startLocalMpeg2Stream.constructor.elem(startLocalMpeg2Stream));
182800
+ stopLocalMpeg2Stream = $clone(js.FuncOf((function(this$1, args) {
182801
+ var args, this$1;
182802
+ return $ifaceNil;
182803
+ })), js.Func);
182804
+ $clone(fakeBridge, js.Value).Set("stopLocalStreaming", new stopLocalMpeg2Stream.constructor.elem(stopLocalMpeg2Stream));
182805
+ $s = -1; return;
182806
+ /* */ } return; } var $f = {$blk: initFakeBridge, $c: true, $r, _r, _r$1, fakeBridge, onMpeg2Packet, startLocalMpeg2Stream, stopLocalMpeg2Stream, $s};return $f;
182807
+ };
182808
+ IsAvailable = function() {
182809
+ return !$clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).IsUndefined();
182810
+ };
182811
+ $pkg.IsAvailable = IsAvailable;
182812
+ NewDecoder = function(header) {
182813
+ var androidPlayer, header, sos, tsMuxer, videoStreamID;
182814
+ sos = $clone($clone(js.Global(), js.Value).Get("sos"), js.Value);
182815
+ androidPlayer = $clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value);
182816
+ tsMuxer = mpeg2.NewTSMuxer();
182817
+ tsMuxer.OnPacket = (function $b(packet) {
182818
+ var {_r, packet, str, $s, $r, $c} = $restore(this, {packet});
182819
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182820
+ str = base64.StdEncoding.EncodeToString(packet);
182821
+ _r = $clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).Call("serveData", new sliceType([new $String(str)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182822
+ _r;
182823
+ $s = -1; return;
182824
+ /* */ } return; } var $f = {$blk: $b, $c: true, $r, _r, packet, str, $s};return $f;
182825
+ });
182826
+ videoStreamID = tsMuxer.AddStream(27);
182827
+ return [new AndroidDecoder.ptr($clone(androidPlayer, js.Value), false, $clone(sos, js.Value), tsMuxer, videoStreamID), $ifaceNil];
182828
+ };
182829
+ $pkg.NewDecoder = NewDecoder;
182830
+ AndroidDecoder.ptr.prototype.Write = function(nal, timestamp) {
182831
+ var {_r, _r$1, ad, err, hostname, nal, port, timestamp, urlProtocol, x, x$1, $s, $r, $c} = $restore(this, {nal, timestamp});
182832
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182833
+ ad = this;
182834
+ /* */ if (!ad.started) { $s = 1; continue; }
182835
+ /* */ $s = 2; continue;
182836
+ /* if (!ad.started) { */ case 1:
182837
+ urlProtocol = "udp";
182838
+ hostname = "127.0.0.1";
182839
+ port = 1234;
182840
+ _r = $clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).Call("startLocalStreaming", new sliceType([new $String(urlProtocol), new $String(hostname), new $Int(port)])); /* */ $s = 3; case 3: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182841
+ _r;
182842
+ ad.started = true;
182843
+ /* } */ case 2:
182844
+ _r$1 = ad.tsMuxer.Write(ad.videoStreamID, nal, ((x = $clone(timestamp, time.Time).UnixNano(), new $Uint64(x.$high, x.$low))), ((x$1 = $clone(timestamp, time.Time).UnixNano(), new $Uint64(x$1.$high, x$1.$low)))); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
182845
+ err = _r$1;
182846
+ if (!($interfaceIsEqual(err, $ifaceNil))) {
182847
+ $s = -1; return err;
182848
+ }
182849
+ $s = -1; return $ifaceNil;
182850
+ /* */ } return; } var $f = {$blk: AndroidDecoder.ptr.prototype.Write, $c: true, $r, _r, _r$1, ad, err, hostname, nal, port, timestamp, urlProtocol, x, x$1, $s};return $f;
182851
+ };
182852
+ AndroidDecoder.prototype.Write = function(nal, timestamp) { return this.$val.Write(nal, timestamp); };
182853
+ AndroidDecoder.ptr.prototype.NextOutput = function(outputBuffer) {
182854
+ var m, outputBuffer;
182855
+ m = this;
182856
+ return $ifaceNil;
182857
+ };
182858
+ AndroidDecoder.prototype.NextOutput = function(outputBuffer) { return this.$val.NextOutput(outputBuffer); };
182859
+ AndroidDecoder.ptr.prototype.Release = function(outputBuffer) {
182860
+ var {_r, m, outputBuffer, $s, $r, $c} = $restore(this, {outputBuffer});
182861
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
182862
+ m = this;
182863
+ _r = $clone($clone(js.Global(), js.Value).Get("AndroidSupraMedia"), js.Value).Call("stopLocalStreaming", sliceType.nil); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
182864
+ _r;
182865
+ $s = -1; return;
182866
+ /* */ } return; } var $f = {$blk: AndroidDecoder.ptr.prototype.Release, $c: true, $r, _r, m, outputBuffer, $s};return $f;
182867
+ };
182868
+ AndroidDecoder.prototype.Release = function(outputBuffer) { return this.$val.Release(outputBuffer); };
182869
+ ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}];
182870
+ AndroidDecoder.init("github.com/supraio/client-daemon/pkg/decoder/android", [{prop: "androidPlayer", name: "androidPlayer", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "started", name: "started", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "sos", name: "sos", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "tsMuxer", name: "tsMuxer", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "videoStreamID", name: "videoStreamID", embedded: false, exported: false, typ: $Uint16, tag: ""}]);
182871
+ $init = function() {
182872
+ $pkg.$init = function() {};
182873
+ /* */ 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:
182874
+ $r = base64.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182875
+ $r = fmt.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182876
+ $r = general.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182877
+ $r = mpeg2.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182878
+ $r = js.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182879
+ $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182880
+ $r = init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
182881
+ /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
182882
+ };
182883
+ $pkg.$init = $init;
182884
+ return $pkg;
182885
+ })();
180450
182886
  $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/jsdecoder"] = (function() {
180451
182887
  var $pkg = {}, $init, js, ptrType, sliceType, initiateReset, jsNaClDecoder, ResetBeforeNextDecode, ShouldResetOnNextDecode, MarkResetDone, IsAvailable, CreateJsNaClDecoder, GetJsNaClDecoder, RemoveJsNaClDecoder;
180452
182888
  js = $packages["syscall/js"];
@@ -183733,7 +186169,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/nacldriver"]
183733
186169
  return $pkg;
183734
186170
  })();
183735
186171
  $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (function() {
183736
- var $pkg = {}, $init, general, jsdecoder, nacldriver, errs, jshelper, sync, js, NaClDecoder, sliceType, ptrType, ptrType$1, sliceType$1, ptrType$2, IsAvailable, NewDecoder;
186172
+ var $pkg = {}, $init, general, jsdecoder, nacldriver, errs, jshelper, sync, js, time, NaClDecoder, sliceType, ptrType, ptrType$1, sliceType$1, ptrType$2, IsAvailable, NewDecoder;
183737
186173
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
183738
186174
  jsdecoder = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/jsdecoder"];
183739
186175
  nacldriver = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/nacldriver"];
@@ -183741,6 +186177,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
183741
186177
  jshelper = $packages["github.com/supraio/client-daemon/pkg/jshelper"];
183742
186178
  sync = $packages["sync"];
183743
186179
  js = $packages["syscall/js"];
186180
+ time = $packages["time"];
183744
186181
  NaClDecoder = $pkg.NaClDecoder = $newType(0, $kindStruct, "nacldecoder.NaClDecoder", true, "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", true, function(initialized_, mutexDecode_, mutexGetPicture_) {
183745
186182
  this.$val = this;
183746
186183
  if (arguments.length === 0) {
@@ -183860,8 +186297,8 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
183860
186297
  /* */ } return; } var $f = {$blk: NaClDecoder.ptr.prototype.destroy, $c: true, $r, $24r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _tuple, destroyPromise, err, m, $s};return $f;
183861
186298
  };
183862
186299
  NaClDecoder.prototype.destroy = function() { return this.$val.destroy(); };
183863
- NaClDecoder.ptr.prototype.Write = function(nal) {
183864
- var {$24r, $24r$1, _arg, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, decodeArgs, decodePromise, decodeResult, err, err$1, err$2, jsNaClDecoder, m, nal, pictureBuffer, pictureUint8Array, $s, $r, $c} = $restore(this, {nal});
186300
+ NaClDecoder.ptr.prototype.Write = function(nal, param) {
186301
+ var {$24r, $24r$1, _arg, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, decodeArgs, decodePromise, decodeResult, err, err$1, err$2, jsNaClDecoder, m, nal, param, pictureBuffer, pictureUint8Array, $s, $r, $c} = $restore(this, {nal, param});
183865
186302
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
183866
186303
  m = this;
183867
186304
  /* */ if (jsdecoder.ShouldResetOnNextDecode()) { $s = 1; continue; }
@@ -183937,9 +186374,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
183937
186374
  $s = 33; case 33: return $24r$1;
183938
186375
  /* } */ case 31:
183939
186376
  $s = -1; return $ifaceNil;
183940
- /* */ } return; } var $f = {$blk: NaClDecoder.ptr.prototype.Write, $c: true, $r, $24r, $24r$1, _arg, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, decodeArgs, decodePromise, decodeResult, err, err$1, err$2, jsNaClDecoder, m, nal, pictureBuffer, pictureUint8Array, $s};return $f;
186377
+ /* */ } return; } var $f = {$blk: NaClDecoder.ptr.prototype.Write, $c: true, $r, $24r, $24r$1, _arg, _r, _r$1, _r$10, _r$11, _r$12, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, decodeArgs, decodePromise, decodeResult, err, err$1, err$2, jsNaClDecoder, m, nal, param, pictureBuffer, pictureUint8Array, $s};return $f;
183941
186378
  };
183942
- NaClDecoder.prototype.Write = function(nal) { return this.$val.Write(nal); };
186379
+ NaClDecoder.prototype.Write = function(nal, param) { return this.$val.Write(nal, param); };
183943
186380
  NaClDecoder.ptr.prototype.NextOutput = function(outputBuffer) {
183944
186381
  var {$24r, $24r$1, $24r$2, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, err, jsNaClDecoder, m, outputBuffer, picture, picturePromise, $s, $r, $c} = $restore(this, {outputBuffer});
183945
186382
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
@@ -183999,7 +186436,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
183999
186436
  /* */ } return; } var $f = {$blk: NaClDecoder.ptr.prototype.Release, $c: true, $r, _r, jsNaClDecoder, m, outputBuffer, picture, x, $s};return $f;
184000
186437
  };
184001
186438
  NaClDecoder.prototype.Release = function(outputBuffer) { return this.$val.Release(outputBuffer); };
184002
- ptrType$2.methods = [{prop: "initialize", name: "initialize", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([sliceType$1], [$error], false)}, {prop: "reset", name: "reset", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}];
186439
+ ptrType$2.methods = [{prop: "initialize", name: "initialize", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([sliceType$1], [$error], false)}, {prop: "reset", name: "reset", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([], [$error], false)}, {prop: "destroy", name: "destroy", pkg: "github.com/supraio/client-daemon/pkg/decoder/nacldecoder", typ: $funcType([], [$error], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}];
184003
186440
  NaClDecoder.init("github.com/supraio/client-daemon/pkg/decoder/nacldecoder", [{prop: "initialized", name: "initialized", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "mutexDecode", name: "mutexDecode", embedded: false, exported: false, typ: sync.Mutex, tag: ""}, {prop: "mutexGetPicture", name: "mutexGetPicture", embedded: false, exported: false, typ: sync.Mutex, tag: ""}]);
184004
186441
  $init = function() {
184005
186442
  $pkg.$init = function() {};
@@ -184011,6 +186448,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"] = (functio
184011
186448
  $r = jshelper.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
184012
186449
  $r = sync.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
184013
186450
  $r = js.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
186451
+ $r = time.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
184014
186452
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
184015
186453
  };
184016
186454
  $pkg.$init = $init;
@@ -188380,7 +190818,7 @@ $packages["github.com/nuberu/webgl"] = (function() {
188380
190818
  return $pkg;
188381
190819
  })();
188382
190820
  $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"] = (function() {
188383
- var $pkg = {}, $init, fmt, dom, screen, f64, image, color, draw, log, sync, js, windowImpl, screenImpl, YCbCrJS, BufferImpl, sliceType, ptrType, ptrType$1, funcType, arrayType, ptrType$2, ptrType$3, sliceType$1, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, newWindow, Main, main, newScreenImpl, newBuffer;
190821
+ var $pkg = {}, $init, fmt, dom, screen, f64, image, color, draw, sync, js, windowImpl, screenImpl, YCbCrJS, BufferImpl, sliceType, ptrType, ptrType$1, funcType, arrayType, ptrType$2, ptrType$3, sliceType$1, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, ptrType$10, newWindow, Main, main, newScreenImpl, newBuffer;
188384
190822
  fmt = $packages["fmt"];
188385
190823
  dom = $packages["golang.org/x/exp/shiny/driver/util/dom"];
188386
190824
  screen = $packages["golang.org/x/exp/shiny/screen"];
@@ -188388,7 +190826,6 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"] = (f
188388
190826
  image = $packages["image"];
188389
190827
  color = $packages["image/color"];
188390
190828
  draw = $packages["image/draw"];
188391
- log = $packages["log"];
188392
190829
  sync = $packages["sync"];
188393
190830
  js = $packages["syscall/js"];
188394
190831
  windowImpl = $pkg.windowImpl = $newType(0, $kindStruct, "canvasdriver.windowImpl", true, "github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver", false, function(screen_, mutex_, canvasEl_, ctx2d_, released_, domEvents_, resizeCallback_) {
@@ -188471,9 +190908,8 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"] = (f
188471
190908
  canvasEl[0] = $clone(_r, js.Value);
188472
190909
  _r$1 = $clone($clone(screen$1.doc, js.Value).Get("body"), js.Value).Call("appendChild", new sliceType([new canvasEl[0].constructor.elem(canvasEl[0])])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
188473
190910
  _r$1;
188474
- adaptCanvas[0] = (function(adaptCanvas, canvasEl) { return function $b() {
188475
- var {height, scale, width, $s, $r, $c} = $restore(this, {});
188476
- /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
190911
+ adaptCanvas[0] = (function(adaptCanvas, canvasEl) { return function() {
190912
+ var height, scale, width;
188477
190913
  scale = dom.GetBrowserZoomRatio();
188478
190914
  width = (((dom.GetScreenWidth()) / scale >> 0));
188479
190915
  if (!(($clone($clone(canvasEl[0], js.Value).Get("width"), js.Value).Int() === width))) {
@@ -188483,9 +190919,6 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"] = (f
188483
190919
  if (!(($clone($clone(canvasEl[0], js.Value).Get("height"), js.Value).Int() === height))) {
188484
190920
  $clone(canvasEl[0], js.Value).Set("height", new $Int(height));
188485
190921
  }
188486
- $r = log.Println(new sliceType([new $String("ASDF newWindow adaptCanvas scale, canvas width, height"), new $Float64(scale), new $Int(width), new $Int(height)])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188487
- $s = -1; return;
188488
- /* */ } return; } var $f = {$blk: $b, $c: true, $r, height, scale, width, $s};return $f;
188489
190922
  }; })(adaptCanvas, canvasEl);
188490
190923
  $r = adaptCanvas[0](); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188491
190924
  resizeCallback = $clone(js.FuncOf((function(adaptCanvas, canvasEl) { return function $b(this$1, args) {
@@ -188799,9 +191232,8 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"] = (f
188799
191232
  $r = image.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188800
191233
  $r = color.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188801
191234
  $r = draw.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188802
- $r = log.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188803
- $r = sync.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188804
- $r = js.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191235
+ $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191236
+ $r = js.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
188805
191237
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
188806
191238
  };
188807
191239
  $pkg.$init = $init;
@@ -189439,7 +191871,7 @@ $packages["github.com/supraio/client-daemon/pkg/x264"] = (function() {
189439
191871
  return $pkg;
189440
191872
  })();
189441
191873
  $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function() {
189442
- var $pkg = {}, $init, fmt, webgl, general, errs, jshelper, canvasdriver, x264, image, log, js, WebCodecsDecoder, ptrType, sliceType, ptrType$1, sliceType$1, ptrType$2, chanType, chanType$1, funcType, IsAvailable, NewDecoder;
191874
+ var $pkg = {}, $init, fmt, webgl, general, errs, jshelper, canvasdriver, x264, image, log, js, time, WebCodecsDecoder, ptrType, sliceType, ptrType$1, sliceType$1, ptrType$2, chanType, chanType$1, funcType, IsAvailable, NewDecoder, createAcceleratedConfigMaybe, isConfigSupported;
189443
191875
  fmt = $packages["fmt"];
189444
191876
  webgl = $packages["github.com/nuberu/webgl"];
189445
191877
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
@@ -189450,6 +191882,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189450
191882
  image = $packages["image"];
189451
191883
  log = $packages["log"];
189452
191884
  js = $packages["syscall/js"];
191885
+ time = $packages["time"];
189453
191886
  WebCodecsDecoder = $pkg.WebCodecsDecoder = $newType(0, $kindStruct, "webcodecs.WebCodecsDecoder", true, "github.com/supraio/client-daemon/pkg/decoder/webcodecs", true, function(jsVideoDecoder_, outputChan_, errorChan_, releaseVideoDecoder_) {
189454
191887
  this.$val = this;
189455
191888
  if (arguments.length === 0) {
@@ -189482,7 +191915,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189482
191915
  };
189483
191916
  $pkg.NewDecoder = NewDecoder;
189484
191917
  WebCodecsDecoder.ptr.prototype.configure = function(nal) {
189485
- var {_arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, config, d, err, errorCallback, expectedResolution, init, jsVideoDecoder, nal, outputCallback, sps, $s, $r, $c} = $restore(this, {nal});
191918
+ var {_arg, _arg$1, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, config, d, err, errorCallback, expectedResolution, init, jsVideoDecoder, nal, outputCallback, sps, $s, $r, $c} = $restore(this, {nal});
189486
191919
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
189487
191920
  d = [d];
189488
191921
  errorCallback = [errorCallback];
@@ -189497,8 +191930,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189497
191930
  /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; }
189498
191931
  /* */ $s = 3; continue;
189499
191932
  /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2:
189500
- _r$1 = fmt.Errorf("failed to configure WebCodecsDecoder: %w", new sliceType([err])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
189501
- $panic(_r$1);
191933
+ _r$1 = fmt.Printf("failed to configure WebCodecsDecoder: %v", new sliceType([err])); /* */ $s = 4; case 4: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
191934
+ _r$1;
191935
+ $s = -1; return;
189502
191936
  /* } */ case 3:
189503
191937
  _r$2 = sps.Resolution(); /* */ $s = 5; case 5: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
189504
191938
  _tuple$1 = _r$2;
@@ -189507,8 +191941,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189507
191941
  /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 6; continue; }
189508
191942
  /* */ $s = 7; continue;
189509
191943
  /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 6:
189510
- _r$3 = fmt.Errorf("failed to configure WebCodecsDecoder: %w", new sliceType([err])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
189511
- $panic(_r$3);
191944
+ _r$3 = fmt.Printf("failed to configure WebCodecsDecoder: %v", new sliceType([err])); /* */ $s = 8; case 8: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
191945
+ _r$3;
191946
+ $s = -1; return;
189512
191947
  /* } */ case 7:
189513
191948
  _r$4 = $clone($clone(js.Global(), js.Value).Get("Object"), js.Value).New(sliceType.nil); /* */ $s = 9; case 9: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
189514
191949
  init = $clone(_r$4, js.Value);
@@ -189521,7 +191956,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189521
191956
  /* */ if (!((frameDisplayWidth === expectedResolution[0].X)) || !((frameDisplayHeight === expectedResolution[0].Y))) { $s = 1; continue; }
189522
191957
  /* */ $s = 2; continue;
189523
191958
  /* if (!((frameDisplayWidth === expectedResolution[0].X)) || !((frameDisplayHeight === expectedResolution[0].Y))) { */ case 1:
189524
- $r = log.Printf("WebCodecsDecoder output resolution mismatch. Expected %v, got %dx%d", new sliceType([expectedResolution[0], new $Int(frameDisplayWidth), new $Int(frameDisplayHeight)])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191959
+ $r = log.Printf("WebCodecs VideoDecoder output resolution mismatch. Expected %v, got %dx%d", new sliceType([expectedResolution[0], new $Int(frameDisplayWidth), new $Int(frameDisplayHeight)])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189525
191960
  /* } */ case 2:
189526
191961
  $r = $send(d[0].outputChan, $clone($clone(frame, js.Value), js.Value)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189527
191962
  $s = -1; return $ifaceNil;
@@ -189547,20 +191982,17 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189547
191982
  _arg = new $String(_r$7);
189548
191983
  $r = $clone(config, js.Value).Set("codec", _arg); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189549
191984
  $clone(config, js.Value).Set("optimizeForLatency", new $Bool(true));
189550
- /* */ if ($interfaceIsEqual(err, $ifaceNil)) { $s = 14; continue; }
189551
- /* */ $s = 15; continue;
189552
- /* if ($interfaceIsEqual(err, $ifaceNil)) { */ case 14:
189553
- $clone(config, js.Value).Set("codedWidth", new $Int(expectedResolution[0].X));
189554
- $clone(config, js.Value).Set("codedHeight", new $Int(expectedResolution[0].Y));
189555
- $clone(config, js.Value).Set("displayAspectWidth", new $Int(expectedResolution[0].X));
189556
- $clone(config, js.Value).Set("displayAspectHeight", new $Int(expectedResolution[0].Y));
189557
- $s = 16; continue;
189558
- /* } else { */ case 15:
189559
- _r$8 = fmt.Errorf("failed to configure WebCodecsDecoder: %w", new sliceType([err])); /* */ $s = 17; case 17: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
189560
- $panic(_r$8);
189561
- /* } */ case 16:
189562
- _r$9 = $clone(jsVideoDecoder[0], js.Value).Call("configure", new sliceType([new config.constructor.elem(config)])); /* */ $s = 18; case 18: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
189563
- _r$9;
191985
+ $clone(config, js.Value).Set("codedWidth", new $Int(expectedResolution[0].X));
191986
+ $clone(config, js.Value).Set("codedHeight", new $Int(expectedResolution[0].Y));
191987
+ $clone(config, js.Value).Set("displayAspectWidth", new $Int(expectedResolution[0].X));
191988
+ $clone(config, js.Value).Set("displayAspectHeight", new $Int(expectedResolution[0].Y));
191989
+ _r$8 = createAcceleratedConfigMaybe($clone(config, js.Value)); /* */ $s = 14; case 14: if($c) { $c = false; _r$8 = _r$8.$blk(); } if (_r$8 && _r$8.$blk !== undefined) { break s; }
191990
+ js.Value.copy(config, _r$8);
191991
+ _r$9 = jshelper.Stringify($clone(config, js.Value)); /* */ $s = 15; case 15: if($c) { $c = false; _r$9 = _r$9.$blk(); } if (_r$9 && _r$9.$blk !== undefined) { break s; }
191992
+ _arg$1 = new $String(_r$9);
191993
+ $r = log.Println(new sliceType([new $String("WebCodecs VideoDecoder config"), _arg$1])); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191994
+ _r$10 = $clone(jsVideoDecoder[0], js.Value).Call("configure", new sliceType([new config.constructor.elem(config)])); /* */ $s = 17; case 17: if($c) { $c = false; _r$10 = _r$10.$blk(); } if (_r$10 && _r$10.$blk !== undefined) { break s; }
191995
+ _r$10;
189564
191996
  d[0].jsVideoDecoder = jsVideoDecoder[0];
189565
191997
  d[0].releaseVideoDecoder = (function(d, errorCallback, expectedResolution, jsVideoDecoder, outputCallback) { return function() {
189566
191998
  d[0].jsVideoDecoder = ptrType.nil;
@@ -189569,11 +192001,55 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189569
192001
  $clone(errorCallback[0], js.Func).Release();
189570
192002
  }; })(d, errorCallback, expectedResolution, jsVideoDecoder, outputCallback);
189571
192003
  $s = -1; return;
189572
- /* */ } return; } var $f = {$blk: WebCodecsDecoder.ptr.prototype.configure, $c: true, $r, _arg, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, config, d, err, errorCallback, expectedResolution, init, jsVideoDecoder, nal, outputCallback, sps, $s};return $f;
192004
+ /* */ } return; } var $f = {$blk: WebCodecsDecoder.ptr.prototype.configure, $c: true, $r, _arg, _arg$1, _r, _r$1, _r$10, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, config, d, err, errorCallback, expectedResolution, init, jsVideoDecoder, nal, outputCallback, sps, $s};return $f;
189573
192005
  };
189574
192006
  WebCodecsDecoder.prototype.configure = function(nal) { return this.$val.configure(nal); };
189575
- WebCodecsDecoder.ptr.prototype.Write = function(nal) {
189576
- var {$24r, _r, _r$1, _r$2, _r$3, _r$4, chunk, chunkOpts, d, errDec, frameData, frameType, nal, $s, $r, $c} = $restore(this, {nal});
192007
+ createAcceleratedConfigMaybe = function(config) {
192008
+ var {_r, _r$1, _tuple, _tuple$1, config, isSupported, supportedConfig, $s, $r, $c} = $restore(this, {config});
192009
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
192010
+ $clone(config, js.Value).Set("hardwareAcceleration", new $String("prefer-hardware"));
192011
+ _r = isConfigSupported($clone(config, js.Value)); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
192012
+ _tuple = _r;
192013
+ supportedConfig = _tuple[0];
192014
+ isSupported = _tuple[1];
192015
+ if (isSupported) {
192016
+ $s = -1; return supportedConfig;
192017
+ }
192018
+ $clone(config, js.Value).Set("hardwareAcceleration", new $String("no-preference"));
192019
+ _r$1 = isConfigSupported($clone(config, js.Value)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
192020
+ _tuple$1 = _r$1;
192021
+ supportedConfig = _tuple$1[0];
192022
+ isSupported = _tuple$1[1];
192023
+ /* */ if (!isSupported) { $s = 3; continue; }
192024
+ /* */ $s = 4; continue;
192025
+ /* if (!isSupported) { */ case 3:
192026
+ $r = log.Println(new sliceType([new $String("using UNSUPPORTED WebCodecs VideoDecoder configuration, decoding result unknown")])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192027
+ /* } */ case 4:
192028
+ $s = -1; return supportedConfig;
192029
+ /* */ } return; } var $f = {$blk: createAcceleratedConfigMaybe, $c: true, $r, _r, _r$1, _tuple, _tuple$1, config, isSupported, supportedConfig, $s};return $f;
192030
+ };
192031
+ isConfigSupported = function(config) {
192032
+ var {_r, _r$1, _tuple, cfg, config, errJsValue, supportedJsValue, supportedPromise, $s, $r, $c} = $restore(this, {config});
192033
+ /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
192034
+ cfg = [cfg];
192035
+ _r = $clone($clone(js.Global(), js.Value).Get("VideoDecoder"), js.Value).Call("isConfigSupported", new sliceType([new config.constructor.elem(config)])); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
192036
+ supportedPromise = $clone(_r, js.Value);
192037
+ _r$1 = jshelper.Await($clone(supportedPromise, js.Value)); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
192038
+ _tuple = _r$1;
192039
+ supportedJsValue = _tuple[0];
192040
+ errJsValue = _tuple[1];
192041
+ if (!(errJsValue === ptrType.nil)) {
192042
+ $s = -1; return [ptrType.nil, false];
192043
+ }
192044
+ if (!$clone($clone(supportedJsValue, js.Value).Get("supported"), js.Value).Bool()) {
192045
+ $s = -1; return [ptrType.nil, false];
192046
+ }
192047
+ cfg[0] = $clone($clone(supportedJsValue, js.Value).Get("config"), js.Value);
192048
+ $s = -1; return [cfg[0], true];
192049
+ /* */ } return; } var $f = {$blk: isConfigSupported, $c: true, $r, _r, _r$1, _tuple, cfg, config, errJsValue, supportedJsValue, supportedPromise, $s};return $f;
192050
+ };
192051
+ WebCodecsDecoder.ptr.prototype.Write = function(nal, param) {
192052
+ var {$24r, _r, _r$1, _r$2, _r$3, _r$4, chunk, chunkOpts, d, errDec, frameData, frameType, nal, param, $s, $r, $c} = $restore(this, {nal, param});
189577
192053
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
189578
192054
  d = this;
189579
192055
  frameType = "delta";
@@ -189604,19 +192080,17 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189604
192080
  /* */ if (!($interfaceIsEqual(errDec, $ifaceNil))) { $s = 12; continue; }
189605
192081
  /* */ $s = 13; continue;
189606
192082
  /* if (!($interfaceIsEqual(errDec, $ifaceNil))) { */ case 12:
189607
- $r = log.Println(new sliceType([new $String("ASDF[GO] WebCodecsDecoder.Write decoding error, decoder state="), new $String($clone($clone(d.jsVideoDecoder, js.Value).Get("state"), js.Value).String())])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189608
- /* */ if ($clone($clone(d.jsVideoDecoder, js.Value).Get("state"), js.Value).String() === "closed") { $s = 15; continue; }
189609
- /* */ $s = 16; continue;
189610
- /* if ($clone($clone(d.jsVideoDecoder, js.Value).Get("state"), js.Value).String() === "closed") { */ case 15:
189611
- $r = log.Println(new sliceType([new $String("ASDF[GO] WebCodecsDecoder.Write going to release video decoder")])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189612
- $r = d.releaseVideoDecoder(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189613
- /* } */ case 16:
192083
+ /* */ if ($clone($clone(d.jsVideoDecoder, js.Value).Get("state"), js.Value).String() === "closed") { $s = 14; continue; }
192084
+ /* */ $s = 15; continue;
192085
+ /* if ($clone($clone(d.jsVideoDecoder, js.Value).Get("state"), js.Value).String() === "closed") { */ case 14:
192086
+ $r = d.releaseVideoDecoder(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192087
+ /* } */ case 15:
189614
192088
  $s = -1; return errDec;
189615
192089
  /* } */ case 13:
189616
192090
  $s = -1; return $ifaceNil;
189617
- /* */ } return; } var $f = {$blk: WebCodecsDecoder.ptr.prototype.Write, $c: true, $r, $24r, _r, _r$1, _r$2, _r$3, _r$4, chunk, chunkOpts, d, errDec, frameData, frameType, nal, $s};return $f;
192091
+ /* */ } return; } var $f = {$blk: WebCodecsDecoder.ptr.prototype.Write, $c: true, $r, $24r, _r, _r$1, _r$2, _r$3, _r$4, chunk, chunkOpts, d, errDec, frameData, frameType, nal, param, $s};return $f;
189618
192092
  };
189619
- WebCodecsDecoder.prototype.Write = function(nal) { return this.$val.Write(nal); };
192093
+ WebCodecsDecoder.prototype.Write = function(nal, param) { return this.$val.Write(nal, param); };
189620
192094
  WebCodecsDecoder.ptr.prototype.NextOutput = function(outputBuffer) {
189621
192095
  var {_r, _r$1, _selection, d, err, frame, frameDisplayHeight, frameDisplayWidth, output, outputBuffer, ycbcrImg, ycbcrJSImg, $s, $r, $c} = $restore(this, {outputBuffer});
189622
192096
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
@@ -189686,7 +192160,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189686
192160
  /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if (!$curGoroutine.asleep) { return err[0]; } if($curGoroutine.asleep) { var $f = {$blk: WebCodecsDecoder.ptr.prototype.jsSafeDecode, $c: true, $r, $24r, _r, chunk, d, err, $s, $deferred};return $f; } }
189687
192161
  };
189688
192162
  WebCodecsDecoder.prototype.jsSafeDecode = function(chunk) { return this.$val.jsSafeDecode(chunk); };
189689
- ptrType$2.methods = [{prop: "configure", name: "configure", pkg: "github.com/supraio/client-daemon/pkg/decoder/webcodecs", typ: $funcType([sliceType$1], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "jsSafeDecode", name: "jsSafeDecode", pkg: "github.com/supraio/client-daemon/pkg/decoder/webcodecs", typ: $funcType([js.Value], [$error], false)}];
192163
+ ptrType$2.methods = [{prop: "configure", name: "configure", pkg: "github.com/supraio/client-daemon/pkg/decoder/webcodecs", typ: $funcType([sliceType$1], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "jsSafeDecode", name: "jsSafeDecode", pkg: "github.com/supraio/client-daemon/pkg/decoder/webcodecs", typ: $funcType([js.Value], [$error], false)}];
189690
192164
  WebCodecsDecoder.init("github.com/supraio/client-daemon/pkg/decoder/webcodecs", [{prop: "jsVideoDecoder", name: "jsVideoDecoder", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "outputChan", name: "outputChan", embedded: false, exported: false, typ: chanType, tag: ""}, {prop: "errorChan", name: "errorChan", embedded: false, exported: false, typ: chanType$1, tag: ""}, {prop: "releaseVideoDecoder", name: "releaseVideoDecoder", embedded: false, exported: false, typ: funcType, tag: ""}]);
189691
192165
  $init = function() {
189692
192166
  $pkg.$init = function() {};
@@ -189701,6 +192175,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"] = (function(
189701
192175
  $r = image.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189702
192176
  $r = log.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189703
192177
  $r = js.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192178
+ $r = time.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
189704
192179
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
189705
192180
  };
189706
192181
  $pkg.$init = $init;
@@ -190897,54 +193372,6 @@ $packages["github.com/supraio/client-daemon/pkg/render/netframe"] = (function()
190897
193372
  $pkg.$init = $init;
190898
193373
  return $pkg;
190899
193374
  })();
190900
- $packages["golang.org/x/exp/shiny/driver/internal/errscreen"] = (function() {
190901
- var $pkg = {}, $init, screen, image, stub, ptrType, Stub;
190902
- screen = $packages["golang.org/x/exp/shiny/screen"];
190903
- image = $packages["image"];
190904
- stub = $pkg.stub = $newType(0, $kindStruct, "errscreen.stub", true, "golang.org/x/exp/shiny/driver/internal/errscreen", false, function(err_) {
190905
- this.$val = this;
190906
- if (arguments.length === 0) {
190907
- this.err = $ifaceNil;
190908
- return;
190909
- }
190910
- this.err = err_;
190911
- });
190912
- ptrType = $ptrType(screen.NewWindowOptions);
190913
- Stub = function(err) {
190914
- var err, x;
190915
- return (x = new stub.ptr(err), new x.constructor.elem(x));
190916
- };
190917
- $pkg.Stub = Stub;
190918
- stub.ptr.prototype.NewBuffer = function(size) {
190919
- var s, size;
190920
- s = this;
190921
- return [$ifaceNil, s.err];
190922
- };
190923
- stub.prototype.NewBuffer = function(size) { return this.$val.NewBuffer(size); };
190924
- stub.ptr.prototype.NewTexture = function(size) {
190925
- var s, size;
190926
- s = this;
190927
- return [$ifaceNil, s.err];
190928
- };
190929
- stub.prototype.NewTexture = function(size) { return this.$val.NewTexture(size); };
190930
- stub.ptr.prototype.NewWindow = function(opts) {
190931
- var opts, s;
190932
- s = this;
190933
- return [$ifaceNil, s.err];
190934
- };
190935
- stub.prototype.NewWindow = function(opts) { return this.$val.NewWindow(opts); };
190936
- stub.methods = [{prop: "NewBuffer", name: "NewBuffer", pkg: "", typ: $funcType([image.Point], [screen.Buffer, $error], false)}, {prop: "NewTexture", name: "NewTexture", pkg: "", typ: $funcType([image.Point], [screen.Texture, $error], false)}, {prop: "NewWindow", name: "NewWindow", pkg: "", typ: $funcType([ptrType], [screen.Window, $error], false)}];
190937
- stub.init("golang.org/x/exp/shiny/driver/internal/errscreen", [{prop: "err", name: "err", embedded: false, exported: false, typ: $error, tag: ""}]);
190938
- $init = function() {
190939
- $pkg.$init = function() {};
190940
- /* */ 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:
190941
- $r = screen.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
190942
- $r = image.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
190943
- /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
190944
- };
190945
- $pkg.$init = $init;
190946
- return $pkg;
190947
- })();
190948
193375
  $packages["golang.org/x/exp/shiny/imageutil"] = (function() {
190949
193376
  var $pkg = {}, $init, screen, image, draw, ConvertYCbCrToRGBA;
190950
193377
  screen = $packages["golang.org/x/exp/shiny/screen"];
@@ -190978,12 +193405,11 @@ $packages["golang.org/x/exp/shiny/imageutil"] = (function() {
190978
193405
  $pkg.$init = $init;
190979
193406
  return $pkg;
190980
193407
  })();
190981
- $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
190982
- var $pkg = {}, $init, fmt, webgl, types, errscreen, dom, imageutil, screen, f64, image, color, draw, sync, js, windowImpl, screenImpl, ArrayBufferSlice, YCbCrJS, BufferImpl, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$1, funcType, arrayType, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$3, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, texCoordsVertices, elementsIndices, newWindow, Main, main, newScreenImpl, newBuffer;
193408
+ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver"] = (function() {
193409
+ var $pkg = {}, $init, fmt, webgl, types, dom, imageutil, screen, f64, image, color, draw, sync, js, windowImpl, screenImpl, ArrayBufferSlice, YCbCrJS, BufferImpl, sliceType, sliceType$1, sliceType$2, ptrType, ptrType$1, funcType, arrayType, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, sliceType$3, ptrType$8, ptrType$9, ptrType$10, ptrType$11, ptrType$12, ptrType$13, ptrType$14, texCoordsVertices, elementsIndices, newWindow, Main, main, newScreenImpl, newBuffer;
190983
193410
  fmt = $packages["fmt"];
190984
193411
  webgl = $packages["github.com/nuberu/webgl"];
190985
193412
  types = $packages["github.com/nuberu/webgl/types"];
190986
- errscreen = $packages["golang.org/x/exp/shiny/driver/internal/errscreen"];
190987
193413
  dom = $packages["golang.org/x/exp/shiny/driver/util/dom"];
190988
193414
  imageutil = $packages["golang.org/x/exp/shiny/imageutil"];
190989
193415
  screen = $packages["golang.org/x/exp/shiny/screen"];
@@ -190993,7 +193419,7 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
190993
193419
  draw = $packages["image/draw"];
190994
193420
  sync = $packages["sync"];
190995
193421
  js = $packages["syscall/js"];
190996
- windowImpl = $pkg.windowImpl = $newType(0, $kindStruct, "webgldriver.windowImpl", true, "golang.org/x/exp/shiny/driver/webgldriver", false, function(screen_, mutex_, canvasEl_, gl_, programRGBA_, imageTexRGBA_, programYUV420_, imageTexY_, imageTexU_, imageTexV_, vertexArray_, released_, domEvents_, width_, height_) {
193422
+ windowImpl = $pkg.windowImpl = $newType(0, $kindStruct, "webgldriver.windowImpl", true, "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", false, function(screen_, mutex_, canvasEl_, gl_, programRGBA_, imageTexRGBA_, programYUV420_, imageTexY_, imageTexU_, imageTexV_, vertexArray_, released_, domEvents_, width_, height_) {
190997
193423
  this.$val = this;
190998
193424
  if (arguments.length === 0) {
190999
193425
  this.screen = ptrType.nil;
@@ -191029,7 +193455,7 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191029
193455
  this.width = width_;
191030
193456
  this.height = height_;
191031
193457
  });
191032
- screenImpl = $pkg.screenImpl = $newType(0, $kindStruct, "webgldriver.screenImpl", true, "golang.org/x/exp/shiny/driver/webgldriver", false, function(doc_) {
193458
+ screenImpl = $pkg.screenImpl = $newType(0, $kindStruct, "webgldriver.screenImpl", true, "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", false, function(doc_) {
191033
193459
  this.$val = this;
191034
193460
  if (arguments.length === 0) {
191035
193461
  this.doc = new js.Value.ptr(null, false, arrayType.zero());
@@ -191037,7 +193463,7 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191037
193463
  }
191038
193464
  this.doc = doc_;
191039
193465
  });
191040
- ArrayBufferSlice = $pkg.ArrayBufferSlice = $newType(0, $kindStruct, "webgldriver.ArrayBufferSlice", true, "golang.org/x/exp/shiny/driver/webgldriver", true, function(ArrayBuffer_, Offset_, Length_) {
193466
+ ArrayBufferSlice = $pkg.ArrayBufferSlice = $newType(0, $kindStruct, "webgldriver.ArrayBufferSlice", true, "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", true, function(ArrayBuffer_, Offset_, Length_) {
191041
193467
  this.$val = this;
191042
193468
  if (arguments.length === 0) {
191043
193469
  this.ArrayBuffer = new js.Value.ptr(null, false, arrayType.zero());
@@ -191049,7 +193475,7 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191049
193475
  this.Offset = Offset_;
191050
193476
  this.Length = Length_;
191051
193477
  });
191052
- YCbCrJS = $pkg.YCbCrJS = $newType(0, $kindStruct, "webgldriver.YCbCrJS", true, "golang.org/x/exp/shiny/driver/webgldriver", true, function(Y_, Cb_, Cr_, YStride_, CStride_, SubsampleRatio_, Rect_, Use_) {
193478
+ YCbCrJS = $pkg.YCbCrJS = $newType(0, $kindStruct, "webgldriver.YCbCrJS", true, "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", true, function(Y_, Cb_, Cr_, YStride_, CStride_, SubsampleRatio_, Rect_, Use_) {
191053
193479
  this.$val = this;
191054
193480
  if (arguments.length === 0) {
191055
193481
  this.Y = new ArrayBufferSlice.ptr(new js.Value.ptr(null, false, arrayType.zero()), 0, 0);
@@ -191071,7 +193497,7 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191071
193497
  this.Rect = Rect_;
191072
193498
  this.Use = Use_;
191073
193499
  });
191074
- BufferImpl = $pkg.BufferImpl = $newType(0, $kindStruct, "webgldriver.BufferImpl", true, "golang.org/x/exp/shiny/driver/webgldriver", true, function(screen_, size_, mutex_, released_, rgba_, ycbcr_, ycbcrJS_) {
193500
+ BufferImpl = $pkg.BufferImpl = $newType(0, $kindStruct, "webgldriver.BufferImpl", true, "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", true, function(screen_, size_, mutex_, released_, rgba_, ycbcr_, ycbcrJS_) {
191075
193501
  this.$val = this;
191076
193502
  if (arguments.length === 0) {
191077
193503
  this.screen = ptrType.nil;
@@ -191346,11 +193772,9 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191346
193772
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
191347
193773
  _r = main(f); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
191348
193774
  err = _r;
191349
- /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 2; continue; }
191350
- /* */ $s = 3; continue;
191351
- /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 2:
191352
- $r = f(errscreen.Stub(err)); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191353
- /* } */ case 3:
193775
+ if (!($interfaceIsEqual(err, $ifaceNil))) {
193776
+ $panic(err);
193777
+ }
191354
193778
  $s = -1; return;
191355
193779
  /* */ } return; } var $f = {$blk: Main, $c: true, $r, _r, err, f, $s};return $f;
191356
193780
  };
@@ -191687,8 +194111,8 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191687
194111
  _r = w.gl.CreateTexture(); /* */ $s = 2; case 2: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
191688
194112
  imageTex = _r;
191689
194113
  $r = w.gl.BindTexture(3553, imageTex); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191690
- $r = w.gl.TexParameterWrapS(3553, 10497); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191691
- $r = w.gl.TexParameterWrapT(3553, 10497); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194114
+ $r = w.gl.TexParameterWrapS(3553, 33071); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194115
+ $r = w.gl.TexParameterWrapT(3553, 33071); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191692
194116
  $r = w.gl.TexParameterMinFilter(3553, 9729); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191693
194117
  $r = w.gl.TexParameterMagFilter(3553, 9729); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191694
194118
  $r = w.gl.TexImage2Db(3553, 0, format, width, height, 0, format, sliceType$3.nil); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
@@ -191767,31 +194191,30 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191767
194191
  /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: BufferImpl.ptr.prototype.Release, $c: true, $r, b, $s, $deferred};return $f; } }
191768
194192
  };
191769
194193
  BufferImpl.prototype.Release = function() { return this.$val.Release(); };
191770
- ptrType$10.methods = [{prop: "ensureCanvasSize", name: "ensureCanvasSize", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "clear", name: "clear", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([], [], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([], [], false)}, {prop: "Publish", name: "Publish", pkg: "", typ: $funcType([], [screen.PublishResult], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "SendFirst", name: "SendFirst", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "NextEvent", name: "NextEvent", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Upload", name: "Upload", pkg: "", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "UploadYCbCr", name: "UploadYCbCr", pkg: "", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "Fill", name: "Fill", pkg: "", typ: $funcType([image.Rectangle, color.Color, draw.Op], [], false)}, {prop: "Draw", name: "Draw", pkg: "", typ: $funcType([f64.Aff3, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "DrawUniform", name: "DrawUniform", pkg: "", typ: $funcType([f64.Aff3, color.Color, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "Copy", name: "Copy", pkg: "", typ: $funcType([image.Point, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "Scale", name: "Scale", pkg: "", typ: $funcType([image.Rectangle, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "createAndAttachVertexShader", name: "createAndAttachVertexShader", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([ptrType$3], [$error], false)}, {prop: "ensureYUV420Textures", name: "ensureYUV420Textures", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "createAndLinkProgramYUV420", name: "createAndLinkProgramYUV420", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "drawBufferYUV420", name: "drawBufferYUV420", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "drawBufferYUV420JSArrayBuffers", name: "drawBufferYUV420JSArrayBuffers", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([image.Point, js.Value, js.Value, js.Value, image.Rectangle], [], false)}, {prop: "ensureRGBATextures", name: "ensureRGBATextures", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "createAndLinkProgramRGBA", name: "createAndLinkProgramRGBA", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "drawBufferRGBA", name: "drawBufferRGBA", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "createBuffers", name: "createBuffers", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([], [ptrType$5], false)}, {prop: "createAndAttachFragmentShader", name: "createAndAttachFragmentShader", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([ptrType$3, $String], [$error], false)}, {prop: "createTexture", name: "createTexture", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([types.GLEnum, types.GLEnum, $Int, $Int], [ptrType$4], false)}];
194194
+ ptrType$10.methods = [{prop: "ensureCanvasSize", name: "ensureCanvasSize", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "clear", name: "clear", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([], [], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([], [], false)}, {prop: "Publish", name: "Publish", pkg: "", typ: $funcType([], [screen.PublishResult], false)}, {prop: "Send", name: "Send", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "SendFirst", name: "SendFirst", pkg: "", typ: $funcType([$emptyInterface], [], false)}, {prop: "NextEvent", name: "NextEvent", pkg: "", typ: $funcType([], [$emptyInterface], false)}, {prop: "Upload", name: "Upload", pkg: "", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "UploadYCbCr", name: "UploadYCbCr", pkg: "", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "Fill", name: "Fill", pkg: "", typ: $funcType([image.Rectangle, color.Color, draw.Op], [], false)}, {prop: "Draw", name: "Draw", pkg: "", typ: $funcType([f64.Aff3, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "DrawUniform", name: "DrawUniform", pkg: "", typ: $funcType([f64.Aff3, color.Color, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "Copy", name: "Copy", pkg: "", typ: $funcType([image.Point, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "Scale", name: "Scale", pkg: "", typ: $funcType([image.Rectangle, screen.Texture, image.Rectangle, draw.Op, ptrType$9], [], false)}, {prop: "createAndAttachVertexShader", name: "createAndAttachVertexShader", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([ptrType$3], [$error], false)}, {prop: "ensureYUV420Textures", name: "ensureYUV420Textures", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "createAndLinkProgramYUV420", name: "createAndLinkProgramYUV420", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "drawBufferYUV420", name: "drawBufferYUV420", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "drawBufferYUV420JSArrayBuffers", name: "drawBufferYUV420JSArrayBuffers", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([image.Point, js.Value, js.Value, js.Value, image.Rectangle], [], false)}, {prop: "ensureRGBATextures", name: "ensureRGBATextures", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([$Int, $Int], [], false)}, {prop: "createAndLinkProgramRGBA", name: "createAndLinkProgramRGBA", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([], [ptrType$3, $error], false)}, {prop: "drawBufferRGBA", name: "drawBufferRGBA", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([image.Point, screen.Buffer, image.Rectangle], [], false)}, {prop: "createBuffers", name: "createBuffers", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([], [ptrType$5], false)}, {prop: "createAndAttachFragmentShader", name: "createAndAttachFragmentShader", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([ptrType$3, $String], [$error], false)}, {prop: "createTexture", name: "createTexture", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([types.GLEnum, types.GLEnum, $Int, $Int], [ptrType$4], false)}];
191771
194195
  ptrType.methods = [{prop: "NewBuffer", name: "NewBuffer", pkg: "", typ: $funcType([image.Point], [screen.Buffer, $error], false)}, {prop: "NewTexture", name: "NewTexture", pkg: "", typ: $funcType([image.Point], [screen.Texture, $error], false)}, {prop: "NewWindow", name: "NewWindow", pkg: "", typ: $funcType([ptrType$11], [screen.Window, $error], false)}];
191772
- ptrType$12.methods = [{prop: "slice", name: "slice", pkg: "golang.org/x/exp/shiny/driver/webgldriver", typ: $funcType([], [js.Value], false)}];
194196
+ ptrType$12.methods = [{prop: "slice", name: "slice", pkg: "github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", typ: $funcType([], [js.Value], false)}];
191773
194197
  ptrType$7.methods = [{prop: "Size", name: "Size", pkg: "", typ: $funcType([], [image.Point], false)}, {prop: "Bounds", name: "Bounds", pkg: "", typ: $funcType([], [image.Rectangle], false)}, {prop: "RGBA", name: "RGBA", pkg: "", typ: $funcType([], [ptrType$13], false)}, {prop: "YCbCr", name: "YCbCr", pkg: "", typ: $funcType([], [ptrType$14], false)}, {prop: "YCbCrJS", name: "YCbCrJS", pkg: "", typ: $funcType([], [ptrType$8], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([], [], false)}];
191774
- windowImpl.init("golang.org/x/exp/shiny/driver/webgldriver", [{prop: "screen", name: "screen", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "mutex", name: "mutex", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "canvasEl", name: "canvasEl", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "gl", name: "gl", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "programRGBA", name: "programRGBA", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "imageTexRGBA", name: "imageTexRGBA", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "programYUV420", name: "programYUV420", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "imageTexY", name: "imageTexY", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "imageTexU", name: "imageTexU", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "imageTexV", name: "imageTexV", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "vertexArray", name: "vertexArray", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "released", name: "released", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "domEvents", name: "domEvents", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "width", name: "width", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "height", name: "height", embedded: false, exported: false, typ: $Int, tag: ""}]);
191775
- screenImpl.init("golang.org/x/exp/shiny/driver/webgldriver", [{prop: "doc", name: "doc", embedded: false, exported: false, typ: js.Value, tag: ""}]);
194198
+ windowImpl.init("github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", [{prop: "screen", name: "screen", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "mutex", name: "mutex", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "canvasEl", name: "canvasEl", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "gl", name: "gl", embedded: false, exported: false, typ: ptrType$2, tag: ""}, {prop: "programRGBA", name: "programRGBA", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "imageTexRGBA", name: "imageTexRGBA", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "programYUV420", name: "programYUV420", embedded: false, exported: false, typ: ptrType$3, tag: ""}, {prop: "imageTexY", name: "imageTexY", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "imageTexU", name: "imageTexU", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "imageTexV", name: "imageTexV", embedded: false, exported: false, typ: ptrType$4, tag: ""}, {prop: "vertexArray", name: "vertexArray", embedded: false, exported: false, typ: ptrType$5, tag: ""}, {prop: "released", name: "released", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "domEvents", name: "domEvents", embedded: false, exported: false, typ: ptrType$6, tag: ""}, {prop: "width", name: "width", embedded: false, exported: false, typ: $Int, tag: ""}, {prop: "height", name: "height", embedded: false, exported: false, typ: $Int, tag: ""}]);
194199
+ screenImpl.init("github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", [{prop: "doc", name: "doc", embedded: false, exported: false, typ: js.Value, tag: ""}]);
191776
194200
  ArrayBufferSlice.init("", [{prop: "ArrayBuffer", name: "ArrayBuffer", embedded: false, exported: true, typ: js.Value, tag: ""}, {prop: "Offset", name: "Offset", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "Length", name: "Length", embedded: false, exported: true, typ: $Int, tag: ""}]);
191777
194201
  YCbCrJS.init("", [{prop: "Y", name: "Y", embedded: false, exported: true, typ: ArrayBufferSlice, tag: ""}, {prop: "Cb", name: "Cb", embedded: false, exported: true, typ: ArrayBufferSlice, tag: ""}, {prop: "Cr", name: "Cr", embedded: false, exported: true, typ: ArrayBufferSlice, tag: ""}, {prop: "YStride", name: "YStride", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "CStride", name: "CStride", embedded: false, exported: true, typ: $Int, tag: ""}, {prop: "SubsampleRatio", name: "SubsampleRatio", embedded: false, exported: true, typ: image.YCbCrSubsampleRatio, tag: ""}, {prop: "Rect", name: "Rect", embedded: false, exported: true, typ: image.Rectangle, tag: ""}, {prop: "Use", name: "Use", embedded: false, exported: true, typ: $Bool, tag: ""}]);
191778
- BufferImpl.init("golang.org/x/exp/shiny/driver/webgldriver", [{prop: "screen", name: "screen", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: image.Point, tag: ""}, {prop: "mutex", name: "mutex", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "released", name: "released", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "rgba", name: "rgba", embedded: false, exported: false, typ: image.RGBA, tag: ""}, {prop: "ycbcr", name: "ycbcr", embedded: false, exported: false, typ: image.YCbCr, tag: ""}, {prop: "ycbcrJS", name: "ycbcrJS", embedded: false, exported: false, typ: ptrType$8, tag: ""}]);
194202
+ BufferImpl.init("github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver", [{prop: "screen", name: "screen", embedded: false, exported: false, typ: ptrType, tag: ""}, {prop: "size", name: "size", embedded: false, exported: false, typ: image.Point, tag: ""}, {prop: "mutex", name: "mutex", embedded: false, exported: false, typ: ptrType$1, tag: ""}, {prop: "released", name: "released", embedded: false, exported: false, typ: $Bool, tag: ""}, {prop: "rgba", name: "rgba", embedded: false, exported: false, typ: image.RGBA, tag: ""}, {prop: "ycbcr", name: "ycbcr", embedded: false, exported: false, typ: image.YCbCr, tag: ""}, {prop: "ycbcrJS", name: "ycbcrJS", embedded: false, exported: false, typ: ptrType$8, tag: ""}]);
191779
194203
  $init = function() {
191780
194204
  $pkg.$init = function() {};
191781
194205
  /* */ 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:
191782
194206
  $r = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191783
194207
  $r = webgl.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191784
194208
  $r = types.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191785
- $r = errscreen.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191786
- $r = dom.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191787
- $r = imageutil.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191788
- $r = screen.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191789
- $r = f64.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191790
- $r = image.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191791
- $r = color.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191792
- $r = draw.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191793
- $r = sync.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191794
- $r = js.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194209
+ $r = dom.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194210
+ $r = imageutil.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194211
+ $r = screen.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194212
+ $r = f64.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194213
+ $r = image.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194214
+ $r = color.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194215
+ $r = draw.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194216
+ $r = sync.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194217
+ $r = js.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191795
194218
  texCoordsVertices = new sliceType([1, 1, 1, 0, 1, -1, 1, 1, -1, -1, 0, 1, -1, 1, 0, 0]);
191796
194219
  elementsIndices = new sliceType$1([0, 1, 3, 1, 2, 3]);
191797
194220
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
@@ -191800,12 +194223,13 @@ $packages["golang.org/x/exp/shiny/driver/webgldriver"] = (function() {
191800
194223
  return $pkg;
191801
194224
  })();
191802
194225
  $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"] = (function() {
191803
- var $pkg = {}, $init, general, errs, webgldriver, image, js, H264Decoder, funcType, arrayType, sliceType, ptrType, sliceType$1, ptrType$1, chanType, IsAvailable, NewDecoder;
194226
+ var $pkg = {}, $init, general, errs, webgldriver, image, js, time, H264Decoder, funcType, arrayType, sliceType, ptrType, sliceType$1, ptrType$1, chanType, IsAvailable, NewDecoder;
191804
194227
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
191805
194228
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
191806
- webgldriver = $packages["golang.org/x/exp/shiny/driver/webgldriver"];
194229
+ webgldriver = $packages["github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver"];
191807
194230
  image = $packages["image"];
191808
194231
  js = $packages["syscall/js"];
194232
+ time = $packages["time"];
191809
194233
  H264Decoder = $pkg.H264Decoder = $newType(0, $kindStruct, "h264decoder.H264Decoder", true, "github.com/supraio/client-daemon/pkg/decoder/h264decoder", true, function(decoder_, outputChan_) {
191810
194234
  this.$val = this;
191811
194235
  if (arguments.length === 0) {
@@ -191833,8 +194257,8 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"] = (functio
191833
194257
  return [new H264Decoder.ptr($clone(decoder, js.Value), new $Chan($emptyInterface, 1)), $ifaceNil];
191834
194258
  };
191835
194259
  $pkg.NewDecoder = NewDecoder;
191836
- H264Decoder.ptr.prototype.Write = function(nal) {
191837
- var {$24r, _r, _r$1, _r$2, m, nal, nalBuffer, nalBufferOffset, pHeight, pPicture, pWidth, status, x, x$1, $s, $r, $c} = $restore(this, {nal});
194260
+ H264Decoder.ptr.prototype.Write = function(nal, param) {
194261
+ var {$24r, _r, _r$1, _r$2, m, nal, nalBuffer, nalBufferOffset, pHeight, pPicture, pWidth, param, status, x, x$1, $s, $r, $c} = $restore(this, {nal, param});
191838
194262
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
191839
194263
  m = this;
191840
194264
  nalBufferOffset = $clone($clone(m.decoder, js.Value).Get("decBuffer"), js.Value);
@@ -191855,9 +194279,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"] = (functio
191855
194279
  /* } */ case 4:
191856
194280
  $r = $send(m.outputChan, $ifaceNil); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191857
194281
  $s = -1; return $ifaceNil;
191858
- /* */ } return; } var $f = {$blk: H264Decoder.ptr.prototype.Write, $c: true, $r, $24r, _r, _r$1, _r$2, m, nal, nalBuffer, nalBufferOffset, pHeight, pPicture, pWidth, status, x, x$1, $s};return $f;
194282
+ /* */ } return; } var $f = {$blk: H264Decoder.ptr.prototype.Write, $c: true, $r, $24r, _r, _r$1, _r$2, m, nal, nalBuffer, nalBufferOffset, pHeight, pPicture, pWidth, param, status, x, x$1, $s};return $f;
191859
194283
  };
191860
- H264Decoder.prototype.Write = function(nal) { return this.$val.Write(nal); };
194284
+ H264Decoder.prototype.Write = function(nal, param) { return this.$val.Write(nal, param); };
191861
194285
  H264Decoder.ptr.prototype.NextOutput = function(outputBuffer) {
191862
194286
  var {_q, _q$1, _q$2, _r, _r$1, _r$2, _r$3, cSize, cStride, height, heightIndex, m, outputBuffer, pHeight, pPicture, pWidth, pictureBuffer, pictureBufferOffset, pictureIndex, pictureLen, width, widthIndex, ySize, yStride, ycbcrImg, ycbcrJSImg, $s, $r, $c} = $restore(this, {outputBuffer});
191863
194287
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
@@ -191903,7 +194327,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"] = (functio
191903
194327
  m = this;
191904
194328
  };
191905
194329
  H264Decoder.prototype.Release = function(outputBuffer) { return this.$val.Release(outputBuffer); };
191906
- ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}];
194330
+ ptrType$1.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}];
191907
194331
  H264Decoder.init("github.com/supraio/client-daemon/pkg/decoder/h264decoder", [{prop: "decoder", name: "decoder", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "outputChan", name: "outputChan", embedded: false, exported: false, typ: chanType, tag: ""}]);
191908
194332
  $init = function() {
191909
194333
  $pkg.$init = function() {};
@@ -191913,6 +194337,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"] = (functio
191913
194337
  $r = webgldriver.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191914
194338
  $r = image.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191915
194339
  $r = js.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194340
+ $r = time.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
191916
194341
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
191917
194342
  };
191918
194343
  $pkg.$init = $init;
@@ -191979,13 +194404,14 @@ $packages["github.com/supraio/client-daemon/pkg/videostream"] = (function() {
191979
194404
  return $pkg;
191980
194405
  })();
191981
194406
  $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function() {
191982
- var $pkg = {}, $init, fmt, general, errs, jshelper, videostream, js, SOSVideoStreamer, SOSStreamDecoder, funcType, arrayType, sliceType, ptrType, ptrType$1, sliceType$1, ptrType$2, init, NewDecoder;
194407
+ var $pkg = {}, $init, fmt, general, errs, jshelper, videostream, js, time, SOSVideoStreamer, SOSStreamDecoder, funcType, arrayType, sliceType, ptrType, ptrType$1, sliceType$1, ptrType$2, init, NewDecoder;
191983
194408
  fmt = $packages["fmt"];
191984
194409
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
191985
194410
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
191986
194411
  jshelper = $packages["github.com/supraio/client-daemon/pkg/jshelper"];
191987
194412
  videostream = $packages["github.com/supraio/client-daemon/pkg/videostream"];
191988
194413
  js = $packages["syscall/js"];
194414
+ time = $packages["time"];
191989
194415
  SOSVideoStreamer = $pkg.SOSVideoStreamer = $newType(0, $kindStruct, "sosstream.SOSVideoStreamer", true, "github.com/supraio/client-daemon/pkg/decoder/sosstream", true, function(sos_) {
191990
194416
  this.$val = this;
191991
194417
  if (arguments.length === 0) {
@@ -192072,8 +194498,8 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function(
192072
194498
  return [new SOSStreamDecoder.ptr($clone(sos, js.Value), false), $ifaceNil];
192073
194499
  };
192074
194500
  $pkg.NewDecoder = NewDecoder;
192075
- SOSStreamDecoder.ptr.prototype.Write = function(nal) {
192076
- var {$24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, err, height, hostname, m, nal, options, playStream, port, preparePromise, protocol, sosProtocol, url, urlProtocol, width, $s, $r, $c} = $restore(this, {nal});
194501
+ SOSStreamDecoder.ptr.prototype.Write = function(nal, param) {
194502
+ var {$24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, err, height, hostname, m, nal, options, param, playStream, port, preparePromise, protocol, sosProtocol, url, urlProtocol, width, $s, $r, $c} = $restore(this, {nal, param});
192077
194503
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
192078
194504
  m = this;
192079
194505
  /* */ if (!m.started) { $s = 1; continue; }
@@ -192125,9 +194551,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function(
192125
194551
  m.started = true;
192126
194552
  /* } */ case 2:
192127
194553
  $s = -1; return $ifaceNil;
192128
- /* */ } return; } var $f = {$blk: SOSStreamDecoder.ptr.prototype.Write, $c: true, $r, $24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, err, height, hostname, m, nal, options, playStream, port, preparePromise, protocol, sosProtocol, url, urlProtocol, width, $s};return $f;
194554
+ /* */ } return; } var $f = {$blk: SOSStreamDecoder.ptr.prototype.Write, $c: true, $r, $24r, $24r$1, _arg, _arg$1, _r, _r$1, _r$10, _r$11, _r$2, _r$3, _r$4, _r$5, _r$6, _r$7, _r$8, _r$9, _tuple, _tuple$1, err, height, hostname, m, nal, options, param, playStream, port, preparePromise, protocol, sosProtocol, url, urlProtocol, width, $s};return $f;
192129
194555
  };
192130
- SOSStreamDecoder.prototype.Write = function(nal) { return this.$val.Write(nal); };
194556
+ SOSStreamDecoder.prototype.Write = function(nal, param) { return this.$val.Write(nal, param); };
192131
194557
  SOSStreamDecoder.ptr.prototype.NextOutput = function(outputBuffer) {
192132
194558
  var m, outputBuffer;
192133
194559
  m = this;
@@ -192212,7 +194638,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function(
192212
194638
  };
192213
194639
  SOSStreamDecoder.prototype.getSOSProtocol = function(protocol) { return this.$val.getSOSProtocol(protocol); };
192214
194640
  ptrType$1.methods = [{prop: "IsAvailable", name: "IsAvailable", pkg: "", typ: $funcType([], [$Bool], false)}, {prop: "GetProtocol", name: "GetProtocol", pkg: "", typ: $funcType([], [videostream.Protocol], false)}, {prop: "GetPort", name: "GetPort", pkg: "", typ: $funcType([], [$Uint16], false)}, {prop: "GetHostname", name: "GetHostname", pkg: "", typ: $funcType([], [$String], false)}];
192215
- ptrType$2.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "getProtocol", name: "getProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [videostream.Protocol], false)}, {prop: "getPort", name: "getPort", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [$Uint16], false)}, {prop: "getServerHostname", name: "getServerHostname", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [$String], false)}, {prop: "getStreamHostname", name: "getStreamHostname", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}, {prop: "getURLProtocol", name: "getURLProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}, {prop: "getSOSProtocol", name: "getSOSProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}];
194641
+ ptrType$2.methods = [{prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}, {prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "getProtocol", name: "getProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [videostream.Protocol], false)}, {prop: "getPort", name: "getPort", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [$Uint16], false)}, {prop: "getServerHostname", name: "getServerHostname", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([], [$String], false)}, {prop: "getStreamHostname", name: "getStreamHostname", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}, {prop: "getURLProtocol", name: "getURLProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}, {prop: "getSOSProtocol", name: "getSOSProtocol", pkg: "github.com/supraio/client-daemon/pkg/decoder/sosstream", typ: $funcType([videostream.Protocol], [$String], false)}];
192216
194642
  SOSVideoStreamer.init("github.com/supraio/client-daemon/pkg/decoder/sosstream", [{prop: "sos", name: "sos", embedded: false, exported: false, typ: js.Value, tag: ""}]);
192217
194643
  SOSStreamDecoder.init("github.com/supraio/client-daemon/pkg/decoder/sosstream", [{prop: "sos", name: "sos", embedded: false, exported: false, typ: js.Value, tag: ""}, {prop: "started", name: "started", embedded: false, exported: false, typ: $Bool, tag: ""}]);
192218
194644
  $init = function() {
@@ -192224,6 +194650,7 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function(
192224
194650
  $r = jshelper.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192225
194651
  $r = videostream.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192226
194652
  $r = js.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194653
+ $r = time.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192227
194654
  init();
192228
194655
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
192229
194656
  };
@@ -192231,7 +194658,9 @@ $packages["github.com/supraio/client-daemon/pkg/decoder/sosstream"] = (function(
192231
194658
  return $pkg;
192232
194659
  })();
192233
194660
  $packages["github.com/supraio/client-daemon/pkg/decoder"] = (function() {
192234
- var $pkg = {}, $init, general, h264decoder, nacldecoder, sosstream, webcodecs, errs, videostream, log, Decoder, sliceType, sliceType$1, NewDecoder;
194661
+ var $pkg = {}, $init, fmt, android, general, h264decoder, nacldecoder, sosstream, webcodecs, errs, videostream, time, Decoder, sliceType, sliceType$1, NewDecoder;
194662
+ fmt = $packages["fmt"];
194663
+ android = $packages["github.com/supraio/client-daemon/pkg/decoder/android"];
192235
194664
  general = $packages["github.com/supraio/client-daemon/pkg/decoder/general"];
192236
194665
  h264decoder = $packages["github.com/supraio/client-daemon/pkg/decoder/h264decoder"];
192237
194666
  nacldecoder = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"];
@@ -192239,63 +194668,66 @@ $packages["github.com/supraio/client-daemon/pkg/decoder"] = (function() {
192239
194668
  webcodecs = $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"];
192240
194669
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
192241
194670
  videostream = $packages["github.com/supraio/client-daemon/pkg/videostream"];
192242
- log = $packages["log"];
194671
+ time = $packages["time"];
192243
194672
  Decoder = $pkg.Decoder = $newType(8, $kindInterface, "decoder.Decoder", true, "github.com/supraio/client-daemon/pkg/decoder", true, null);
192244
194673
  sliceType = $sliceType($emptyInterface);
192245
194674
  sliceType$1 = $sliceType($Uint8);
192246
194675
  NewDecoder = function(header) {
192247
- var {$24r, _arg, _r, _r$1, _r$2, _returncast, _returncast$1, _returncast$2, _returncast$3, header, $s, $r, $c} = $restore(this, {header});
194676
+ var {$24r, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _r, _r$1, _r$2, _r$3, _returncast, _returncast$1, _returncast$2, _returncast$3, _returncast$4, header, $s, $r, $c} = $restore(this, {header});
192248
194677
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
194678
+ _arg = new $Bool(android.IsAvailable());
192249
194679
  _r = videostream.Get().IsAvailable(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
192250
- _arg = new $Bool(_r);
192251
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder videostream available:"), _arg])); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192252
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder nacldecoder available:"), new $Bool(nacldecoder.IsAvailable())])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192253
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder webcodecs available:"), new $Bool(webcodecs.IsAvailable())])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192254
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder h264decoder available:"), new $Bool(h264decoder.IsAvailable())])); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192255
- _r$1 = videostream.Get().IsAvailable(); /* */ $s = 12; case 12: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
192256
- /* */ if (_r$1) { $s = 6; continue; }
192257
- /* */ if (nacldecoder.IsAvailable()) { $s = 7; continue; }
192258
- /* */ if (webcodecs.IsAvailable()) { $s = 8; continue; }
192259
- /* */ if (h264decoder.IsAvailable()) { $s = 9; continue; }
192260
- /* */ $s = 10; continue;
192261
- /* if (_r$1) { */ case 6:
192262
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder: using videostream")])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192263
- _returncast = sosstream.NewDecoder(header);
194680
+ _arg$1 = new $Bool(_r);
194681
+ _arg$2 = new $Bool(nacldecoder.IsAvailable());
194682
+ _arg$3 = new $Bool(webcodecs.IsAvailable());
194683
+ _arg$4 = new $Bool(h264decoder.IsAvailable());
194684
+ _r$1 = fmt.Println(new sliceType([new $String("Decoders availability: android"), _arg, new $String(", videostream"), _arg$1, new $String(", nacldecoder"), _arg$2, new $String(", webcodecs"), _arg$3, new $String(", h264decoder"), _arg$4])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
194685
+ _r$1;
194686
+ /* */ if (android.IsAvailable()) { $s = 3; continue; }
194687
+ _r$2 = videostream.Get().IsAvailable(); /* */ $s = 10; case 10: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
194688
+ /* */ if (_r$2) { $s = 4; continue; }
194689
+ /* */ if (nacldecoder.IsAvailable()) { $s = 5; continue; }
194690
+ /* */ if (webcodecs.IsAvailable()) { $s = 6; continue; }
194691
+ /* */ if (h264decoder.IsAvailable()) { $s = 7; continue; }
194692
+ /* */ $s = 8; continue;
194693
+ /* if (android.IsAvailable()) { */ case 3:
194694
+ _returncast = android.NewDecoder(header);
192264
194695
  $s = -1; return [_returncast[0], _returncast[1]];
192265
- /* } else if (nacldecoder.IsAvailable()) { */ case 7:
192266
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder: using nacldecoder")])); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192267
- _returncast$1 = nacldecoder.NewDecoder(header);
194696
+ /* } else if (_r$2) { */ case 4:
194697
+ _returncast$1 = sosstream.NewDecoder(header);
192268
194698
  $s = -1; return [_returncast$1[0], _returncast$1[1]];
192269
- /* } else if (webcodecs.IsAvailable()) { */ case 8:
192270
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder: using webcodecs")])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192271
- _returncast$2 = webcodecs.NewDecoder(header);
194699
+ /* } else if (nacldecoder.IsAvailable()) { */ case 5:
194700
+ _returncast$2 = nacldecoder.NewDecoder(header);
192272
194701
  $s = -1; return [_returncast$2[0], _returncast$2[1]];
192273
- /* } else if (h264decoder.IsAvailable()) { */ case 9:
192274
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder: using h264decoder")])); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192275
- _returncast$3 = h264decoder.NewDecoder(header);
194702
+ /* } else if (webcodecs.IsAvailable()) { */ case 6:
194703
+ _returncast$3 = webcodecs.NewDecoder(header);
192276
194704
  $s = -1; return [_returncast$3[0], _returncast$3[1]];
192277
- /* } else { */ case 10:
192278
- $r = log.Println(new sliceType([new $String("ASDF[GO] NewDecoder: error Not available any decoder adapter in JS")])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192279
- _r$2 = errs.Errorf("Not available any decoder adapter in JS", sliceType.nil); /* */ $s = 18; case 18: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
192280
- $24r = [$ifaceNil, _r$2];
192281
- $s = 19; case 19: return $24r;
192282
- /* } */ case 11:
194705
+ /* } else if (h264decoder.IsAvailable()) { */ case 7:
194706
+ _returncast$4 = h264decoder.NewDecoder(header);
194707
+ $s = -1; return [_returncast$4[0], _returncast$4[1]];
194708
+ /* } else { */ case 8:
194709
+ _r$3 = errs.Errorf("Not available any decoder adapter in JS", sliceType.nil); /* */ $s = 11; case 11: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
194710
+ $24r = [$ifaceNil, _r$3];
194711
+ $s = 12; case 12: return $24r;
194712
+ /* } */ case 9:
192283
194713
  $s = -1; return [$ifaceNil, $ifaceNil];
192284
- /* */ } return; } var $f = {$blk: NewDecoder, $c: true, $r, $24r, _arg, _r, _r$1, _r$2, _returncast, _returncast$1, _returncast$2, _returncast$3, header, $s};return $f;
194714
+ /* */ } return; } var $f = {$blk: NewDecoder, $c: true, $r, $24r, _arg, _arg$1, _arg$2, _arg$3, _arg$4, _r, _r$1, _r$2, _r$3, _returncast, _returncast$1, _returncast$2, _returncast$3, _returncast$4, header, $s};return $f;
192285
194715
  };
192286
194716
  $pkg.NewDecoder = NewDecoder;
192287
- Decoder.init([{prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1], [$error], false)}]);
194717
+ Decoder.init([{prop: "NextOutput", name: "NextOutput", pkg: "", typ: $funcType([general.OutputBuffer], [$error], false)}, {prop: "Release", name: "Release", pkg: "", typ: $funcType([general.OutputBuffer], [], false)}, {prop: "Write", name: "Write", pkg: "", typ: $funcType([sliceType$1, time.Time], [$error], false)}]);
192288
194718
  $init = function() {
192289
194719
  $pkg.$init = function() {};
192290
194720
  /* */ 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:
192291
- $r = general.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192292
- $r = h264decoder.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192293
- $r = nacldecoder.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192294
- $r = sosstream.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192295
- $r = webcodecs.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192296
- $r = errs.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192297
- $r = videostream.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192298
- $r = log.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194721
+ $r = fmt.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194722
+ $r = android.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194723
+ $r = general.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194724
+ $r = h264decoder.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194725
+ $r = nacldecoder.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194726
+ $r = sosstream.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194727
+ $r = webcodecs.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194728
+ $r = errs.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194729
+ $r = videostream.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194730
+ $r = time.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
192299
194731
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
192300
194732
  };
192301
194733
  $pkg.$init = $init;
@@ -193435,7 +195867,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/player"] = (function() {
193435
195867
  $s = 10; case 10: return $24r$1;
193436
195868
  /* } */ case 8:
193437
195869
  $r = dl.stats.NotifyFrameDecodeWriteStarted(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193438
- _r$4 = decoder$1.Write(frame$1.Buffer()); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
195870
+ _r$4 = decoder$1.Write(frame$1.Buffer(), $clone(frame$1.GetTimestamp(), time.Time)); /* */ $s = 12; case 12: if($c) { $c = false; _r$4 = _r$4.$blk(); } if (_r$4 && _r$4.$blk !== undefined) { break s; }
193439
195871
  err = _r$4;
193440
195872
  $r = dl.stats.NotifyFrameDecodeWriteEnded(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193441
195873
  /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 14; continue; }
@@ -193620,7 +196052,7 @@ $packages["github.com/supraio/client-daemon/pkg/render/player"] = (function() {
193620
196052
  return $pkg;
193621
196053
  })();
193622
196054
  $packages["github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver"] = (function() {
193623
- var $pkg = {}, $init, errs, dom, screen, f64, image, color, draw, log, sync, js, windowImpl, screenImpl, BufferImpl, sliceType, ptrType, ptrType$1, ptrType$2, funcType, arrayType, ptrType$3, sliceType$1, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, newWindow, newScreenImpl, Main, main, newBuffer;
196055
+ var $pkg = {}, $init, errs, dom, screen, f64, image, color, draw, sync, js, windowImpl, screenImpl, BufferImpl, sliceType, ptrType, ptrType$1, ptrType$2, funcType, arrayType, ptrType$3, sliceType$1, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, newWindow, newScreenImpl, Main, main, newBuffer;
193624
196056
  errs = $packages["github.com/supraio/client-daemon/pkg/errs"];
193625
196057
  dom = $packages["golang.org/x/exp/shiny/driver/util/dom"];
193626
196058
  screen = $packages["golang.org/x/exp/shiny/screen"];
@@ -193628,7 +196060,6 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver"] = (
193628
196060
  image = $packages["image"];
193629
196061
  color = $packages["image/color"];
193630
196062
  draw = $packages["image/draw"];
193631
- log = $packages["log"];
193632
196063
  sync = $packages["sync"];
193633
196064
  js = $packages["syscall/js"];
193634
196065
  windowImpl = $pkg.windowImpl = $newType(0, $kindStruct, "overlaydriver.windowImpl", true, "github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver", false, function(screen_, mutex_, renderingInProgress_, domEvents_, released_) {
@@ -193762,15 +196193,11 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver"] = (
193762
196193
  };
193763
196194
  windowImpl.prototype.Upload = function(dp, src, sr) { return this.$val.Upload(dp, src, sr); };
193764
196195
  windowImpl.ptr.prototype.UploadYCbCr = function(dp, src, sr) {
193765
- var {dp, sr, src, w, $s, $r, $c} = $restore(this, {dp, src, sr});
193766
- /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
196196
+ var dp, sr, src, w;
193767
196197
  w = this;
193768
- $r = log.Println(new sliceType([new $String("ASDF[GO] Overlaydriver Window.UploadYCbCr does nothing")])); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193769
196198
  if (w.released) {
193770
- $s = -1; return;
196199
+ return;
193771
196200
  }
193772
- $s = -1; return;
193773
- /* */ } return; } var $f = {$blk: windowImpl.ptr.prototype.UploadYCbCr, $c: true, $r, dp, sr, src, w, $s};return $f;
193774
196201
  };
193775
196202
  windowImpl.prototype.UploadYCbCr = function(dp, src, sr) { return this.$val.UploadYCbCr(dp, src, sr); };
193776
196203
  windowImpl.ptr.prototype.Fill = function(dr, src, op) {
@@ -193932,9 +196359,8 @@ $packages["github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver"] = (
193932
196359
  $r = image.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193933
196360
  $r = color.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193934
196361
  $r = draw.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193935
- $r = log.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193936
- $r = sync.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193937
- $r = js.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
196362
+ $r = sync.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
196363
+ $r = js.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
193938
196364
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
193939
196365
  };
193940
196366
  $pkg.$init = $init;
@@ -194118,12 +196544,14 @@ $packages["golang.org/x/mobile/event/lifecycle"] = (function() {
194118
196544
  return $pkg;
194119
196545
  })();
194120
196546
  $packages["github.com/supraio/client-daemon/pkg/render"] = (function() {
194121
- var $pkg = {}, $init, binary, json, query, clientscreen, clipboard, nacldecoder, nacldriver, webcodecs, errs, helper, input, message, netclient, netpacket, netstream, netframe, player, canvasdriver, overlaydriver, stats, videostream, window, webgldriver, screen, focus, key, lifecycle, mouse, size, image, io, ioutil, log, os, path, strings, sync, js, time, ScreenWindow, ProcessInfo, ProcessInfoManager, ptrType, ptrType$1, funcType, sliceType, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, sliceType$1, sliceType$2, structType, sliceType$3, funcType$1, ptrType$10, ptrType$11, chanType, chanType$1, chanType$2, chanType$3, chanType$4, NewScreenWindow, MainDriver, NewProcessInfoManager;
196547
+ var $pkg = {}, $init, binary, json, fmt, query, clientscreen, clipboard, android, nacldecoder, nacldriver, webcodecs, errs, helper, input, message, netclient, netpacket, netstream, netframe, player, canvasdriver, overlaydriver, webgldriver, stats, videostream, window, screen, focus, key, lifecycle, mouse, size, image, io, ioutil, log, os, path, strings, sync, js, time, ScreenWindow, ProcessInfo, ProcessInfoManager, ptrType, ptrType$1, funcType, sliceType, ptrType$2, ptrType$3, ptrType$4, ptrType$5, ptrType$6, ptrType$7, ptrType$8, ptrType$9, sliceType$1, sliceType$2, structType, sliceType$3, funcType$1, ptrType$10, ptrType$11, chanType, chanType$1, chanType$2, chanType$3, chanType$4, NewScreenWindow, MainDriver, NewProcessInfoManager;
194122
196548
  binary = $packages["encoding/binary"];
194123
196549
  json = $packages["encoding/json"];
196550
+ fmt = $packages["fmt"];
194124
196551
  query = $packages["github.com/google/go-querystring/query"];
194125
196552
  clientscreen = $packages["github.com/supraio/client-daemon/pkg/clientscreen"];
194126
196553
  clipboard = $packages["github.com/supraio/client-daemon/pkg/clipboard"];
196554
+ android = $packages["github.com/supraio/client-daemon/pkg/decoder/android"];
194127
196555
  nacldecoder = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder"];
194128
196556
  nacldriver = $packages["github.com/supraio/client-daemon/pkg/decoder/nacldecoder/nacldriver"];
194129
196557
  webcodecs = $packages["github.com/supraio/client-daemon/pkg/decoder/webcodecs"];
@@ -194138,10 +196566,10 @@ $packages["github.com/supraio/client-daemon/pkg/render"] = (function() {
194138
196566
  player = $packages["github.com/supraio/client-daemon/pkg/render/player"];
194139
196567
  canvasdriver = $packages["github.com/supraio/client-daemon/pkg/shiny/driver/canvasdriver"];
194140
196568
  overlaydriver = $packages["github.com/supraio/client-daemon/pkg/shiny/driver/overlaydriver"];
196569
+ webgldriver = $packages["github.com/supraio/client-daemon/pkg/shiny/driver/webgldriver"];
194141
196570
  stats = $packages["github.com/supraio/client-daemon/pkg/stats"];
194142
196571
  videostream = $packages["github.com/supraio/client-daemon/pkg/videostream"];
194143
196572
  window = $packages["github.com/supraio/client-daemon/pkg/window"];
194144
- webgldriver = $packages["golang.org/x/exp/shiny/driver/webgldriver"];
194145
196573
  screen = $packages["golang.org/x/exp/shiny/screen"];
194146
196574
  focus = $packages["golang.org/x/mobile/event/focus"];
194147
196575
  key = $packages["golang.org/x/mobile/event/key"];
@@ -194946,36 +197374,40 @@ $packages["github.com/supraio/client-daemon/pkg/render"] = (function() {
194946
197374
  };
194947
197375
  ScreenWindow.prototype.createScreenBuffer = function() { return this.$val.createScreenBuffer(); };
194948
197376
  MainDriver = function(f) {
194949
- var {_arg, _r, _r$1, f, $s, $r, $c} = $restore(this, {f});
197377
+ var {_arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _r$3, f, $s, $r, $c} = $restore(this, {f});
194950
197378
  /* */ $s = $s || 0; s: while (true) { switch ($s) { case 0:
197379
+ _arg = new $Bool(android.IsAvailable());
194951
197380
  _r = videostream.Get().IsAvailable(); /* */ $s = 1; case 1: if($c) { $c = false; _r = _r.$blk(); } if (_r && _r.$blk !== undefined) { break s; }
194952
- _arg = new $Bool(_r);
194953
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: videostream available:"), _arg])); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194954
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: nacldecoder available:"), new $Bool(nacldecoder.IsAvailable())])); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194955
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: webcodecs available:"), new $Bool(webcodecs.IsAvailable())])); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194956
- _r$1 = videostream.Get().IsAvailable(); /* */ $s = 10; case 10: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
194957
- /* */ if (_r$1) { $s = 5; continue; }
194958
- /* */ if (nacldecoder.IsAvailable()) { $s = 6; continue; }
194959
- /* */ if (webcodecs.IsAvailable()) { $s = 7; continue; }
194960
- /* */ $s = 8; continue;
194961
- /* if (_r$1) { */ case 5:
194962
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: videostream available, using overlaydriver")])); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194963
- $r = overlaydriver.Main(f); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194964
- $s = 9; continue;
194965
- /* } else if (nacldecoder.IsAvailable()) { */ case 6:
194966
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: nacldecoder available, using nacldriver")])); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194967
- $r = nacldriver.Main(f); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194968
- $s = 9; continue;
194969
- /* } else if (webcodecs.IsAvailable()) { */ case 7:
194970
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: webcodecs available, using canvasdriver")])); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194971
- $r = canvasdriver.Main(f); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194972
- $s = 9; continue;
194973
- /* } else { */ case 8:
194974
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] MainDriver: fallback to webgldriver")])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194975
- $r = webgldriver.Main(f); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
194976
- /* } */ case 9:
197381
+ _arg$1 = new $Bool(_r);
197382
+ _arg$2 = new $Bool(nacldecoder.IsAvailable());
197383
+ _arg$3 = new $Bool(webcodecs.IsAvailable());
197384
+ _r$1 = fmt.Println(new sliceType$1([new $String("Drivers availability: android"), _arg, new $String(", videostream"), _arg$1, new $String(", nacldecoder"), _arg$2, new $String(", webcodecs"), _arg$3])); /* */ $s = 2; case 2: if($c) { $c = false; _r$1 = _r$1.$blk(); } if (_r$1 && _r$1.$blk !== undefined) { break s; }
197385
+ _r$1;
197386
+ /* */ if (android.IsAvailable()) { $s = 3; continue; }
197387
+ _r$2 = videostream.Get().IsAvailable(); /* */ $s = 9; case 9: if($c) { $c = false; _r$2 = _r$2.$blk(); } if (_r$2 && _r$2.$blk !== undefined) { break s; }
197388
+ /* */ if (_r$2) { $s = 4; continue; }
197389
+ /* */ if (nacldecoder.IsAvailable()) { $s = 5; continue; }
197390
+ /* */ if (webcodecs.IsAvailable()) { $s = 6; continue; }
197391
+ /* */ $s = 7; continue;
197392
+ /* if (android.IsAvailable()) { */ case 3:
197393
+ $r = overlaydriver.Main(f); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197394
+ $s = 8; continue;
197395
+ /* } else if (_r$2) { */ case 4:
197396
+ $r = overlaydriver.Main(f); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197397
+ $s = 8; continue;
197398
+ /* } else if (nacldecoder.IsAvailable()) { */ case 5:
197399
+ $r = nacldriver.Main(f); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197400
+ $s = 8; continue;
197401
+ /* } else if (webcodecs.IsAvailable()) { */ case 6:
197402
+ $r = canvasdriver.Main(f); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197403
+ $s = 8; continue;
197404
+ /* } else { */ case 7:
197405
+ _r$3 = fmt.Println(new sliceType$1([new $String("Using webgldriver as fallback")])); /* */ $s = 14; case 14: if($c) { $c = false; _r$3 = _r$3.$blk(); } if (_r$3 && _r$3.$blk !== undefined) { break s; }
197406
+ _r$3;
197407
+ $r = webgldriver.Main(f); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197408
+ /* } */ case 8:
194977
197409
  $s = -1; return;
194978
- /* */ } return; } var $f = {$blk: MainDriver, $c: true, $r, _arg, _r, _r$1, f, $s};return $f;
197410
+ /* */ } return; } var $f = {$blk: MainDriver, $c: true, $r, _arg, _arg$1, _arg$2, _arg$3, _r, _r$1, _r$2, _r$3, f, $s};return $f;
194979
197411
  };
194980
197412
  $pkg.MainDriver = MainDriver;
194981
197413
  NewProcessInfoManager = function(username, processDir) {
@@ -195157,43 +197589,45 @@ $packages["github.com/supraio/client-daemon/pkg/render"] = (function() {
195157
197589
  /* */ 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:
195158
197590
  $r = binary.$init(); /* */ $s = 1; case 1: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195159
197591
  $r = json.$init(); /* */ $s = 2; case 2: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195160
- $r = query.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195161
- $r = clientscreen.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195162
- $r = clipboard.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195163
- $r = nacldecoder.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195164
- $r = nacldriver.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195165
- $r = webcodecs.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195166
- $r = errs.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195167
- $r = helper.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195168
- $r = input.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195169
- $r = message.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195170
- $r = netclient.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195171
- $r = netpacket.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195172
- $r = netstream.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195173
- $r = netframe.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195174
- $r = player.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195175
- $r = canvasdriver.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195176
- $r = overlaydriver.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195177
- $r = stats.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195178
- $r = videostream.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195179
- $r = window.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195180
- $r = webgldriver.$init(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195181
- $r = screen.$init(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195182
- $r = focus.$init(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195183
- $r = key.$init(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195184
- $r = lifecycle.$init(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195185
- $r = mouse.$init(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195186
- $r = size.$init(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195187
- $r = image.$init(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195188
- $r = io.$init(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195189
- $r = ioutil.$init(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195190
- $r = log.$init(); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195191
- $r = os.$init(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195192
- $r = path.$init(); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195193
- $r = strings.$init(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195194
- $r = sync.$init(); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195195
- $r = js.$init(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195196
- $r = time.$init(); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197592
+ $r = fmt.$init(); /* */ $s = 3; case 3: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197593
+ $r = query.$init(); /* */ $s = 4; case 4: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197594
+ $r = clientscreen.$init(); /* */ $s = 5; case 5: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197595
+ $r = clipboard.$init(); /* */ $s = 6; case 6: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197596
+ $r = android.$init(); /* */ $s = 7; case 7: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197597
+ $r = nacldecoder.$init(); /* */ $s = 8; case 8: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197598
+ $r = nacldriver.$init(); /* */ $s = 9; case 9: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197599
+ $r = webcodecs.$init(); /* */ $s = 10; case 10: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197600
+ $r = errs.$init(); /* */ $s = 11; case 11: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197601
+ $r = helper.$init(); /* */ $s = 12; case 12: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197602
+ $r = input.$init(); /* */ $s = 13; case 13: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197603
+ $r = message.$init(); /* */ $s = 14; case 14: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197604
+ $r = netclient.$init(); /* */ $s = 15; case 15: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197605
+ $r = netpacket.$init(); /* */ $s = 16; case 16: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197606
+ $r = netstream.$init(); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197607
+ $r = netframe.$init(); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197608
+ $r = player.$init(); /* */ $s = 19; case 19: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197609
+ $r = canvasdriver.$init(); /* */ $s = 20; case 20: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197610
+ $r = overlaydriver.$init(); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197611
+ $r = webgldriver.$init(); /* */ $s = 22; case 22: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197612
+ $r = stats.$init(); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197613
+ $r = videostream.$init(); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197614
+ $r = window.$init(); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197615
+ $r = screen.$init(); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197616
+ $r = focus.$init(); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197617
+ $r = key.$init(); /* */ $s = 28; case 28: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197618
+ $r = lifecycle.$init(); /* */ $s = 29; case 29: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197619
+ $r = mouse.$init(); /* */ $s = 30; case 30: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197620
+ $r = size.$init(); /* */ $s = 31; case 31: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197621
+ $r = image.$init(); /* */ $s = 32; case 32: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197622
+ $r = io.$init(); /* */ $s = 33; case 33: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197623
+ $r = ioutil.$init(); /* */ $s = 34; case 34: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197624
+ $r = log.$init(); /* */ $s = 35; case 35: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197625
+ $r = os.$init(); /* */ $s = 36; case 36: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197626
+ $r = path.$init(); /* */ $s = 37; case 37: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197627
+ $r = strings.$init(); /* */ $s = 38; case 38: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197628
+ $r = sync.$init(); /* */ $s = 39; case 39: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197629
+ $r = js.$init(); /* */ $s = 40; case 40: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197630
+ $r = time.$init(); /* */ $s = 41; case 41: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195197
197631
  /* */ } return; } if ($f === undefined) { $f = { $blk: $init }; } $f.$s = $s; $f.$r = $r; return $f;
195198
197632
  };
195199
197633
  $pkg.$init = $init;
@@ -195263,17 +197697,15 @@ $packages["main"] = (function() {
195263
197697
  signalChannel[0] = new $Chan(os.Signal, 1);
195264
197698
  screenID = (x = os.Args, (1 >= x.$length ? ($throwRuntimeError("index out of range"), undefined) : x.$array[x.$offset + 1]));
195265
197699
  screenDriver = ((x$1 = os.Args, (2 >= x$1.$length ? ($throwRuntimeError("index out of range"), undefined) : x$1.$array[x$1.$offset + 2])));
195266
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] screenDriver: "), new netpacket.Driver(screenDriver)])); /* */ $s = 17; case 17: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195267
197700
  screenHost = (x$2 = os.Args, (3 >= x$2.$length ? ($throwRuntimeError("index out of range"), undefined) : x$2.$array[x$2.$offset + 3]));
195268
197701
  metadataDriver = ((x$3 = os.Args, (4 >= x$3.$length ? ($throwRuntimeError("index out of range"), undefined) : x$3.$array[x$3.$offset + 4])));
195269
- $r = log.Println(new sliceType$1([new $String("ASDF[GO] metadataDriver: "), new netstream.Driver(metadataDriver)])); /* */ $s = 18; case 18: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195270
197702
  metadataHost = (x$4 = os.Args, (5 >= x$4.$length ? ($throwRuntimeError("index out of range"), undefined) : x$4.$array[x$4.$offset + 5]));
195271
197703
  clientID = (x$5 = os.Args, (6 >= x$5.$length ? ($throwRuntimeError("index out of range"), undefined) : x$5.$array[x$5.$offset + 6]));
195272
197704
  clientSecret = (x$6 = os.Args, (7 >= x$6.$length ? ($throwRuntimeError("index out of range"), undefined) : x$6.$array[x$6.$offset + 7]));
195273
197705
  secure = (x$7 = os.Args, (8 >= x$7.$length ? ($throwRuntimeError("index out of range"), undefined) : x$7.$array[x$7.$offset + 8])) === "1";
195274
197706
  log.SetPrefix(screenID + " ");
195275
197707
  processInfoManager = render.NewProcessInfoManager(cfg.Username, cfg.ScreenProcessDir);
195276
- _r$5 = render.NewScreenWindow(processInfoManager, screenDriver, screenHost, metadataDriver, metadataHost, clientID, clientSecret, screenID, secure, $clone(new image.Point.ptr(1920, 1080), image.Point), $mul64(cfg.TimeoutSeconds, new time.Duration(0, 1000000000))); /* */ $s = 19; case 19: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
197708
+ _r$5 = render.NewScreenWindow(processInfoManager, screenDriver, screenHost, metadataDriver, metadataHost, clientID, clientSecret, screenID, secure, $clone(new image.Point.ptr(1920, 1080), image.Point), $mul64(cfg.TimeoutSeconds, new time.Duration(0, 1000000000))); /* */ $s = 17; case 17: if($c) { $c = false; _r$5 = _r$5.$blk(); } if (_r$5 && _r$5.$blk !== undefined) { break s; }
195277
197709
  screenWindow[0] = _r$5;
195278
197710
  screenWindow[0].OnClose((function(logFile, screenStartChan, screenWindow, signalChannel) { return function $b() {
195279
197711
  var {$s, $r, $c} = $restore(this, {});
@@ -195292,18 +197724,18 @@ $packages["main"] = (function() {
195292
197724
  $s = -1; return;
195293
197725
  /* */ } return; } var $f = {$blk: $b, $c: true, $r, _r$6, $s};return $f;
195294
197726
  }; })(logFile, screenStartChan, screenWindow, signalChannel), []);
195295
- _r$6 = $recv(screenStartChan[0]); /* */ $s = 20; case 20: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
197727
+ _r$6 = $recv(screenStartChan[0]); /* */ $s = 18; case 18: if($c) { $c = false; _r$6 = _r$6.$blk(); } if (_r$6 && _r$6.$blk !== undefined) { break s; }
195296
197728
  err = _r$6[0];
195297
- /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 21; continue; }
195298
- /* */ $s = 22; continue;
195299
- /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 21:
195300
- $r = errs.Print("Error starting screen window", err); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195301
- $s = 24; case 24: return;
195302
- /* } */ case 22:
197729
+ /* */ if (!($interfaceIsEqual(err, $ifaceNil))) { $s = 19; continue; }
197730
+ /* */ $s = 20; continue;
197731
+ /* if (!($interfaceIsEqual(err, $ifaceNil))) { */ case 19:
197732
+ $r = errs.Print("Error starting screen window", err); /* */ $s = 21; case 21: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197733
+ $s = 22; case 22: return;
197734
+ /* } */ case 20:
195303
197735
  $deferred.push([$methodVal(screenWindow[0], "Close"), []]);
195304
- $r = log.Println(new sliceType$1([new $String("Supra screen started")])); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195305
- $r = helper.WaitOnStopSignal(signalChannel[0]); /* */ $s = 26; case 26: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195306
- $r = log.Println(new sliceType$1([new $String("Supra screen is stopping")])); /* */ $s = 27; case 27: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197736
+ $r = log.Println(new sliceType$1([new $String("Supra screen started")])); /* */ $s = 23; case 23: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197737
+ $r = helper.WaitOnStopSignal(signalChannel[0]); /* */ $s = 24; case 24: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
197738
+ $r = log.Println(new sliceType$1([new $String("Supra screen is stopping")])); /* */ $s = 25; case 25: if($c) { $c = false; $r = $r.$blk(); } if ($r && $r.$blk !== undefined) { break s; }
195307
197739
  $s = -1; return;
195308
197740
  /* */ } return; } } catch(err) { $err = err; $s = -1; } finally { $callDeferred($deferred, $err); if($curGoroutine.asleep) { var $f = {$blk: main, $c: true, $r, _arg, _arg$1, _r, _r$1, _r$2, _r$3, _r$4, _r$5, _r$6, _tuple, _tuple$1, cfg, clientID, clientSecret, err, err$1, logFile, metadataDriver, metadataHost, processInfoManager, screenDriver, screenHost, screenID, screenStartChan, screenWindow, secure, signalChannel, x, x$1, x$2, x$3, x$4, x$5, x$6, x$7, $s, $deferred};return $f; } }
195309
197741
  };