Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build ESDS box missing data property #378

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/descriptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ var MPEG4DescriptorParser = function () {
return this;
}

var MPEG4DescriptorWriter = function (descriptor) {
this.writeOneDescriptor = function (stream) {
// TODO: implement
}
}

if (typeof exports !== 'undefined') {
exports.MPEG4DescriptorParser = MPEG4DescriptorParser;
exports.MPEG4DescriptorWriter = MPEG4DescriptorWriter;
}
4 changes: 2 additions & 2 deletions src/parsing/esds.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BoxParser.createFullBoxCtor("esds", function(stream) {
var esd_data = stream.readUint8Array(this.size-this.hdr_size);
BoxParser.createFullBoxCtor("esds", function (stream) {
var esd_data = stream.readUint8Array(this.size - this.hdr_size);
if (typeof MPEG4DescriptorParser !== "undefined") {
var esd_parser = new MPEG4DescriptorParser();
this.esd = esd_parser.parseOneDescriptor(new DataStream(esd_data.buffer, 0, DataStream.BIG_ENDIAN));
Expand Down
10 changes: 10 additions & 0 deletions src/writing/esds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BoxParser.esdsBox.prototype.write = function(stream) {
this.version = 0;
this.flags = 0;
this.size = this.esd.size;
this.writeHeader(stream);
if (typeof MPEG4DescriptorWriter !== "undefined") {
var esd_writer = new MPEG4DescriptorWriter(this.esd);
esd_writer.writeOneDescriptor(stream);
}
}