diff options
author | Aric Stewart <aric@codeweavers.com> | 2012-08-27 10:59:37 -0500 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-09-06 10:11:16 +0300 |
commit | 7ebc4d019a7e14bb05a071945a313aada4ce42f3 (patch) | |
tree | 3d9893b521c924e40fc4ad37e5b3e467891ebbc7 /spicemsg.js | |
parent | a6aa594ef4225e23beed43a7d9e343fd89d0dabd (diff) |
implement handing of MJPEG display streams
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Diffstat (limited to 'spicemsg.js')
-rw-r--r-- | spicemsg.js | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/spicemsg.js b/spicemsg.js index 79c76bc..31e54a0 100644 --- a/spicemsg.js +++ b/spicemsg.js @@ -789,3 +789,95 @@ function SpiceMsgcKeyUp(e) /* Use the same functions as for KeyDown */ SpiceMsgcKeyUp.prototype.to_buffer = SpiceMsgcKeyDown.prototype.to_buffer; SpiceMsgcKeyUp.prototype.buffer_size = SpiceMsgcKeyDown.prototype.buffer_size; + +function SpiceMsgDisplayStreamCreate(a, at) +{ + this.from_buffer(a, at); +} + +SpiceMsgDisplayStreamCreate.prototype = +{ + from_buffer: function(a, at) + { + at = at || 0; + var dv = new SpiceDataView(a); + this.surface_id = dv.getUint32(at, true); at += 4; + 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.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; + this.src_height = dv.getUint32(at, true); at += 4; + + this.dest = new SpiceRect; + at = this.dest.from_dv(dv, at, a); + this.clip = new SpiceClip; + this.clip.from_dv(dv, at, a); + }, +} + +function SpiceStreamDataHeader(a, at) +{ +} + +SpiceStreamDataHeader.prototype = +{ + from_dv : function(dv, at, mb) + { + this.id = dv.getUint32(at, true); at += 4; + this.multi_media_time = dv.getUint32(at, true); at += 4; + return at; + }, +} + +function SpiceMsgDisplayStreamData(a, at) +{ + this.from_buffer(a, at); +} + +SpiceMsgDisplayStreamData.prototype = +{ + from_buffer: function(a, at) + { + at = at || 0; + var dv = new SpiceDataView(a); + this.base = new SpiceStreamDataHeader; + at = this.base.from_dv(dv, at, a); + this.data_size = dv.getUint32(at, true); at += 4; + this.data = dv.u8.subarray(at, at + this.data_size); + }, +} + +function SpiceMsgDisplayStreamClip(a, at) +{ + this.from_buffer(a, at); +} + +SpiceMsgDisplayStreamClip.prototype = +{ + from_buffer: function(a, at) + { + at = at || 0; + var dv = new SpiceDataView(a); + this.id = dv.getUint32(at, true); at += 4; + this.clip = new SpiceClip; + this.clip.from_dv(dv, at, a); + }, +} + +function SpiceMsgDisplayStreamDestroy(a, at) +{ + this.from_buffer(a, at); +} + +SpiceMsgDisplayStreamDestroy.prototype = +{ + from_buffer: function(a, at) + { + at = at || 0; + var dv = new SpiceDataView(a); + this.id = dv.getUint32(at, true); at += 4; + }, +} |