mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-html5
synced 2025-12-26 04:36:03 +00:00
implement and use a new dataview getUint64
This commit is contained in:
parent
3056d62ae2
commit
295073a954
@ -66,6 +66,18 @@ SpiceDataView.prototype = {
|
||||
return (this.getUint16(byteOffset + high, littleEndian) << 16) |
|
||||
this.getUint16(byteOffset + low, littleEndian);
|
||||
},
|
||||
getUint64: function (byteOffset, littleEndian)
|
||||
{
|
||||
var low = 4, high = 0;
|
||||
if (littleEndian)
|
||||
{
|
||||
low = 0;
|
||||
high = 4;
|
||||
}
|
||||
|
||||
return (this.getUint32(byteOffset + high, littleEndian) << 32) |
|
||||
this.getUint32(byteOffset + low, littleEndian);
|
||||
},
|
||||
setUint8: function(byteOffset, b)
|
||||
{
|
||||
this.u8[byteOffset] = (b & 0xff);
|
||||
|
||||
@ -414,9 +414,7 @@ SpiceMsgNotify.prototype =
|
||||
at = at || 0;
|
||||
var i;
|
||||
var dv = new SpiceDataView(a);
|
||||
this.time_stamp = [];
|
||||
this.time_stamp[0] = dv.getUint32(at, true); at += 4;
|
||||
this.time_stamp[1] = dv.getUint32(at, true); at += 4;
|
||||
this.time_stamp = dv.getUint64(at, true); at += 8;
|
||||
this.severity = dv.getUint32(at, true); at += 4;
|
||||
this.visibility = dv.getUint32(at, true); at += 4;
|
||||
this.what = dv.getUint32(at, true); at += 4;
|
||||
@ -807,7 +805,7 @@ SpiceMsgDisplayStreamCreate.prototype =
|
||||
this.id = dv.getUint32(at, true); at += 4;
|
||||
this.flags = dv.getUint8(at, true); at += 1;
|
||||
this.codec_type = dv.getUint8(at, true); at += 1;
|
||||
/*stamp */ at += 8;
|
||||
this.stamp = dv.getUint64(at, true); at += 8;
|
||||
this.stream_width = dv.getUint32(at, true); at += 4;
|
||||
this.stream_height = dv.getUint32(at, true); at += 4;
|
||||
this.src_width = dv.getUint32(at, true); at += 4;
|
||||
|
||||
15
spicetype.js
15
spicetype.js
@ -109,8 +109,7 @@ SpiceImageDescriptor.prototype =
|
||||
{
|
||||
from_dv: function(dv, at, mb)
|
||||
{
|
||||
this.id = dv.getUint32(at, true); at += 4;
|
||||
this.id += (dv.getUint32(at, true) << 32); at += 4;
|
||||
this.id = dv.getUint64(at, true); at += 8;
|
||||
this.type = dv.getUint8(at, true); at ++;
|
||||
this.flags = dv.getUint8(at, true); at ++;
|
||||
this.width = dv.getUint32(at, true); at += 4;
|
||||
@ -128,9 +127,7 @@ SpicePalette.prototype =
|
||||
from_dv: function(dv, at, mb)
|
||||
{
|
||||
var i;
|
||||
this.unique = [];
|
||||
this.unique[0] = dv.getUint32(at, true); at += 4;
|
||||
this.unique[1] = dv.getUint32(at, true); at += 4;
|
||||
this.unique = dv.getUint64(at, true); at += 8;
|
||||
this.num_ents = dv.getUint16(at, true); at += 2;
|
||||
this.ents = [];
|
||||
for (i = 0; i < this.num_ents; i++)
|
||||
@ -156,9 +153,7 @@ SpiceBitmap.prototype =
|
||||
this.stride = dv.getUint32(at, true); at += 4;
|
||||
if (this.flags & SPICE_BITMAP_FLAGS_PAL_FROM_CACHE)
|
||||
{
|
||||
this.palette_id = [];
|
||||
this.palette_id[0] = dv.getUint32(at, true); at += 4;
|
||||
this.palette_id[1] = dv.getUint32(at, true); at += 4;
|
||||
this.palette_id = dv.getUint64(at, true); at += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -425,9 +420,7 @@ SpiceCursorHeader.prototype =
|
||||
{
|
||||
from_dv: function(dv, at, mb)
|
||||
{
|
||||
this.unique = [];
|
||||
this.unique[0] = dv.getUint32(at, true); at += 4;
|
||||
this.unique[1] = dv.getUint32(at, true); at += 4;
|
||||
this.unique = dv.getUint64(at, true); at += 8;
|
||||
this.type = dv.getUint8(at, true); at ++;
|
||||
this.width = dv.getUint16(at, true); at += 2;
|
||||
this.height = dv.getUint16(at, true); at += 2;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user