mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-12-26 04:08:21 +01:00
Send only ready when we finish rendering the received frame
This commit is contained in:
parent
90382e2f33
commit
fc515ff012
File diff suppressed because one or more lines are too long
@ -149,12 +149,15 @@ class WVNC
|
|||||||
|
|
||||||
process: (msg) ->
|
process: (msg) ->
|
||||||
if not @socket
|
if not @socket
|
||||||
|
@socket.send(@buildCommand 0x04, 1)
|
||||||
return
|
return
|
||||||
data = new Uint8Array msg.pixels
|
data = new Uint8Array msg.pixels
|
||||||
ctx = @canvas.getContext "2d", { alpha: false }
|
ctx = @canvas.getContext "2d", { alpha: false }
|
||||||
imgData = ctx.createImageData msg.w, msg.h
|
imgData = ctx.createImageData msg.w, msg.h
|
||||||
imgData.data.set data
|
imgData.data.set data
|
||||||
ctx.putImageData imgData,msg.x, msg.y
|
ctx.putImageData imgData,msg.x, msg.y
|
||||||
|
# tell the server that we are ready
|
||||||
|
@socket.send(@buildCommand 0x04, 1)
|
||||||
|
|
||||||
|
|
||||||
setScale: (n) ->
|
setScale: (n) ->
|
||||||
@ -329,7 +332,6 @@ class WVNC
|
|||||||
when 0x84
|
when 0x84
|
||||||
# send data to web assembly for decoding
|
# send data to web assembly for decoding
|
||||||
@decoder.postMessage data.buffer, [data.buffer]
|
@decoder.postMessage data.buffer, [data.buffer]
|
||||||
@socket.send(@buildCommand 0x04, 1)
|
|
||||||
when 0x85
|
when 0x85
|
||||||
# clipboard data from server
|
# clipboard data from server
|
||||||
data = data.subarray 1
|
data = data.subarray 1
|
||||||
|
Loading…
Reference in New Issue
Block a user