Merged in js-mjpeg (pull request #341)

mjpeg-player: append to lexer

Approved-by: Alan Noble
This commit is contained in:
Trek Hopton 2020-01-20 11:40:42 +00:00
commit a0026bd2f0
1 changed files with 6 additions and 6 deletions

View File

@ -1,12 +1,9 @@
/*
NAME
lex-mjpeg.js
AUTHOR
Trek Hopton <trek@ausocean.org>
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).