Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mux
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-02-02 16:02:44 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-02-04 16:48:37 +0300
commitcef6fef079fe4a4403aa77261ed9aea8e8e668c6 (patch)
tree33e4914da70f6e280c5908f465798191c6fe174a /mux
parent02ac4b3b04a9a9ef15946e37aa6e22e4c248fe5b (diff)
fmp4: Add support for VP8
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1075>
Diffstat (limited to 'mux')
-rw-r--r--mux/fmp4/src/fmp4mux/boxes.rs11
-rw-r--r--mux/fmp4/src/fmp4mux/imp.rs11
2 files changed, 17 insertions, 5 deletions
diff --git a/mux/fmp4/src/fmp4mux/boxes.rs b/mux/fmp4/src/fmp4mux/boxes.rs
index 103b50986..4d8575cd9 100644
--- a/mux/fmp4/src/fmp4mux/boxes.rs
+++ b/mux/fmp4/src/fmp4mux/boxes.rs
@@ -632,7 +632,7 @@ fn write_tkhd(
// Width/height
match s.name().as_str() {
- "video/x-h264" | "video/x-h265" | "video/x-vp9" | "image/jpeg" => {
+ "video/x-h264" | "video/x-h265" | "video/x-vp8" | "video/x-vp9" | "image/jpeg" => {
let width = s.get::<i32>("width").context("video caps without width")? as u32;
let height = s
.get::<i32>("height")
@@ -742,7 +742,7 @@ fn write_hdlr(
let s = stream.caps.structure(0).unwrap();
let (handler_type, name) = match s.name().as_str() {
- "video/x-h264" | "video/x-h265" | "video/x-vp9" | "image/jpeg" => {
+ "video/x-h264" | "video/x-h265" | "video/x-vp8" | "video/x-vp9" | "image/jpeg" => {
(b"vide", b"VideoHandler\0".as_slice())
}
"audio/mpeg" | "audio/x-opus" | "audio/x-alaw" | "audio/x-mulaw" | "audio/x-adpcm" => {
@@ -772,7 +772,7 @@ fn write_minf(
let s = stream.caps.structure(0).unwrap();
match s.name().as_str() {
- "video/x-h264" | "video/x-h265" | "video/x-vp9" | "image/jpeg" => {
+ "video/x-h264" | "video/x-h265" | "video/x-vp8" | "video/x-vp9" | "image/jpeg" => {
// Flags are always 1 for unspecified reasons
write_full_box(v, b"vmhd", FULL_BOX_VERSION_0, 1, |v| write_vmhd(v, cfg))?
}
@@ -883,7 +883,7 @@ fn write_stsd(
let s = stream.caps.structure(0).unwrap();
match s.name().as_str() {
- "video/x-h264" | "video/x-h265" | "video/x-vp9" | "image/jpeg" => {
+ "video/x-h264" | "video/x-h265" | "video/x-vp8" | "video/x-vp9" | "image/jpeg" => {
write_visual_sample_entry(v, cfg, stream)?
}
"audio/mpeg" | "audio/x-opus" | "audio/x-alaw" | "audio/x-mulaw" | "audio/x-adpcm" => {
@@ -936,6 +936,7 @@ fn write_visual_sample_entry(
}
}
"image/jpeg" => b"jpeg",
+ "video/x-vp8" => b"vp08",
"video/x-vp9" => b"vp09",
_ => unreachable!(),
};
@@ -1068,7 +1069,7 @@ fn write_visual_sample_entry(
Ok(())
})?;
}
- "image/jpeg" => {
+ "video/x-vp8" | "image/jpeg" => {
// Nothing to do here
}
_ => unreachable!(),
diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs
index bdd750237..2842a5f12 100644
--- a/mux/fmp4/src/fmp4mux/imp.rs
+++ b/mux/fmp4/src/fmp4mux/imp.rs
@@ -2408,6 +2408,9 @@ impl FMP4Mux {
}
delta_frames = DeltaFrames::Bidirectional;
}
+ "video/x-vp8" => {
+ delta_frames = DeltaFrames::PredictiveOnly;
+ }
"video/x-vp9" => {
if !s.has_field_with_type("colorimetry", str::static_type()) {
gst::error!(CAT, obj: pad, "Received caps without colorimetry");
@@ -3264,6 +3267,10 @@ impl ElementImpl for ISOFMP4Mux {
.field("width", gst::IntRange::new(1, u16::MAX as i32))
.field("height", gst::IntRange::new(1, u16::MAX as i32))
.build(),
+ gst::Structure::builder("video/x-vp8")
+ .field("width", gst::IntRange::new(1, u16::MAX as i32))
+ .field("height", gst::IntRange::new(1, u16::MAX as i32))
+ .build(),
gst::Structure::builder("video/x-vp9")
.field("profile", gst::List::new(["0", "1", "2", "3"]))
.field("chroma-format", gst::List::new(["4:2:0", "4:2:2", "4:4:4"]))
@@ -3443,6 +3450,10 @@ impl ElementImpl for DASHMP4Mux {
.field("width", gst::IntRange::<i32>::new(1, u16::MAX as i32))
.field("height", gst::IntRange::<i32>::new(1, u16::MAX as i32))
.build(),
+ gst::Structure::builder("video/x-vp8")
+ .field("width", gst::IntRange::new(1, u16::MAX as i32))
+ .field("height", gst::IntRange::new(1, u16::MAX as i32))
+ .build(),
gst::Structure::builder("video/x-vp9")
.field("profile", gst::List::new(["0", "1", "2", "3"]))
.field("chroma-format", gst::List::new(["4:2:0", "4:2:2", "4:4:4"]))