Skip to content

Commit

Permalink
update entity group variable names per PR feedback
Browse files Browse the repository at this point in the history
Also revise tab position per feedback.
  • Loading branch information
bradh committed Jun 28, 2023
1 parent b81b4e1 commit 916981e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/isofile-item-processing.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ISOFile.prototype.items = [];
ISOFile.prototype.groups = [];
ISOFile.prototype.entity_groups = [];
/* size of the buffers allocated for samples */
ISOFile.prototype.itemsDataSize = 0;

ISOFile.prototype.flattenItemInfo = function() {
var items = this.items;
var groups = this.groups;
var entity_groups = this.entity_groups;
var i, j;
var item;
var meta = this.meta;
Expand All @@ -31,11 +31,11 @@ ISOFile.prototype.flattenItemInfo = function() {
}
if (meta.grpl) {
for (i = 0; i < meta.grpl.boxes.length; i++) {
group = {};
group.id = meta.grpl.boxes[i].group_id;
group.entity_ids = meta.grpl.boxes[i].entity_ids;
group.type = meta.grpl.boxes[i].type;
groups[group.id] = group;
entity_group = {};
entity_group.id = meta.grpl.boxes[i].group_id;
entity_group.entity_ids = meta.grpl.boxes[i].entity_ids;
entity_group.type = meta.grpl.boxes[i].type;
entity_groups[entity_group.id] = entity_group;
}
}
if (meta.iloc) {
Expand Down Expand Up @@ -86,7 +86,7 @@ ISOFile.prototype.flattenItemInfo = function() {
var association = ipma.associations[i];
item = items[association.id];
if (!item) {
item = groups[association.id];
item = entity_groups[association.id];
}
if (item) {
if (item.properties === undefined) {
Expand Down
7 changes: 4 additions & 3 deletions test/filereader.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ <h3>MP4Box.js / ISOBMFF Box Structure Viewer (see <a href="../#demos">other demo
<li><a href="#boxview">Box View</a></li>
<li><a href="#sampleview">Sample View</a></li>
<li><a href="#itemview">Item View</a></li>
<li><a href="#entitygroupview">Entity Group View</a></li>
<li><a href="#segmentview">Segment View</a></li>
<li><a href="#groupview">Group View</a></li>

</ul>
<div id="movieview">
</div>
Expand Down Expand Up @@ -202,6 +203,8 @@ <h3>MP4Box.js / ISOBMFF Box Structure Viewer (see <a href="../#demos">other demo
</div>
<div id="itemview">
</div>
<div id="entitygroupview">
</div>
<div id="segmentview">
<label>View type:<select name="segmentviewselector" id="segmentviewselector">
<option selected="selected">Segment Table</option>
Expand All @@ -214,8 +217,6 @@ <h3>MP4Box.js / ISOBMFF Box Structure Viewer (see <a href="../#demos">other demo
<div id="segmentgraph"></div>
</div>
</div>
<div id="groupview">
</div>
</div>
</body>
</html>
26 changes: 13 additions & 13 deletions test/filereader.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ function finalizeAnalyzerUI(fileobj, loadbutton, success) {
buildSampleView();
displayMovieInfo(fileobj.mp4boxfile.getInfo(), document.getElementById("movieview"), false);
buildSegmentView(fileobj);
buildGroupTable(fileobj.mp4boxfile.groups);
buildEntityGroupTable(fileobj.mp4boxfile.entity_groups);
} else {
resetBoxView();
$("#itemview").html('');
resetSampleView();
$("#movieview").html('');
resetSegmentView();
$("#groupview").html('');
$("#entitygroupview").html('');
}
}

Expand Down Expand Up @@ -421,36 +421,36 @@ function buildSegmentView(fileobj) {
buildSegmentGraph(sidx, startSeg, endSeg);
}

function buildGroupTable(groups) {
function buildEntityGroupTable(entity_groups) {
var html;
var i, j;
html = "<table>";
html += "<thead>";
html += "<tr>";
html += "<th>Group ID</th>";
html += "<th>Entity Group ID</th>";
html += "<th>Type</th>";
html += "<th>Entities [item ID]</th>";
html += "<th>Properties [type]</th>";
html += "</tr>";
html += "</thead>";
html += "<tbody>";
for (i in groups) {
var group = groups[i];
html += "<td>" + group.id + "</td>";
html += "<td>" + group.type + "</td>";
html += "<td>" + group.entity_ids.join() + "</td>";
for (i in entity_groups) {
var entity_group = entity_groups[i];
html += "<td>" + entity_group.id + "</td>";
html += "<td>" + entity_group.type + "</td>";
html += "<td>" + entity_group.entity_ids.join() + "</td>";
html += "<td>";
if (group.properties) {
for (j = 0; j < group.properties.boxes.length; j++) {
html += "" + group.properties.boxes[j].type + " ";
if (entity_group.properties) {
for (j = 0; j < entity_group.properties.boxes.length; j++) {
html += "" + entity_group.properties.boxes[j].type + " ";
}
}
html += "</td>";
html += "</tr>";
}
html += "</tbody>";
html += "</table>";
$("#groupview").html(html);
$("#entitygroupview").html(html);
}


Expand Down

0 comments on commit 916981e

Please sign in to comment.