The Journey Begins | Google Summer of Code


Image result for Gsoc

Google Summer of Code (GSoC) is a global program focused on bringing more student developers into open source software development. Students work with an open source organization on a 3 month programming project during their break from school.

It has always been a wish of mine to contribute to open source community. I was ecstatic would be an understatement when I got the opportunity to contribute Gnome foundation through GSoC 2019. We go through an organized and friendly environment during this period which makes GSoC a great way to enter the open source community. More importantly each student gets a mentor to guide him/her through out the GSoC period. And I am the luckiest to have gotten Sebastian Dröge as my mentor.

I'm working on GStreamer based project of Gnome Foundation. GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. The framework is based on plugins that will provide the various codec and other functionality. The plugins can be linked and arranged in a pipeline. And most of the plugins are written in C. Now the developers are in an attempt to convert them to Rust which is more robust and easily maintainable. My task is to be a part of this conversion and to help fix issues related to this. Here is the link of my project in the GSoC website.

Converting GStreamer plugins to Rust improves safety and maintainability. Rust is very strict and pedantic compiler that checks each and every variable you use and every memory address you refer to which makes GStreamer and it’s plugins more reliable and will have more space for improvement.

I've been contributing to GStreamer for a couple of months now and I have worked on two issues which were previously posted. Both the issues are related to Gstreamer plugins in Rust. I have successfully completed both of them. Let's have a look at them in detail.

Adding build.rs that provides a version number, release date and other meta data to the GStreamer plugin. Here is the link to the issue. The idea of this is to automatically infer useful values for the plugin during the build instead of hard coding them. I have used git2 crate for this purpose. You can view the changes here in the Merge request.

My second accomplishment is moving the tutorials to markdown. Sebastian Dröge has written a series of blog posts on GStreamer plugin development in Rust. My task is to convert it to markdown and put it in the gst-plugin-tutorial crate on which the tutorial is based. Let me explain to you about gst-plugin-tutorial crate. This crate has a plugin with 4 features. They are rgb2gray, sinesrc, identity and progressbin. There are blog posts for rgb2gray and sinesrc. But the code snippets there have to be updated along with some explanations. I had to update the code snippets to match the latest version of the gst-plugin-tutorial crate. And then I had to match the description to the updated code snippets. This task made me understand how a Gstreamer plugins work and how to develop them in Rust. Also I was able to familiarize with Rust which is a new language to me. Here is the link of the merge request of the above issue.

Now let me tell about my targets for the next three months.

Implementing Hyper-based HTTP source around async IO and make it feature-complete is my first task and I have started working on it. There's an already existing code that works, but it has to be finished and made feature equivalent with the HTTP source plugin in C (souphttpsrc). I have to make a feature equivalent Rust HTTP source plugin. This means adding support for all the properties, switching to async IO and support for cookie/HTTP connection sharing between multiple instances. Also writing tests will be a part of this task.

My next target is finishing FLV demuxer. Conversion of FLV demuxer to Rust is not fully complete. My task is to complete the FLV demuxer with the feature equivalent to FLV demuxer in C. For this I will compare the code in C and existing code in Rust to see if there is any missing feature. This is the link for FLV demuxer in Rust. In addition to feature completion of the plugin, I will ensure the code is clean and up to standard. I will be writing test cases for the finished plugin as well.

Finally, my plan is to write tutorials for the remaining two features of the gst-plugin-tutorial crate. As I mentioned earlier, this crate has a plugin with 4 features and there is a tutorial written for two of it. I’ll be writing tutorials for features identity and progressbin.

Above said are the primary tasks I’m planning to do during the three month period. But I’m having some secondary tasks which I will do if the primary tasks are completed before the end of the Gsoc Period. I will discuss with my mentor and decide on which task to be done with the remaining time I’ve got. I may do some or none of the secondary tasks depending on the time that my primary tasks consume.

Writing tutorial for a sink subclass and aggregator subclass are two of my secondary targets. I am planning to use some basic elements which take only one format as input (source, in GStreamer terminology) to explain aggregator subclass. Also would be able to showcase a pad subclass. The sinkpads of the compositor should have at least a property for setting alpha. Adding plugin around rust-av is also a secondary target. Wait for more blog posts for the detailed explanation of each issue that I'll be working in next three months.







Comments

Popular posts from this blog

I was there at GNOME.Asia Summit 2019

Review | GSoC 2019