GSoC Weekly Code Report 9

Heat. heat, heat... That was the most popular topic for the discussions this week in Russia. Yeah, again and again. The rain is most welcomed today, I think. There is a more terrible weather in the Moscow, BBC reports quite well the current situation. It's time for BBQs and swimming now :) Aside from weather, I'm a bit late with my report due to some things I wanted to be finished. And now I can tell about what I was working for during this week.

First of all, I was improving GstToc support in GStreamer. I created a repository[0] instead of posting a batch of patches to bugzilla again, so everyone can test it without much efforts. I added more sanity checks for TOC's structure during serialization/deserialization process: there shouldn't be mixed chapters and editions at the same level of the TOC 'cause it makes no sense. Also I added a bit more tests for GstToc to cover this improvement. Unit testing helped me a lot while I was making those changes in the GstToc.

Finally, I have finished chapters support in Matroska element including demuxer and muxer support with per-chapter/edition tags. This work is based on GstToc. What does it mean? Well, now applications can handle Matroska chapters and navigate through the file using them. With all the tags related to the TOC. That's one of the cool features I'm going to implement in my Totem chapters plugin in case of successful acceptance of the GStreamer's GstToc patches. Also from now you will not lose chapters inside Matroska files while remuxing them. All the chapters will be handled by the muxer and saved properly. Just tested it with VLC — works quite well. I've already sent patch for Matroska element to bugzilla. And you can grab gst-plugins-good branch with Matroska chapters support in my repository[1].

I worked a bit on my Totem chapters plugin (just some minor fixes), too. It's waiting for the GstToc support :) Now I'm waiting for reviews on my GStreamer patches to decide in which way I'll be moving next week. Sebastian said that GUADEC is a nice place to do it :) Well, I'm really sad that I couldn't go GUADEC this year :( I hope all you guys have a good time there! Last week my planning was quite accurate and I did all the things I wanted to do (and a bit more, but with report delaying). I didn't think that debugging and testing can take so much time, though.

Next week... For now, I'm really don't know what to do next, 'cause my work depends on GstToc features. It's August almost there and it's a time for some final touches on my GSoC project, I think. So, what do I need to do? First of all I need to integrate my Totem chapters plugin into the master branch, but it will have more sense with GstToc support in it. That's why my nearest target will be to get GstToc accepted. After that I can implement it in my chapters plugin. Till that I will be looking for other GStreamer elements in which I can implement GstToc support (not sure I will have a time during GSoC, but I have plans to make my plugin more valuable after GSoC). Also I will be hacking Totem's backend a bit to play around with GstToc features. See you next week :)


GSoC Weekly Code Report 8

Wow, another week has gone :) Enormous heat is continuing to terrorize Saint Petersburg, it is really hot hear :) Well, the summer is going on. This week I was working on GStreamer's table of contents (TOC) implementation. First of all, I moved all code related to generic TOC manipulation into the separate module (called GstToc for now). Of course, there were discussions with Sebastian Dröge about best way to do it. Main structures were changed a bit, too (e.g. titles are merged with tags list). There are four public functions now - to create/free TOC and it's entries. That's all. So, you can fill structures in free way and send them later.

Next, I was writing GTK-Doc comments to create GstToc section in GStreamer reference manual. Well, now it looks quite nice, I think. I hope it would be helpful. Also I added new GstEvent and GstMessage for sending and parsing TOC events and messages. Usage is rather common who is known with GStreamer: gst_event_new_toc () and gst_event_parse_toc () for the TOC events, gst_message_new_toc () and gst_message_parse_toc () for the TOC messages. After reading manual for Check unit testing framework I wrote test for GstToc serialization into GstStructure and back. I added this test to the Gstreamer's set of test cases. I need to say that unit testing rocks :) It is much easier to test changes (especially large-scale changes) with unit testing, and it helps me to find some regressions during code writing.

Also I was working on Matroska's TOC implementation. Now Matroska demuxer fully supports GstToc features except handling per-chapter/edition/toc tags. I cleaned up my code and made some optimizations to make it a bit faster, thanks to Sebastian's advices. And at the end of the week I spent some time to update and rebuild core libraries I need to work with. After some initial reviews made by Sebastian, I attached the set of patches to appropriate bug reports: #540890 and #481070. Now I'm waiting for the further reviews :) Anyway, you can test them with latest git versions of GStreamer.

As for my planning, the things were changed right on the road. Working on code integration with such a large project as GStreamer takes much more time I thought before. So I spent most of the time for code clean up, moving it to the appropriate place, writing docs and tests. I have to admit that my planning was not quite accurate, but I think that the amount of work done is quite well. Next week I will continue to work on TOC integration into the GStreamer and to fix any related issues. Also I have some ideas how I can improve Totem chapters plugin and I want to work on it a bit. And I'm planning to start working on TOC support in Matroska muxer (hope I will have time for that). Cya ;)

GSoC Weekly Code Report 7

This week was very hard to work due to extremely hot in St. Petersburg. Sometimes head was boiling up, and only cold water had been saving situation a bit :) Especially it was hard in public conveyances when there were a lot of people. It was hard to be at home, too. I really wanna winter back now :) I'm a bit late with my report, but that's because I wanted to finish some stuff before doing it. All my free time I worked at GStreamer generic chapters support and it's implementation in Matroska element. And I have some cool results to report:
  • first of all, I was reading EBML and Matroska specifications, and tried to understand how Matroska element in GStreamer works;
  • discussed with Sebastian Dröge design of generic chapters - structures and working principles. It can be changed at any time, but for now chapters described using two structures - GstTocInfo and GstTocEntryInfo:
    typedef struct _GstTocInfo {
    GList *subentries;
    GstTagList *tags;
    gboolean updated;
    } GstTocInfo;

    typedef struct _GstTocEntryInfo {
    GstTocEntryType type;
    GstFormat format;
    gint64 start;
    gint64 stop;
    GList *subentries;
    GstTagList *titles;
    GstTagList *tags;
    } GstTocEntryInfo;

    First describes table of contents (TOC), and the last one describes entry in the TOC. As you can see, they are pretty clear to understand. Entries can be recursively included. For now entry can be either edition (or angle, or alternative) or chapter. Tags can be either entry specific or TOC specific. Also there can be multiple titles for entry (for example, in different languages). All that you need if you want to implement chapters support in any of GStreamer elements is to proper fill these structures and link them together which isn't hard to do. But we can't send these structures via GStreamer message bus or in event, so I've written some helper functions for converting full TOC structure into the GstStructure (and vice versa for easier usage of chapters in applications) which can be used for sending as a tag or as event. Thanks to Sebastian Dröge for reviewing my code and giving me advices :) The work on generic chapters is continuing;
  • also I had been working on implementing generic chapters support in Matroska GStreamer element (demuxer only) and it's almost done. I've tested parsing on some complex test cases and it worked well. Anyway, it needs more intensive testing. In case of success it would be possible to add Matroska chapters support right in my Totem chapters plugin, which sounds cool for me :)

That's I was working on. I've done all plans from my last week except working on my chapters plugin, but I'm collecting some ideas how I can improve it in future :) Next week I want to continue working on generic chapters support, to improve it's implementation in Matroska demuxer (add per-edition/chapter/toc tags) and to start working on implementing generic chapters in Matroska muxer. I have a lot of work to do :)

GSoC Weekly Code Report 6

Well, yet another week has gone. I spent this week rather actively and have some results to report :) Finally, I got today my welome package from the Google. Delivery took about 10 days - it's really very good timings, our post service can deliver internal letters much longer. So, my last results:
  • continued to fix issues to prepare for master merge - made a lot of fixes and improvements;
  • read GTK-doc manual, filed a bug for typos I found during it's reading (well, I was a bit confused about such amount of typos, so it took time to file them all) and wrote inline documentation for my plugin;
  • removed chapter renaming dialog - now you can rename chapters right within the list, that's make interface more cleaner and simple to use, also added button (instead of rename) to go to selected chapter. Also filed a bug for GTK+-3 crash;
  • wrote patches to improve Totem's open-location dialog - thanks to Philip Withnall for reviewing them and giving me some advices;
  • finally read all GStreamer documentation, so now I'm ready to make some work on implementing generic chapters support;
  • wrote to Sebastian Dröge my initial design suggestions for generic chapters structures.

Looking back, I could say that I did all goals I've set last week, but I thought reading docs would take less time.. Next week I want to continue fixing issues to prepare chapters plugin for master merge. Also I want to read EBML and Matroska specs and discuss design of structures for generic chapters support. And to start some coding to fill these structures (I hope to do it) by hacking matroska element in GStreamer. See you soon :)