MCPcopy Create free account
hub / github.com/apache/cloudstack / decodeRect

Method decodeRect

systemvm/agent/noVNC/core/decoders/h264.js:287–320  ·  view source on GitHub ↗
(x, y, width, height, sock, display, depth)

Source from the content-addressed store, hash-verified

285 }
286
287 decodeRect(x, y, width, height, sock, display, depth) {
288 const resetContextFlag = 1;
289 const resetAllContextsFlag = 2;
290
291 if (sock.rQwait("h264 header", 8)) {
292 return false;
293 }
294
295 const length = sock.rQshift32();
296 const flags = sock.rQshift32();
297
298 if (sock.rQwait("h264 payload", length, 8)) {
299 return false;
300 }
301
302 if (flags & resetAllContextsFlag) {
303 this._resetAllContexts();
304 } else if (flags & resetContextFlag) {
305 this._resetContext(x, y, width, height);
306 }
307
308 let context = this._getContext(x, y, width, height);
309 context.lastUsed = this._tick++;
310
311 if (length !== 0) {
312 let payload = sock.rQshiftBytes(length, false);
313 let frame = context.decode(payload);
314 if (frame !== null) {
315 display.videoFrame(x, y, width, height, frame);
316 }
317 }
318
319 return true;
320 }
321}

Callers

nothing calls this directly

Calls 8

_resetAllContextsMethod · 0.95
_resetContextMethod · 0.95
_getContextMethod · 0.95
rQwaitMethod · 0.80
rQshift32Method · 0.80
rQshiftBytesMethod · 0.80
videoFrameMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected