MeTV A Journey from C and Xine to Rust and Gstreamer, via D
Russel Winder
@russel_winder [email protected] https://www.russel.org.uk
Copyright © 2018 Russel Winder 1 Russel Winder
● Ex theoretical physicist ● Ex Independent consultant
● Ex UNIX systems programmer ●
● Ex analyst Ex academic:
– ● Parallel programming Ex author
– Software development and programming ● – Ex expert witness HCI, UI, UX
● ● Ex Company director Ex trainer
Copyright © 2018 Russel Winder 2 Me TV
● Versions → 1.3.7 ● Version 2
– – Michael Lamothe Full client server PVR
– C code using Xine or VLC ● Version 1.4
– – Some C++ Attempt to keep Me TV – Linux DVB API used direct going in the face of no C++
– developer SQLite
MythTV, KODI Copyright © 2018 Russel Winder 3 RW Uses Me TV 1.3.7
● What: ● How:
– – IPL on ITV4 Debian package didn’t really
– Autumn Internationals on work – BBC and ITV Compiling 2.0.0 and 1.4.0
– Six Nations on BBC and didn’t really work – ITV Compiling 1.3.7 worked
Copyright © 2018 Russel Winder 4 Why not just use streaming, everyone else now does?
Copyright © 2018 Russel Winder 5 Me TV uses GTK+2
Copyright © 2018 Russel Winder 6 DVB changes v3 → v5
Copyright © 2018 Russel Winder 7 Xine becomes a “dead project”
Copyright © 2018 Russel Winder 8 VLC seems hard to “get into”
Copyright © 2018 Russel Winder 9 GNOME emphasises GStreamer
Copyright © 2018 Russel Winder 10 Me TV Evolution
● GTK+2 → GTK+3
● Xine/VLC → Gstreamer
● C++ → C++14 ( → C++17)
Copyright © 2018 Russel Winder 11 Rewrite Me TV in D
● D is a better C++ with GC ● GtkD a D binding generated
● from GIR files No nice IDE as yet ● Includes GstreamerD, and MPEG-TS
Copyright © 2018 Russel Winder 12 Gstreamer community backs Rust
Copyright © 2018 Russel Winder 13 Rewrite Me TV in Rust
● Rust is a non-GC language ● gtk-rs and gstreamer-rs. that is far, far better than C
Copyright © 2018 Russel Winder 14 Thoughts
● D is slightly nicer than Rust ● Rust is become the
● standard for GTK+ and D and Rust are far better Gstreamer work than C++
Rust has one huge win over D: Executors, channels, and futures on the GTK event loop.
Copyright © 2018 Russel Winder 15 let context = glib::MainContext::ref_thread_default(); context.spawn_local({ let c_w = control_window.clone(); message_channel.for_each(move |message| { match message { Message::FrontendAppeared { fei } => add_frontend(&c_w, &fei), Message::FrontendDisappeared { fei } => remove_frontend(&c_w, &fei), } Ok(()) }).map(|_| ()) });
Reactive architecture.
Copyright © 2018 Russel Winder 16 MeTV A Journey from C and Xine to Rust and Gstreamer, via D
Russel Winder
@russel_winder [email protected] https://www.russel.org.uk
Copyright © 2018 Russel Winder 17 Anyone fancy helping with the Rust side of the MPEG-TS library?
Copyright © 2018 Russel Winder 18 Anyone fancy doing a DAB/DAB+ source element in Rust?
Copyright © 2018 Russel Winder 19 MeTV A Journey from C and Xine to Rust and Gstreamer, via D
Russel Winder
@russel_winder [email protected] https://www.russel.org.uk
Copyright © 2018 Russel Winder 20