GSoC Weekly Code Report 5

It has been a month gone since the start of GSoC coding... The time is running too fast. I've done my last exam in university, and now I'm waiting for a practice, but it will be a bit later. Last weekends I was at Petergof, a very beautiful and amazing suburb near the St. Petersburg. Though it was full of tourists and visitors, I had a good free time :) Also I re-installed my Debian and Fedora systems due to bad performance of the file system (reiser 3.6, had been heavy used for 2.5 years). Spent some time to get compiled fresh GTK+ and friends. Well, back to GSoC. I planned to read GStreamer documentation last week. But half of the time I was busy with my chapters plugin. My mentor Bastien Nocera reviewed all my work done before, so I was fixing issues and implementing some features:
  • read GStreamer documentation: full Application Developer Manual and a half of a Plugin's Writer Manual. Not bad, I think, but I need to finish them this week;

  • reported to bugzilla some typos found during documentation reading;

  • couple of days ago Totem was ported to libpeas to use it for plugin handling, so I read related docs and ported chapters plugin to libpeas. It was really easy to do it ;)

  • cleaned up code a bit, fixed some style issues and fixed bugs/memory leaks found. Thanks to Bastien for reviewing my code;

  • made first steps to integrate plugin into the Totem: now preferences window has option to auto-load chapters:


    Well, screenshots are ugly a bit because of building Totem with GTK+-3 (2.90.x version), and I haven't tuned themes yet for it;

  • now after Totem's launch chapters plugin looks like this:


    There is no empty list with buttons anymore if no movie is loaded, and it looks more cleaner. Also you can load chapters from any external file (if auto-load is disabled, or no file with chapters was found). Here is a chapters plugin screenshot after loading movie without chapters data:


    Well, I'm not sure about buttons' position... Maybe it's better to move them bottom? Any feedback is welcomed. So, here you have two ways to go: to load chapters from existing file or to add them manually from scratch while watching the movie. I also removed holes from pixbufs;

  • made some minor fixes/improvements.
That's it. I've done almost all that I was planning last week. Only I need to do is to finish GStreamer documentation reading (hope to do it these weekends or at the begining of the week). But I made some progress with my plugin, and that's a nice surprise :) Totem 2.90.0 was just released, so you can test it along with chapters plugin. I synced my repository with Totem's master, so you can find where to grab the fresh version on my portfolio page. Next week I want to start to design generic chapters interface for GStreamer after I'll finish reading all the docs. Have fun on weekends :)

GSoC Weekly Code Report 4

This week was quite busy and productive for me. I have been continued working on my GSoC project (Totem chapters/markers plugin). I had two exams during this week - one of them just today :) Well, they are done and only one leaves. I wanted to implement GIO support for read/write operations, and that was my main idea for the week. But not only GIO support was implemented, let's look more closely:
  • implemented GIO async read/write support so plugin is capable to work with non-local resources (like ftp, smb and so on). I've successfully tested it on samba share;

  • added popup menu for chapters list - using it you can rename or delete any chapter(s):

  • added multiselect - now you can select as many chapters as you want and delete them all, also you can select all chapters with Ctrl-A and delete selected chapters with Del key;

  • added i18n support;

  • plugin now uses Totem's dialogs for error reporting;

  • improved CMML parser a bit and fixed some bugs;

  • filed some bugs for typos in GIO and GTK+ docs.

So, I'm looking back to the last week: all my plans were completely done, moreover some other things were done, too. Now the first part of my proposal is done: I've finished format-agnostic chapters support and you can use chapters with any video file :) I really glad to reach it :) Now my code is waiting for a review by my mentor (Bastien Nocera). All are welcome for testing!

What's next? Now I'm starting to do my next part of the project - generic chapters support in GStreamer. It is supposed to be useful for DVD chapters, Matroska chapters and so on. Later I hope to implement Matroska chapters support in my chapters plugin. So, a lot of work to be done... Next week I want to read GStreamer documentation as I'm not greatly familiar with it: Application Depeloper Manual and Plugin Writer Manual. Maybe I'll start to work on generic chapters support in GStreamer, but there a lot of docs to read, I can't promise it definitely.

GSoC Weekly Code Report 3

This week was very busy for me: I had been prepared to yet another exam and tried to do my best with my GSoC project (Totem chapters plugin):
  • I wanted to write my own tiny parser for CMML files based on libxml2 to drop libcmml dependency. Wow, I've done it :) That wasn't so easy as I thought due to lack of good documentation for libxml2. Well, there are some docs at www.xmlsoft.org, but it's not enough for a newbie in libxml2. There are only some simple examples, there are no descriptions for some enums, functions' descriptions are very poor... I'm not saying that libxml2 docs are bad, but it is really hard to use it without any knowledge. So I spent a lot of time reading docs, experimenting with it's features and possibilities before I got what I want. It parses files via xmlreader module.
    Now chapters plugin supports CMML parsing (and writing) without libcmml and you can build it without any troubles;

  • I've also added clip sorting by time before displaying them and updated build system, fixed some bugs of course;

  • moving to new CMML parser gives a bit more benefits - now I can implement GIO support to read non-local files. So I started to read GIO documentation.
That's what I was doing this week. And as I've promised, here is a demo video how chapters plugin works:



Comparing with my last week plans I've done all that plans. I'll try to do the same every week :) Next week I want to implement all read/write operations via GIO (in async way) and maybe something else (a bit code clean up is needed). See you soon!

GSoC Weekly Code Report 2

Heya! I'm back to Internet after 3 days without it, and that was really hard :) I recently watched a movie "Precious: Based on the Novel Push by Sapphire" and it's awesome - gives a lot of positive thoughts and makes feel that life is good :) This movie won 2 Oscars and some of other international awards, but it just appeared on big screen (actually, only in 1-2 cinemas in St. Petersburg) here in Russia. Tomorrow I will have my first exam in university, so it's time to blog a bit. Anyway I have been worked on my chapters plugin for Totem, and there are some positive results. Well, here they are:

  • wrote a small patch for Totem to fix duplicate signal and to remove some stuff in open-location dialog;

  • implemented thunbnails saving directly in cmml file. That's a long story to go.. It will may be changed, but for now thumbnails are stored in cmml file with chapters info. Of course, they are resized. One thumbnail is about 10-15 KB, so I think it's pretty well. I have contacted with Silvia Pfeiffer (one of the authors of cmml specification, and it was a great pleasure to talk with her, I want to say "thanks" her again) about the better way to do with thumbnails, and she said that cmml is not widely used for now, so I can slightly extend this specification (or create my own format) if I really need to do it. I put image data (base64 encoded) into the "src" attribute of the <img> tag. And it works well. Now you can save all changes you've made in chapters plugin and on the next Totem's launch you will see all your chapters again. For me it sounds cool :) Let's test whether this approach fine or I need to find another one;

  • moved all GUIs (chapters list and add/edit dialogs) to GtkBuilder instead of doing it in code manually, so I read some docs/blogs about GtkBuilder and how to use Glade editor, and that's rather useful thing for GUI building;

  • removed some messy things from the code, refactored it a bit (yeah, again, maybe I'm an idealist, don't know :), but I want all is to be perfect), fixed some bugs, added G_LIKELY/G_UNLIKELY optimizations;

  • was reading some docs for libtool, gtk+ and XML for better understanding.


Sorry for no pictures today, guys, but I'll try to make a screencast next time to show. As for the next week, I have an idea to drop dependency of libcmml for some reasons. First one is that this library is orphaned in some mainline distributions (e.g. Debian) due to lack of updates. The second one is that I need only a few features of it. So, I think that it would be more easier to use (and to build) chapters plugin without libcmml dependency. That's why I want to write my own tiny cmml parser based on libxml2. Well, let's try :)