diff --git a/conformance-search/src/types/json.ts b/conformance-search/src/types/json.ts index 5082370..41f35bf 100644 --- a/conformance-search/src/types/json.ts +++ b/conformance-search/src/types/json.ts @@ -4,7 +4,9 @@ export type Coverage = { percentage: number; boxes: string[]; missing_extensions: string[]; - paths: string[]; + paths: { + [path: string]: string[]; + }; }; lists: { boxes: { diff --git a/data/schemas/gpac-extension.schema.json b/data/schemas/gpac-extension.schema.json index fd317ba..2158354 100644 --- a/data/schemas/gpac-extension.schema.json +++ b/data/schemas/gpac-extension.schema.json @@ -31,13 +31,18 @@ }, "@Specification": { "type": "string" }, "@Container": { "type": "string" }, + "@data": { + "type": "string", + "description": "dump of the box in hexadecimal format", + "pattern": "^0x[0-9a-fA-F]+$" + }, "children": { "type": "array", "items": { "$ref": "#/$defs/box" } } }, "additionalProperties": true, - "required": ["@Type"] + "required": ["@Type", "@data"] } }, "type": "object", diff --git a/src/construct/coverage.py b/src/construct/coverage.py index 256a128..35ae05d 100644 --- a/src/construct/coverage.py +++ b/src/construct/coverage.py @@ -94,17 +94,29 @@ def main(): "percentage": len(files["not_found"]) / len(files["path_file_map"]), "boxes": list(set(p.split(".")[-1] for p in files["not_found"])), "missing_extensions": list(missing_extensions), - "paths": files["not_found"], + "paths": list(files["not_found"].keys()), } # FIXME: All the logs here should be errors, except for info - for upath in NOT_FOUND["paths"]: + for upath, in_files in files["not_found"].items(): # Easy to access variables container_path = upath.split(".")[:-1] box_fourcc = upath.split(".")[-1] known_box = box_fourcc in dictionary["fourccs"] if not known_box: + # Check if this was in under consideration files + if any(["under_consideration" in f for f in in_files]): + extra = "" + if box_fourcc in get_mp4ra_boxes(): + extra = " It exists in MP4RA though." + + logger.error( + f"Box {box_fourcc} was found in under consideration files but it is not in our database." + + extra + ) + continue + if box_fourcc not in get_mp4ra_boxes(): logger.info(f"Box {box_fourcc} is not in standard features or MP4RA") else: diff --git a/src/construct/files.py b/src/construct/files.py index 5f0450a..c7886e2 100644 --- a/src/construct/files.py +++ b/src/construct/files.py @@ -145,7 +145,7 @@ def main(): logger.warning(f"Found {len(ignored)} ignored files.") file_metadata = {} - not_found = set() + not_found = {} for file in files: # metadata is the one without the _gpac.json @@ -187,7 +187,9 @@ def main(): for path, variants in paths_contained.items(): if path not in path_file_map: - not_found.add(path) + if path not in not_found: + not_found[path] = set() + not_found[path].add(key_name) continue for variant in variants: @@ -247,7 +249,7 @@ def main(): with open("output/files.json", "w", encoding="utf-8") as f: json.dump( { - "not_found": list(not_found), + "not_found": {path: sorted(files) for path, files in not_found.items()}, "path_file_map": path_file_map, "feature_file_map": feature_file_map, "file_metadata": file_metadata, diff --git a/src/tests/test_files.py b/src/tests/test_files.py index 73fbc2e..d7e265d 100644 --- a/src/tests/test_files.py +++ b/src/tests/test_files.py @@ -313,9 +313,11 @@ def test_gpac_ext_consistency(check): with open(gpac_ext, "r", encoding="utf-8") as f: gpac_ext_dict = json.load(f) - # Test if locations are the same - gt_locations = [ub["location"] for ub in unknown_boxes] - ref_locations = [ub["location"] for ub in gpac_ext_dict["extensions"]] + # Test if boxes are the same + gt_locations = [(ub["location"], ub["box"]["@data"]) for ub in unknown_boxes] + ref_locations = [ + (ub["location"], ub["box"]["@data"]) for ub in gpac_ext_dict["extensions"] + ] # Reference must match exactly with check: