A conversation with Outreachy student Sonja Heinze about Fractal

Sonja Heinze was an Outreachy intern for GNOME from December 2019 – March 2020. She worked on Fractal, GNOME’s Matrix client. She was interviewed by Oliver Propst during her internship.

Do you want to introduce yourself?

I’m a mathematician and have just finished a PhD in algebraic singularity theory. Last year, I went to a place called Recurse Center for three months with the idea to figure out if programming would be a fun alternative to an academic career.

Can you tell us about the work you’re doing?

At the moment, I’m implementing a video player in Fractal. Fractal is a communication app for the GNOME desktop based on the Matrix protocol. Communication is organized into rooms. With my contribution, video attachments get handled as follows: any message with video attachment that appears in the room history (i.e. list of messages sent in that room), gets provided some own little space where it gets auto-played in a loop without sound.

Of course, when the user scrolls up or down in the room history and the video message gets out of sight, it stops playing. When clicking on the video, the media viewer opens. There, the user can play and pause the video and seek in it (see second picture in mail attachment). Furthermore, in the media viewer the user can go forth and back through all the media sent in that room (i.e., images and videos). Both, in the room history and in the media viewer, the video widget dimensions get adjusted well according to the video resolution ratio.

Why did you choose this project?

The project seemed the most interesting and challenging one on the Outreachy list. For me, learning through the internship is just as important as starting to get to know the open source world. I hadn’t seen GTK or GStreamer before and reading about them seemed very interesting. Furthermore, Fractal is written in Rust.

I hadn’t seen any code written in Rust before, but Rust had already caught my attention during my time at the Recurse Center. I guess, if the project was written in a very common language that I didn’t know, I wouldn’t have chosen that project. But for a newish language like Rust, it seemed more acceptable and learning Rust through the project was a motivating idea. Also, contributing to a non-commercial open source communication app alternative to the mainstream ones was another mo titivating factor.

How would you rate the development experience?

It has taken me a little while to get used to the general work flow programmers are used to; as in, when to ask in a private chat, when in a public chat, when on GitLab and, if on GitLab, where. I find GitLab very user friendly. Also, whenever I don’t know about a functionality that’d be useful, my project mentors tell me about it. And whenever I know about one, but don’t know how it works, the documentation is very useful.

What are your impressions about the GNOME community and how do you feel about contributing to GNOME in general?

My two mentors for the project are super nice and helpful. And the other community members I’ve interacted with so far, are so as well. I haven’t interacted with that many people yet, though. Contributing to GNOME is cool. I see GNOME as part of a non-commercial open source alternative to Windows or Mac and contributing to that is, for sure, worth the while.

Your work on Fractal involves using GStreamer can you and tell us something about GStreamer?

GStreamer is a library used for media reproduction. In Fractal, GStreamer was already used for the implementation of the audio player that appears for messages with audio attachment in the room message history.

GStreamer reproduces audio or video by means of a pipeline, i.e. a system of connecting pieces, called elements, that manipulate the media in one way or another. In Fractal, we use a high level API provided by GStreamer for that called GstPlayer. In the end, I’ve been able to do almost everything through GstPlayer. But on my way there, I’ve sometimes manipulated the pipeline directly and through that I’ve learned a little bit about how GStreamer works. 

For example, I’ve read a little about how communication with and inside the pipeline works. The way a pipeline communicates internally is by sending events from one element to another. There are different kinds of events. Some of them are responsible for informing all pieces of the pipeline about an instruction that might come from outside the pipeline. 

An example is wanting to access a certain point of the video and playing the video from there, called seek event. For that to happen, the application can send a seek event to the pipeline; that’s one way of communicating with the pipeline from outside. When that happens, that seek event is put on all sink elements of the pipeline and from there sent upstream, element by element, until it reaches the source element, which then pulls the requested data and sends it through the pipeline. 

Events are just one example of pipeline communication. To mention some more ways to communicate with the pipeline from outside: messages the pipeline leaves on the pipeline bus for the application to listen to, state changes and queries on elements or pads.

Anything else you want to add or share?

Fractal uses Flatpak, which provides isolation of the app from the rest of the user’s system. I didn’t know Flatpak before and the concept seems pretty interesting. I hope to find some time to learn a bit about it soon.

We want to thank Sonja for taking time talking with us about Fractal and the work she’s done. More information about Fractal is available on the GNOME wiki.

Leave a Reply

Your email address will not be published. Required fields are marked *