Skip to content

Commit

Permalink
Merge pull request #157 from davemevans/DecodeSomeSmoothUUIDs
Browse files Browse the repository at this point in the history
Add MSS LiveStreamManifest, Tfrf Tfxd UUID box parsing
  • Loading branch information
cconcolato authored Apr 30, 2019
2 parents 4544c93 + 82708b9 commit 1889de2
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ var BoxParser = {
if (parseMethod) BoxParser[type+"TrackGroupTypeBox"].prototype.parse = parseMethod;
},
createUUIDBox: function(uuid, isFullBox, isContainerBox, parseMethod) {
//BoxParser.UUIDs.push(uuid);
BoxParser.UUIDs.push(uuid);
BoxParser.UUIDBoxes[uuid] = function(size) {
if (isFullBox) {
BoxParser.FullBox.call(this, "uuid", size, uuid);
Expand Down
8 changes: 8 additions & 0 deletions src/parsing/uuid/piff/piffLsm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BoxParser.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66", true, false, function(stream) {
this.LiveServerManifest = stream.readString(this.size - this.hdr_size)
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
});
23 changes: 23 additions & 0 deletions src/parsing/uuid/piff/piffTfrf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
BoxParser.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f", true, false, function(stream) {
this.fragment_count = stream.readUint8();
this.entries = [];

for (var i = 0; i < this.fragment_count; i++) {
var entry = {};
var absolute_time = 0;
var absolute_duration = 0;

if (this.version === 1) {
absolute_time = stream.readUint64();
absolute_duration = stream.readUint64();
} else {
absolute_time = stream.readUint32();
absolute_duration = stream.readUint32();
}

entry.absolute_time = absolute_time;
entry.absolute_duration = absolute_duration;

this.entries.push(entry);
}
});
9 changes: 9 additions & 0 deletions src/parsing/uuid/piff/piffTfxd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BoxParser.createUUIDBox("6d1d9b0542d544e680e2141daff757b2", true, false, function(stream) {
if (this.version === 1) {
this.absolute_time = stream.readUint64();
this.duration = stream.readUint64();
} else {
this.absolute_time = stream.readUint32();
this.duration = stream.readUint32();
}
});

0 comments on commit 1889de2

Please sign in to comment.