diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dff642c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*/plots/*
diff --git a/rusttechx-2024/ogg-demux-pipeline.svg b/rusttechx-2024/ogg-demux-pipeline.svg
new file mode 100644
index 0000000..d68c1a9
--- /dev/null
+++ b/rusttechx-2024/ogg-demux-pipeline.svg
@@ -0,0 +1,508 @@
+
+
+
+
+
diff --git a/rusttechx-2024/playbin-hls.svg b/rusttechx-2024/playbin-hls.svg
deleted file mode 100644
index 169491d..0000000
--- a/rusttechx-2024/playbin-hls.svg
+++ /dev/null
@@ -1,3189 +0,0 @@
-
-
-
-
-
diff --git a/rusttechx-2024/roundedcorners.jpg b/rusttechx-2024/roundedcorners.jpg
deleted file mode 100644
index 6fc080f..0000000
Binary files a/rusttechx-2024/roundedcorners.jpg and /dev/null differ
diff --git a/rusttechx-2024/rusttechx-2024.pdf b/rusttechx-2024/rusttechx-2024.pdf
index 42eb44f..7ef656d 100644
Binary files a/rusttechx-2024/rusttechx-2024.pdf and b/rusttechx-2024/rusttechx-2024.pdf differ
diff --git a/rusttechx-2024/rusttechx.md b/rusttechx-2024/rusttechx.md
index e9839ea..feaf2f7 100644
--- a/rusttechx-2024/rusttechx.md
+++ b/rusttechx-2024/rusttechx.md
@@ -48,34 +48,53 @@ gst-launch-1.0 videotestsrc ! autovideosink
gst-launch-1.0 audiotestsrc ! autoaudiosink
```
-## Media pipeline[^1]
+## **gst-inspect**
+
+```bash
+Factory Details:
+ Rank none (0)
+ Long-name Video test source
+ Klass Source/Video
+ Description Creates a test video stream
+ Author David A. Schleef
+ Documentation https://gstreamer.freedesktop.org/documentation/videotestsrc/#videotestsrc-page
+
+Plugin Details:
+ Name videotestsrc
+ Description Creates a test video stream
+ Filename /usr/lib/gstreamer-1.0/libgstvideotestsrc.so
+ Version 1.24.9
+ License LGPL
+ Source module gst-plugins-base
+ Documentation https://gstreamer.freedesktop.org/documentation/videotestsrc/
+ Source release date 2024-10-30
+ Binary package Arch Linux GStreamer 1.24.9-3
+ Origin URL https://www.archlinux.org/
+
+GObject
+ +----GInitiallyUnowned
+ +----GstObject
+ +----GstElement
+ +----GstBaseSrc
+ +----GstPushSrc
+ +----GstVideoTestSrc
+
+Pad Templates:
+ SRC template: 'src'
+ Availability: Always
+ Capabilities:
+ video/x-raw
+```
+
+## Media pipeline
![*_Simple Player_*](simple-player.png){width=80%}
-[^1]: [Dynamic Pipelines](https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c)
-
-## Playback pipeline
-
-```bash
-gst-play-1.0 https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8
-```
-
-## Playback pipeline graph
-
-![*_playbin HLS_*](playbin-hls.svg)
-
-## Custom elements
-
-![*_Rounded Corners_*](roundedcorners.jpg){width=58%}
-
-```bash
-gst-launch-1.0 filesrc location=bunny.mp4 ! decodebin ! videoconvert ! roundedcorners border-radius-px=100 ! videoconvert ! gtksink
-```
## Why Rust?
- Codec implementations in pure Rust (Rust Audio, Xiph AV1, Symphonia)
-- Things we care about
+- Things to care about
* **Low cognitive overhead**
* Immutability
* Expressive type system
@@ -84,7 +103,7 @@ gst-launch-1.0 filesrc location=bunny.mp4 ! decodebin ! videoconvert ! roundedco
## Why Rust?
-- Bindings/abstractions over GLib/GObject and for GStreamer[^2]
+- Bindings/abstractions over GLib/GObject and for GStreamer[^1]
- Provides a root for the object hierarchy tree filed in by the GStreamer library
- Gives basic reference counting, parenting functionality and locking.
- GObject
@@ -99,7 +118,7 @@ gst-launch-1.0 filesrc location=bunny.mp4 ! decodebin ! videoconvert ! roundedco
- GstElement
- GstPad
-[^2]: [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c)
+[^1]: [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c)
## Why immutability and types matter?
@@ -210,9 +229,86 @@ For more information about this error, try `rustc --explain E0596`.
}
```
-## GStreamer & Rust
+## Code
-- Some stats[^3]
+```rust
+ let src = gst::ElementFactory::make("filesrc")
+ .property("location", "sample.ogv")
+ .build()
+ .unwrap();
+ let demux = gst::ElementFactory::make("oggdemux").build().unwrap();
+
+ let pipeline_weak = pipeline.downgrade();
+ demux.connect("pad-added", false, move |args| {
+ let pipeline = match pipeline_weak.upgrade() {
+ Some(self_) => self_,
+ None => return None,
+ };
+
+ let pad = args[1]
+ .get::()
+ .expect("Second argument to demux pad-added must be pad");
+```
+
+## Code
+
+```rust
+ if let Some(caps) = pad.current_caps() {
+ let s = caps.structure(0).unwrap();
+
+ let (decoder, sink) = if s.name().starts_with("video") {
+ let decoder = gst::ElementFactory::make("theoradec").build().unwrap();
+ let sink = gst::ElementFactory::make("autovideosink").build().unwrap();
+ (decoder, sink)
+ } else {
+ let decoder = gst::ElementFactory::make("vorbisdec").build().unwrap();
+ let sink = gst::ElementFactory::make("autoaudiosink").build().unwrap();
+ (decoder, sink)
+ };
+
+ let queue1 = gst::ElementFactory::make("queue").build().unwrap();
+ let queue2 = gst::ElementFactory::make("queue").build().unwrap();
+```
+
+## Code
+
+```rust
+ pipeline
+ .add_many([&queue1, &decoder, &queue2, &sink])
+ .unwrap();
+
+ let sinkpad = queue1.static_pad("sink").unwrap();
+ pad.link(&sinkpad).unwrap();
+
+ queue1.link(&decoder).unwrap();
+ decoder.link(&queue2).unwrap();
+ queue2.link(&sink).unwrap();
+
+ queue1.sync_state_with_parent().unwrap();
+ decoder.sync_state_with_parent().unwrap();
+ queue2.sync_state_with_parent().unwrap();
+ sink.sync_state_with_parent().unwrap();
+ }
+```
+
+## Code
+
+```rust
+ None
+ });
+
+ pipeline.add_many([&src, &demux]).unwrap();
+
+ src.link(&demux).unwrap();
+```
+
+## Media pipeline
+
+![*_OGG_Demux_*](ogg-demux-pipeline.svg)
+
+## Some stats
+
+- **gstreamer-rs** & **gst-plugins-rs**[^2]
- gstreamer-rs: ~2700 commits, gst-plugins-rs: ~2600 commits
- gstreamer-rs: ~85 contributors, gst-plugins-rs: ~110 contributors
- gst-plugins-rs: ~ +180k SLOC / -37k SLOC
@@ -221,22 +317,24 @@ For more information about this error, try `rustc --explain E0596`.
- 1.22 cycle: ~33% commits / MRs in Rust modules
- 1.24 cycle: ~25% commits / MRs in Rust modules
-[^3]: [GStreamer & Rust: What has happened over the last 5 years](https://gstconf.ubicast.tv/videos/gstreamer-rust-what-has-happened-over-the-last-5-years_f8qxhpuzi9/)
+[^2]: [GStreamer & Rust: What has happened over the last 5 years](https://gstconf.ubicast.tv/videos/gstreamer-rust-what-has-happened-over-the-last-5-years_f8qxhpuzi9/)
## Resources
+- [Dynamic Pipelines](https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c)
- [GObject subclassing in Rust ](https://www.youtube.com/watch?v=TSf3rVyv7c8)
- [GStreamer bindings for Rust](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs)
- [Rust GStreamer Plugins](https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs)
- [Using GStreamer](https://www.youtube.com/watch?v=ZphadMGufY8)
- [How to get started with GStreamer](https://www.youtube.com/watch?v=OkOsm9FyzdM&t=2s)
- [GStreamer for your backend services](https://asymptotic.io/blog/gstreamer-for-your-backend-services/)
+- [OGG demultiplexing Rust sample code](https://gitlab.freedesktop.org/SanchayanMaity/ogg-demux)
## Questions?
- Rust Bangalore
- * Meetup: https://hasgeek.com/rustbangalore
- * Telegram: t.me/RustIndia
+ * Meetup: [https://hasgeek.com/rustbangalore](https://hasgeek.com/rustbangalore)
+ * Telegram: [https://t.me/RustIndia](https://t.me/RustIndia)
- Reach out on
* email:
diff --git a/rusttechx-2024/template.typ b/rusttechx-2024/template.typ
index 165fc17..52c9892 100644
--- a/rusttechx-2024/template.typ
+++ b/rusttechx-2024/template.typ
@@ -1,7 +1,6 @@
#import "@preview/diatypst:0.2.0": *
#show: slides.with(
title: "Multimedia using Rust & GStreamer",
- authors: ("Sanchayan Maity"),
ratio: 16/9,
layout: "large",
toc: false,