Review | GSoC 2019
I've been 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 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.
Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/91
Issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/44
Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/99
Issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/31
Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/127
And more importantly, I found a few bugs in the plugin while writing the test and corrected them. They are
Planned Tasks
- Implement Hyper-based HTTP source around async IO and make it feature-complete. (Explained in below section)
GitLab issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/31 - Tutorial for gst-plugin-tutorial crate. (Explained in below section)
GitLab issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/44 - Finish 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.
GitLab issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/16
Completed Tasks
we changed the plans from the initial plan due to the tasks taking more time than expected. During the planning phase we didn’t get the whole idea about the task. On the run we figured that the tasks are bigger than expected.
1
|
Implement Hyper-based HTTP source around async IO and make it feature-complete.
|
Done partially
|
2
|
Tutorial for gst-plugin-tutorial crate which has 4 features.
(Rgb2gray, Sinesrc, identity, Progressbin)
|
Done partially
(Completed Rgb2gray, Sinesrc)
|
3
|
Finish FLV demuxer
|
Did not do
|
4
|
Extra: Add build.rs
|
Done fully
|
Breakdown of the completed tasks
Task 1
Adding build.rs that provides a version number, release date and other meta data to the GStreamer plugin. 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.Issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/5Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/91
Task 2
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 (Rgb2gray, Sinesrc, Identity and Progressbin). But I have completed below features only- Rgb2gray
- Sinesrc
Issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/44
Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/99
Task 3
Making Rust HTTP source plugin asynchronous. I have made this plugin requests and receiving asynchronous and cancellable. Reqwesthttpsrc is the Rust HTTP source is a plugin which reads data from a remote location specified by a URI and the supported protocols are HTTP and HTTPS. souphttpsrc is the C version of the HTTP source plugin.Issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/issues/31
Merge request: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/merge_requests/127
Task 4
Writing Test for Rust HTTP source Reqwesthttpsrc. Although the plugin code was partially built, the test was not written to any of the features. My mentor, Sebastian Dröge helped me for the first test and the needed class. Then we came up with few test cases and wrote the tests for them.
Test Case
|
Merge request/Commit
| |
1
|
Behavior when HTTP server not found (404) error returns to the Plugin.
| |
2
|
Seeking to a position after the element reached READY state
| |
3
|
Seeking after a buffer was received already
|
And more importantly, I found a few bugs in the plugin while writing the test and corrected them. They are
- HTTP error response were not handled correctly before. I was able to find that error and correct it.
- Offset to the outgoing buffers was not set properly.
- Set the position to 0 at start.
Task 5
Rust HTTP source was not feature complete. It had only few features of souphttpsrc which is the C version of HTTP source. One of my goals was to implement the missing properties in reqwesthttpsrc. Below are the properties I have implemented.
Name of the properties
|
Description
|
Merge request
| |
1
|
is-live
|
This is a property which can have Boolean value. If it's set to true then the plugin act as a live source. Live sources are sources that when paused discard data, such as audio or video capture devices.
| |
2
|
timeout
|
Setting timeout to the request. By default it has a timeout of 15 seconds.
| |
3
|
user-agent
|
User-Agent is an HTTP request header field. This header is used to identify where the request is being originated from. The User-Agent HTTP request header is set to a custom string using this property. Default value for user-agent header is "GStreamer reqwesthttpsrc".
| |
4
|
user-id
|
HTTP location URI user id and password for authentication.
| |
5
|
user-pw
| ||
6
|
automatic-redirect
|
Still not completed (2019.08.20)
When the status code is 3xx, follow the redirect link.
|
There are few more properties and features such as context sharing to be implemented in Rust HTTP source in order to feature complete the plugin. Missing properties are
- compress
- cookies
- extra-headers
- iradio-mode
- keep-alive
- method
- proxy
- proxy-id
- proxy-pw
- retries
- ssl-ca-file
- ssl-strict
- ssl-use-system-ca-file
Once these properties and context sharing feature is complete, reqwesthttpsrc (Rust version) can be used instead of souphttpsrc (C version).
Comments
Post a Comment