Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 315c5f3

Browse files
committed
/vpx-yuv now contains only the latest set of decoded frames
1 parent 166bed3 commit 315c5f3

File tree

7 files changed

+1687
-1796
lines changed

7 files changed

+1687
-1796
lines changed

src/web_app/js/appcontroller.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,8 @@ AppController.prototype.transitionToActive_ = function () {
427427

428428
const sendFrame = () => {
429429
const time = Date.now();
430-
431-
console.log('taking a rgba video frame');
432430
localContext2d.drawImage(this.miniVideo_, 0, 0, width, height);
433431
const {data: rgba} = localContext2d.getImageData(0, 0, width, height);
434-
435432
const packets = this.libvpx_.encode(rgba);
436433
console.log('Total time to process this frame:', Date.now() - time, 'ms');
437434
console.warn('Sending IVF data to remote:', packets.length, 'bytes');

src/web_app/js/libvpx.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class LibVPX {
2828

2929
this._initialized = false;
3030
this._lastIvfSize = 0;
31-
this._lastYuvSize = 0;
3231

3332
this._loadWasm('/wasm/libvpx/libvpx.js');
3433
}
@@ -103,7 +102,6 @@ class LibVPX {
103102
const ivfSize = FS.stat(IVF_FILE).size;
104103
FS.write(ivfFile, ivfData, 0, ivfData.length, ivfSize);
105104
FS.close(ivfFile);
106-
console.log('Added new IVF data at file pos', ivfSize);
107105

108106
if (!this._initialized) {
109107
console.warn('initializing vpx decoder');
@@ -119,19 +117,7 @@ class LibVPX {
119117

120118
// Read the new YUV frames written by the decoder.
121119

122-
const newYuvSize = FS.stat(YUV_FILE).size;
123-
124-
if (newYuvSize == this._lastYuvSize) {
125-
console.warn('No new YUV frames decoded.');
126-
return [];
127-
}
128-
129-
const yuvFile = FS.open(YUV_FILE, 'r');
130-
const yuvFrames = new Uint8Array(newYuvSize - this._lastYuvSize);
131-
FS.read(yuvFile, yuvFrames, 0, yuvFrames.length, this._lastYuvSize);
132-
FS.close(yuvFile);
133-
this._lastYuvSize = newYuvSize;
134-
120+
const yuvFrames = FS.readFile(YUV_FILE);
135121
if (yuvFrames.length % yuvSize != 0)
136122
console.warn('Wrong YUV size:', yuvFrames.length, '%', yuvSize, '!= 0');
137123

src/web_app/wasm/libvpx/libvpx.a

-616 Bytes
Binary file not shown.

src/web_app/wasm/libvpx/libvpx.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ var ASM_CONSTS = [];
18341834

18351835
STATIC_BASE = GLOBAL_BASE;
18361836

1837-
STATICTOP = STATIC_BASE + 131616;
1837+
STATICTOP = STATIC_BASE + 131600;
18381838
/* global initializers */ __ATINIT__.push();
18391839

18401840

@@ -1843,7 +1843,7 @@ STATICTOP = STATIC_BASE + 131616;
18431843

18441844

18451845

1846-
var STATIC_BUMP = 131616;
1846+
var STATIC_BUMP = 131600;
18471847
Module["STATIC_BASE"] = STATIC_BASE;
18481848
Module["STATIC_BUMP"] = STATIC_BUMP;
18491849

-273 Bytes
Binary file not shown.

src/web_app/wasm/libvpx/libvpx.wast

Lines changed: 1684 additions & 1776 deletions
Large diffs are not rendered by default.

src/web_app/wasm/libvpx/libvpx_g.a

-616 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)