Skip to content

Commit

Permalink
Merge pull request #106 from MPEGGroup/deprecated-suppport
Browse files Browse the repository at this point in the history
Deprecated boxes support
  • Loading branch information
cconcolato authored Nov 5, 2024
2 parents b3332d7 + a16823b commit 348b082
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 12 deletions.
21 changes: 20 additions & 1 deletion data/schemas/standard.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"fourcc": {
"type": "string"
},
"deprecated": {
"type": "boolean"
},
"description": {
"type": "string"
},
Expand Down Expand Up @@ -104,7 +107,23 @@
}
}
},
"required": ["fourcc", "description", "type", "containers", "syntax"]
"required": ["fourcc"],
"allOf": [
{
"if": {
"properties": {
"deprecated": {
"not": {
"const": true
}
}
}
},
"then": {
"required": ["description", "type", "containers", "syntax"]
}
}
]
},
"minItems": 1
}
Expand Down
25 changes: 25 additions & 0 deletions data/standard_features/14496-12/boxes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,31 @@
],
"type": "Box",
"syntax": "class URIBox extends FullBox('uri ', version = 0, 0) {\n\tutf8string theURI;\n}"
},
{
"fourcc": "mere",
"description": "Metabox Relation box",
"deprecated": true
},
{
"fourcc": "meco",
"description": "Additional metadata container box",
"deprecated": true
},
{
"fourcc": "imif",
"description": "IPMPInfoBox",
"deprecated": true
},
{
"fourcc": "ipmc",
"description": "IPMP control box",
"deprecated": true
},
{
"fourcc": "stsl",
"description": "Sample scale box",
"deprecated": true
}
]
}
7 changes: 0 additions & 7 deletions data/standard_features/14496-15/boxes.json
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,6 @@
"type": "Box",
"syntax": "class EVCConfigurationBox extends Box('evcC') {\n\tEVCDecoderConfigurationRecord() EVCConfig;\n}"
},
{
"fourcc": "svop",
"description": "SVC dependency range",
"containers": ["sgpd"],
"type": "Box",
"syntax": "class SVCDependencyRangeBox extends Box('svop') {\n\tunsigned int(3) min_dependency_id;\n\tunsigned int(3) min_temporal_id;\n\tbit(6) reserved = 0;\n\tunsigned int(4) min_quality_id;\n\tunsigned int(3) max_dependency_id;\n\tunsigned int(3) max_temporal_id;\n\tbit(6) reserved = 0;\n\tunsigned int(4) max_quality_id;\n}"
},
{
"fourcc": "qlif",
"description": "Layer quality assignments",
Expand Down
14 changes: 10 additions & 4 deletions src/construct/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from common import get_mp4ra_boxes

BOXES = {}
DEPRECATED_BOXES = set()
EXTENSIONS = {}
TYPE_HIERARCHY = {}

Expand Down Expand Up @@ -76,6 +77,11 @@ def get_all_boxes(json_file):
_spec = os.path.basename(os.path.dirname(json_file))

for entry in entries:
# Handle deprecated boxes
if "deprecated" in entry and entry["deprecated"]:
DEPRECATED_BOXES.add(entry["fourcc"])
continue

_boxes.add(
Box(
fourcc=entry["fourcc"],
Expand Down Expand Up @@ -343,10 +349,9 @@ def main():
if _box.fourcc not in get_mp4ra_boxes():
buffer.append(_box.fourcc)

buffer = set(buffer) - DEPRECATED_BOXES
if len(buffer) > 0:
logger.warning(
f"Missing boxes in MP4RA ({len(set(buffer))}): {set(sorted(buffer))}"
)
logger.warning(f"Missing boxes in MP4RA ({len(buffer)}): {sorted(buffer)}")

# Check missing boxes in standard features
all_fourccs = set(_box.fourcc for _box in all_boxes)
Expand All @@ -355,10 +360,11 @@ def main():
if _box not in all_fourccs:
buffer.append(_box)

buffer = set(buffer) - DEPRECATED_BOXES
# FIXME: This should be an error
if len(buffer) > 0:
logger.warning(
f"Missing boxes in standard features ({len(set(buffer))}): {set(sorted(buffer))}"
f"Missing boxes in standard features ({len(buffer)}): {sorted(buffer)}"
)

# Sort all boxes by fourcc
Expand Down

0 comments on commit 348b082

Please sign in to comment.