Skip to content

Commit

Permalink
Fix: Add video/mp4 to MediaType (rerun-io#7317)
Browse files Browse the repository at this point in the history
### What

- Add `video/mp4` to `MediaType` in all languages
- Fix media type guessing

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7317?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7317?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7317)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
jprochazk authored Aug 29, 2024
1 parent c6dcfb7 commit c0ad680
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/store/re_types/src/components/media_type_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ impl MediaType {
/// Either binary or ASCII.
/// <https://www.iana.org/assignments/media-types/model/stl>
pub const STL: &'static str = "model/stl";

/// [MP4 video](https://en.wikipedia.org/wiki/MP4_file_format): `video/mp4`.
///
/// <https://www.iana.org/assignments/media-types/video/mp4>
pub const MP4: &'static str = "video/mp4";
}

impl MediaType {
Expand Down Expand Up @@ -101,6 +106,12 @@ impl MediaType {
pub fn stl() -> Self {
Self(Self::STL.into())
}

/// `video/mp4`
#[inline]
pub fn mp4() -> Self {
Self(Self::MP4.into())
}
}

impl MediaType {
Expand Down
7 changes: 7 additions & 0 deletions rerun_cpp/src/rerun/components/media_type_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ namespace rerun {
return "model/stl";
}

/// [MP4 video](https://en.wikipedia.org/wiki/MP4_file_format): `video/mp4`.
///
/// <https://www.iana.org/assignments/media-types/video/mp4>
static MediaType mp4() {
return "video/mp4";
}

// </CODEGEN_COPY_TO_HEADER>
}
};
Expand Down

0 comments on commit c0ad680

Please sign in to comment.