diff --git a/cmd/mjpeg-player/lex-mjpeg.js b/cmd/mjpeg-player/lex-mjpeg.js index 4d5be7e9..222fa945 100644 --- a/cmd/mjpeg-player/lex-mjpeg.js +++ b/cmd/mjpeg-player/lex-mjpeg.js @@ -1,12 +1,9 @@ /* -NAME - lex-mjpeg.js - AUTHOR Trek Hopton LICENSE - This file is Copyright (C) 2019 the Australian Ocean Lab (AusOcean) + This file is Copyright (C) 2020 the Australian Ocean Lab (AusOcean) It is free software: you can redistribute it and/or modify them under the terms of the GNU General Public License as published by the @@ -24,11 +21,14 @@ LICENSE // MJPEGLexer lexes a byte array containing MJPEG into individual JPEGs. class MJPEGLexer { - constructor(src) { - this.src = src; + constructor() { this.off = 0; } + append(data) { + this.src = new Uint8Array(data); + } + // read returns the next single frame. read() { // Check if the src can contain at least the start and end flags (4B).