Skip to content

Commit

Permalink
Merge branch 'main' into m64792_efficient_subs
Browse files Browse the repository at this point in the history
  • Loading branch information
DenizUgur authored Jan 23, 2024
2 parents cd0dc06 + db7fdbe commit c1a948d
Show file tree
Hide file tree
Showing 97 changed files with 19,025 additions and 15,508 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
is-bot: ${{ steps.check-author.outputs.is_bot }}
is-cfc: ${{ steps.check-cfc.outputs.is_cfc }}
is-page: ${{ steps.check-page.outputs.is_page }}
is-skip: ${{ steps.check-skip.outputs.is_skip }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -57,13 +58,23 @@ jobs:
fi
done
- name: Check if action is label but it is unrelated
id: check-skip
run: |
if [[ '${{ github.event.action }}' == 'labeled' ]]; then
if [[ '${{ github.event.label.name }}' != 'conformance-file' ]]; then
echo "is_skip=true" >> $GITHUB_OUTPUT
fi
fi
cfc:
needs: changes
if: |
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'conformance-file') &&
needs.changes.outputs.is-cfc == 'true' &&
needs.changes.outputs.is-bot != 'true'
needs.changes.outputs.is-bot != 'true' &&
needs.changes.outputs.is-skip != 'true'
uses: ./.github/workflows/cfc.yml
secrets: inherit

Expand Down
26 changes: 20 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# How to contribute to this repository

## 1. How to contribute new conformance files (for file contributors)
## 1. How to contribute new conformance files

### 1.1 General requirements

In order to contribute new conformance files to the framework the contributor needs to follow these steps:

Expand All @@ -15,22 +17,34 @@ In order to contribute new conformance files to the framework the contributor ne
- Associated files (if applicable). These are files which are required for processing of the conformance file.
- Upload files (either in a zip together with the contribution or by providing a URL which can be used to obtain the files).

### 1.2 Next steps

During the MPEG meeting the File Format group will collect and review the files and open a pull request to the conformance repository using the above information. After opening the PR, automation scripts will run GPAC's MP4Box and export the metadata from each file into a JSON with a suffix `_gpac.json`.

Because the MP4Box will not be able to parse new features which are currently being standardized, the contributor of the files will need to provide additional information about features / boxes the files are containing. This step comes after the PR has been opened for the conformance files to be contributed. The contributor has to follow these steps to appropriately fix the possible issues with the MP4Box’s output:

- Checkout the branch associated with the contributor’s PR
- For each contribution’s MP4Box extension file (suffix with `_gpac.ext.json`)
- If the file does not exist, then there were no unknown boxes found in the file. If you are modifying a known box then create the file manually and add the box to the extension file.
- Go through all the unknown boxes and provide the structure of that box and its descendants.
- If a node is not related to your contribution, you can just skip it.
- Add the relevant boxes to the standard features as well. Without that this contribution wouldn't be shown in the conformance search tool.
- Provide file structure for each file. For that you have two options:
- (Recommended) For each contribution’s MP4Box extension file (suffix with `_gpac.ext.json`)
- If the file does not exist, then there were no unknown boxes found in the file.
- Go through all the unknown boxes and provide the structure of that box and its descendants.
- If a node is not related to your contribution, you can just skip it.
- Modify the MP4Box output file directly. Either with a modified version of MP4Box or manually.
- Be sure to add `manualDump: true` property to your MP4Box output.
- This is also available via `--preserve-gpac-output` flag on `poetry run contribute-files` command.
- Add the relevant boxes to the standard features as well. Without that this contribution wouldn't be shown in the conformance search tool.
- If necessary for each conformance metadata file `<filename>.json` add or edit other fields. In particular check `associated_files`, `features`, `license` or add additional information to `notes`.
- Commit and push your modifications to that branch.
- CI scripts will validate the structure of the file and run tests to see if it’s okay to use it.

> If you are providing your own MP4Box output, and set the `manualDump` flag to `true`, then our automation scripts won't update your MP4Box output file.
The PR will be accepted after all edits are done to completely describe conformance files in the associated PR. When the File Format group decides the file should be published, the published flag will be changed to true and the file will move from [under_consideration](./data/file_features/under_consideration/) directory to a [published](./data/file_features/published/) directory.

### 1.3 Structure of JSON files

All the JSON files in this repository conform to a schema found within this repository. You can view all the available schemas [here](./data/schemas/). For example, MP4Box outputs conform to the schema found [here](./data/schemas/gpac.schema.json). Upon analyzing the schema, you will notice that we require the presence of `@Type` (fourcc) in all boxes as a bare minimum.

## 2. How to open a new PR for new conformance files

This is most likely a task of a conformance coordinator or a File Format Group Chair.
Expand Down
190 changes: 169 additions & 21 deletions conformance-search/src/components/BoxComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Box, SearchResultRefined } from "@/types";
import RefinementContext from "@/contexts/RefinementContext";
import Chip from "./Chip";
import Drawer from "./Drawer";
import Checkbox from "./Checkbox";

SyntaxHighlighter.registerLanguage("javascript", js);

Expand Down Expand Up @@ -157,6 +158,150 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
))}
</div>
</Drawer>
<Drawer hidden={box.item.type !== "brand_type"} title="Brand Flavor">
<ul className="p-3">
<li className="flex flex-row items-center gap-2">
<button
onClick={() => {
// Create refinements object if it doesn't exist
let { refinements } = box;
if (!refinements)
refinements = {
variant: {
versions: {
value: []
},
flags: {
value: [],
exact: false
},
metadata: {}
}
};

// Turn off the brand flavor
delete refinements.variant.metadata.BrandFlavor;

refineHandler(
{
...box,
refinements
},
"box"
);
}}
type="button"
>
<Checkbox
checked={
box?.refinements?.variant.metadata.BrandFlavor === undefined
}
intermediate={box?.refinements?.variant.metadata.BrandFlavor}
/>
</button>
<span>All flavors</span>
</li>
<li className="ml-4 flex flex-row items-center gap-2">
<button
onClick={() => {
// Create refinements object if it doesn't exist
let { refinements } = box;
if (!refinements)
refinements = {
variant: {
versions: {
value: []
},
flags: {
value: [],
exact: false
},
metadata: {}
}
};

// Turn on major brand
if (!refinements.variant.metadata.BrandFlavor)
refinements.variant.metadata.BrandFlavor = "Compatible";
else if (
refinements.variant.metadata.BrandFlavor === "Major" ||
refinements.variant.metadata.BrandFlavor === "Compatible"
)
delete refinements.variant.metadata.BrandFlavor;
else refinements.variant.metadata.BrandFlavor = "Major";

refineHandler(
{
...box,
refinements
},
"box"
);
}}
type="button"
>
<Checkbox
checked={
box?.refinements?.variant.metadata.BrandFlavor ===
undefined ||
box?.refinements?.variant.metadata.BrandFlavor === "Major"
}
/>
</button>
<span>Major brand</span>
</li>
<li className="ml-4 flex flex-row items-center gap-2">
<button
onClick={() => {
// Create refinements object if it doesn't exist
let { refinements } = box;
if (!refinements)
refinements = {
variant: {
versions: {
value: []
},
flags: {
value: [],
exact: false
},
metadata: {}
}
};

// Turn on compatible brand
if (!refinements.variant.metadata.BrandFlavor)
refinements.variant.metadata.BrandFlavor = "Major";
else if (
refinements.variant.metadata.BrandFlavor === "Compatible" ||
refinements.variant.metadata.BrandFlavor === "Major"
)
delete refinements.variant.metadata.BrandFlavor;
else refinements.variant.metadata.BrandFlavor = "Compatible";

refineHandler(
{
...box,
refinements
},
"box"
);
}}
type="button"
>
<Checkbox
checked={
box?.refinements?.variant.metadata.BrandFlavor ===
undefined ||
box?.refinements?.variant.metadata.BrandFlavor ===
"Compatible"
}
/>
</button>
<span>Compatible brand</span>
</li>
</ul>
</Drawer>
<Drawer hidden={box.item.versions.length < 1} title="Versions">
<ul className="p-3">
{box.item.versions.map((version) => (
Expand All @@ -175,7 +320,8 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
flags: {
value: [],
exact: false
}
},
metadata: {}
}
};

Expand All @@ -197,12 +343,12 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
}}
type="button"
>
{box.refinements &&
box.refinements.variant.versions.value.includes(version) ? (
<ImCheckboxChecked />
) : (
<ImCheckboxUnchecked />
)}
<Checkbox
checked={
box.refinements &&
box.refinements.variant.versions.value.includes(version)
}
/>
</button>
Version {version}
</li>
Expand Down Expand Up @@ -236,7 +382,8 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
flags: {
value: [],
exact: false
}
},
metadata: {}
}
};

Expand All @@ -258,12 +405,12 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
}}
type="button"
>
{box.refinements &&
box.refinements.variant.flags.value.includes(value) ? (
<ImCheckboxChecked />
) : (
<ImCheckboxUnchecked />
)}
<Checkbox
checked={
box.refinements &&
box.refinements.variant.flags.value.includes(value)
}
/>
</button>
<div className="flex flex-col">
<span className="text-sm font-bold">
Expand Down Expand Up @@ -297,7 +444,8 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
flags: {
value: [],
exact: false
}
},
metadata: {}
}
};

Expand All @@ -313,18 +461,18 @@ export default function BoxComponent({ box }: { box: SearchResultRefined<Box> })
}}
type="button"
>
{box.refinements && box.refinements.variant.flags.exact ? (
<ImCheckboxChecked />
) : (
<ImCheckboxUnchecked />
)}
<Checkbox
checked={
box.refinements && box.refinements.variant.flags.exact === true
}
/>
</button>
<span className="text-sm">
Combined flags must match exactly (no extra flags).
</span>
</div>
</Drawer>
<Drawer title="Syntax">
<Drawer hidden={box.item.syntax === null} title="Syntax">
<SyntaxHighlighter
customStyle={{
fontSize: "0.75rem",
Expand Down
17 changes: 17 additions & 0 deletions conformance-search/src/components/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { MdCheckBox, MdIndeterminateCheckBox, MdOutlineCheckBoxOutlineBlank } from "react-icons/md";

export default function Checkbox({
checked,
intermediate
}: {
checked: boolean | undefined | unknown;
intermediate?: boolean | undefined | unknown;
}) {
if (intermediate) return <MdIndeterminateCheckBox size={22} />;
if (checked) return <MdCheckBox size={22} />;
return <MdOutlineCheckBoxOutlineBlank size={22} />;
}

Checkbox.defaultProps = {
intermediate: false
};
Loading

0 comments on commit c1a948d

Please sign in to comment.