Learning Autotools

I've started to learn Autotools more deeper than "add some source file to existing project" or "copy makefile from another project and change there something". During GSoC this year I haven't got enough time to learn Autotools well (just read manual for Libtool to understand how to compile my Totem plugin), and now it's time to fill this emptiness in my head. And I want to say a big 'thank you' to A. Duret-Lutz for his great tutorial, it's awesome! All things are explained in details, it's like to assemble a LEGO toy right in my head. After reading GGAD book I had a blur notion about how Autotools work. That's not because GGAD is bad explained book, no. It's just because it's not targeted to cover such things.

Also: Russian translation for GNOME 2.32.x raised up to 99%, just couple of lines left — great work of all the team! And I've translated Release Notes for 2.32, hope it helps somebody to look at GNOME more closely.

It's Time to Translate

GNOME 2.32 release is coming, so it's time to prepare translations for your language. Currently it's about 96% translated into Russian, and we are going to hit 100% like in previous release :) If you have some free time — you can help to spread GNOME by translating it into your native language. It's a great pleasure to use software in native language, even if you are great in English. Let's make this release ready for the whole world :)

Why does Network Manager rock

I was out of the city (Saint Petersburg) for two weeks, and I needed some kind of Internet connection (there was no wired or wireless connection). So I bought a 3G USB dongle from the local mobile network operator. I had never used such devices before. Mine one was a Huawei E1550 (E620). I plugged it in USB and waited for some seconds. A new device (with the suggestion to create a new connection) appeared in Network Manager's list of connections. I clicked for Next button three or four times, selected my operator from the list and... that's all! I clicked for a new connection and I was in Internet after a few seconds. No third-party software or drivers installation. Awesome! Just plug-and-work. Thanks to all NM developers for such a great job.

P.S. Just got an email for successful final evalution for my GSoC 2010 :) I'm really happy to finish this summer on positive note, though a lot of work is on the road.

GSoC Weekly Code Report 12

This is my last GSoC 2010 weekly report. I have mixed feelings: on one hand I'm sad that summer is over along with the GSoC, but on another hand I'm happy and proud that I had been working with such a great GNOME community. Before GSoC I was just looking at all that was happening around opensource world, especially the GNOME. I always wanted to make something useful for others, but I didn't know where to start from. And for me GSoC was like a door to the opensource world. It let me to come in, and now I don't want to go back :)

Well, this week I was working on GstToc support in the GStreamer. But there are some more good news: my Totem chapters plugin was pushed into the master branch (git commit) and now you can test it with the fresh Totem git snapshot. I'm really glad to see it there, and you are welcome to test it and to file some bug reports :) Regarding to GstToc work, there were quite a few changes. I added new GstTocSetter interface (with unit tests) similar to GstTagSetter interface, so that applications can set TOC on the pipeline via the proper tocsetter element, added copy functions for GstTocEntry and GstToc structures, removed some values from GstTocEntry, added methods to set/get time positions of the TOC entries, updated tests for GstToc and all docs. Also other fixes and improvements were done. You can track new patches in the bug report 540890.

Now I want to summarize a bit all the work I had been doing during GSoC. You can read more about my project and how the GSoC was on my project's page.

What Is Done
  • All things mentioned in my GSoC proposal except writing files with embedded chapters and overlay titles. The first one will need file transcoding, which is not cool to do inside Totem. Before GSoC I thought that it can be done without transcoding, but I was wrong. Overlay titles need some changes in Totem's GStreamer backend, and they are not so important to spend time on them.
  • Wrote my own tiny CMML parser with embedded thumbnails support using libxml2 to drop dependency for obsolete libcmml, included in the chapters plugin.
  • Started to implement generic TOC support (GstToc) in the GStreamer. Totem (and chapters plugin, too) will have great benefits from that: imagine that you can navigate through FLAC tracks from the embedded cue sheet or chapters from the Matroska file. And support for new formats in GStreamer will require almost no changes in chapters plugin (see link for separate repository on the project's page).
  • Implemented Matroska chapters support based on GstToc (see link for separate repository on the project's page). But it will require some changes because GstToc isn't stable enough.

What I'm Going to Do After GSoC
  • Improve Totem chapters plugin (some UI redesign, integration with GstToc).
  • Finish GstToc support in the GStreamer.
  • Finish Matroska chapters support after GstToc stabilization.
  • Implement GstToc support for the FLAC embedded cue sheets (I have already read FLAC specifications).
  • Look for other GStreamer elements where I can implement GstToc support to make chapters plugin more valuable.

What I Have Learnt During GSoC
  • GLib/GObject
  • GTK+
  • libxml2
  • CMML and Annodex formats
  • OGG/liboggz
  • GStreamer
  • Matroska/EBML format
  • FLAC format
  • How to work with git and bugzilla
  • Autotools a bit
  • and other coding tips & tricks

I want to say a big "thank you" to my mentor Bastien Nocera for his help, advices and guidance during this summer, to Sebastian Dröge from the GStreamer team for his great help with GstToc and Matroska, to all GSoC GNOME administrators for their hard work with us and to all those people who helped me with advices and who simply believed in my success - I tried to do my best. And also I want to thanks Google for such a great opportunity to work during this summer. I'm not saying goodbye, I just want to put a little point at the end of this summer :)

GSoC Weekly Code Report 11

Ouh, yet another week is gone. It's a time for the "soft" pencils down state — to fix bugs and to make final touches. Well, I still have a lot of work and ideas to do :) For me the finish line of the GSoC 2010 is rather smooth because I will continue working on my project after that, so it's just some kind of a checkpoint I have to go through.

This week I was working on my GstToc implementation. First of all, I fixed some stuff: added GstStructure field to GstToc and GstTocEntry to store some additional info there, added pointer to the GstPad into every GstTocEntry to track the origin of the chapters. I added a new GstQuery — TOC query, using which you can retrieve full TOC with UID marker for the TOC entry which can be used to extend the TOC with new entries. Also I added a new GstEvent — TOC select event, to select a chapter or edition to start playback from. It will make easier chapters navigation via applications. Now I can remove start/stop and format values from GstTocEntry because they are not generic (some elements doesn't need them), but we need to find a way to store these values somewhere so that applications can retrieve them for additional information for the user interface. And I updated GstToc tests to handle new query and event, and docs for all the recent changes.

Well, I've done not so much I wanted last week, but last three days I was working only for some hours due to the breakage of my laptop's AC adapter :( Just got a new one ($55 for that — the costs are quite high here in Russia), and now I can work more. I'm moving out of the city for two weeks, so I'll be online not a much time, but I'll not stop working and try to find some kind of mobile broadband Internet there. Next week I want to work on GstToc stuff and it's implementation in the Matroska element.

GSoC Weekly Code Report 10

Heya, guys! I hope you all had a great time at the GUADEC :) This week I hadn't done too much due to absence of my mentors, but I got some days for the rest a bit, which I spent reading some books. Well, not only the books, actually. We started to discuss with Sebastian Dröge how we can integrate GstToc into the GStreamer, and I got first stuff I need to fix/implement for that. Also I read FLAC documentation to prepare for implementing cue sheets using GstToc and looked up through the flac element to figure out how I can do that. Now it's pretty clear for me.

Last week I was quite accurate with my planning due to the GUADEC :) Now, when all are backed, I can continue working on my project. First of all, I want to continue working on GstToc integration. I think that amount of work is quite well to do, so I'll do my best. Also I wish I'll have time to work on my chapters plugin. Now when Bastien Nocera is here, we can discuss what I need to do with it. See you next week with some results :)

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 :)

======================
[0] git@gitorious.org:gstreamer-chapters/gstreamer-core.git
[1] git@gitorious.org:gstreamer-chapters/gstreamer-good.git

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 :)

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 :)

GSoC Weekly Code Report 1

I'm reporting a bit late this week, but that's because of rather huge amount of work I had been had. This week was the first official when the code writing takes a start. Anyway, I've started a bit earlier, so I already have some fresh results :) Also I will have exams in university in June, and it's a time to get prepared now, but I'm trying to dedicate to GSoC as much time as I can. Well, what was happened this week:

  • finally, I made a new amaizing (at least I think so :)) hackergotchi and it was accepted. Thanks to Lucas Rocha for denying my first bad attempts - the last one really rocks :)

  • added ability to add/rename/remove chapters in my plugin. We discussed with Bastien some concepts related to it, so how does it work now: while watching the video you can press "Add chapter" button, video playback becomes paused, you are entering the name of a new chapter, and then playback resumes. Of course, new chapter appears in the list, with pixbuf related to it's time stamp. Here is how you can add a chapter:



    And here is a screenshot with some chapters added to the list during movie watching (yeah, that's a House M.D.:)):



    You can also remove or rename any of the chapters by clicking appropriate button. All chapters are displayed in the list by time growth. We still thinking about editing chapter's start time, maybe it would be better only to seek to chapter's time;

  • now you can also save all changes made with chapters - just click "Save" button. All chapters are stored in separated cmml file (like subtitles in srt file). But there is still a problem with saving chapters' thumbnails. There are a few ways to fix it: to cache them somewhere (but if you will transfer file with chapters onto another computer, plugin will need to regenerate all thumbnails from video file by going through it, which is not cool, however folks at GStreamer channel with Bastien suggested some ways) or to store them directly into the cmml file. For now I'm trying to utilise second approach, but there is a problem with serializing pixbuf data and storing it in cmml file. So, I'll mail to people who wrote cmml draft, maybe they can make things a bit more clear;

  • removed end time and duration attributes from the chapter - we do not need them, because chapter acts like a marker or a live bookmark;

  • started to read git manual, as well as the GTK+ / GNOME Application Developer book;

  • refactored and cleaned up code a bit.


I think it's not a time to test a plugin yet, but you can already touch it and feel how it works. Any feedback and suggestions are welcomed :) Next week I want to try to solve problem with saving thumbnails, to write some words on my wiki page and... to do some more progress on my plugin :)

GSoC Weekly Report Pre 2

This week I have been working on the clip list implementation in the Totem sidebar. Last week I had been working on parsing cmml file and listing all the found chapters to stdout. So, this week it's a time to make some GUI :)

The basic idea was to make something like this:



At the right side you can see chapters sidebar. There is a list of available clips for playing video. For the every clip there should be a title, start time and a pixbuf with the start frame. Also tooltip for the clip should display all available info (except the pixbuf, I think). Here is a screenshot of how the chapters plugin looks like:



So, what I've done:

  • made a new one hakergotchi - hope it would be accepted :)

  • added to the Totem sidebar list with all available chapters for the current video file;

  • added tooltips for clips in the list, like this one:


    Firstly I implemented tooltips using "has-tooltip" property and "query-tooltip" signal, but I don't like that tooltip doesn't change it's position during the cursor movement over the GtkTreeView rows, so I made it using tooltip column;

  • added navigation between clips by double clicking on them or pressing the Enter key ("row-activated" signal);

  • there was a small problem with navigation: Totem uses GST_SEEK_FLAG_KEY_UNIT while seeking through the video files via GStreamer, and such seek isn't accurate enough - on 2 hours video the difference between the time you want to seek and the time you will actually seek at may be about 10 - 15 seconds, which is too much. I talked with Bastien and made a small patch for the Totem which adds ability to seek accuarately using GST_SEEK_FLAG_ACCURATE. Now navigation works fine :) This was my first experience with making git patches, using git-bz extension - I'm going to read git manual more carefully

  • added clips' pixbufs into the list, they are just black for now;

  • cleaned up code and fixed some bugs.


The coding part of GSoC starts next week , so it will be a time for getting more fun :) First of all, I need to find a way to get frames for clips' pixbufs. Also I'll start to implement writing support for chapters (edit, add, remove), even if video file doesn't have a cmml file. Stay tuned :)

GSoC Weekly Report 1

As part of the comminity bonding period (and not only) I'll be posting weekly status reports in my GSoC project. This way interested people will be in touch with project. So, let's try to start :)

This week I was doing:

  • created repository with my chapters plugin: git://gitorious.org/totem-chapters/master.git. libcmml is required in order to use chapters plugin, you can retrieve it here: http://svn.annodex.net/libcmml. Please, use 0.9.4 version from trunk. You can find a test cmml file (test.cmml) in chapters plugin directory;

  • created my first empty Totem plugin based on sidebar-test plugin. I'm not great at GObject, so it was a good practice for me, and now I'm understanding it better. I think practice is a main way to understand complicated things;

  • learned Totem build system a bit :)

  • discussed with Bastien the way I'll be working on project in near time. So, my first target is to make chapters plugin capable to read cmml file when video file is opened, and printf() chapters' titles and descriptions;

  • first lines of experimental code: to feel Totem plugin capabilities, to feel libcmml, to feel GLib better. Thanks Bastien for pointing me on my dirty code lines. Here is a first small result:



    To make it possible just rename the test cmml file like your video file named (e.g. test-case.cmml for test-case.ogv) and open video in Totem;

  • writing this blog post :)


I have to say, that it's a great to participate in GNOME community. However I'm not familiar with GStreamer folks yet, but I'll try to do it soon, as I already have some questions :)

As for future plans, I'll try to write some GTK code (I was not using GTK much before, so it will be a good practice for me again) to make list of chapters visible at least. This week was rather exciting and I'm looking for the next one ;)

About my GSoC project (Totem chapters/markers support)

So, I've been accepted for GSoC 2010 and I'm glad to do some nice stuff for GNOME, as it's my favourite DE :) I'll be working on implementing chapter/markers support for Totem player. I'm translating Totem into Russian, and this summer I wanna to write some code for it. At first, let's talk about it more definitly.

Maybe you've heard about CMML[0][1]. It's a XML-based Continuous Media Markup Language. It's used by Annodex[2] as authoring language for annotations, indexing and hyperlinking. In other words, CMML file is essentially a textual representation of an Annodex file, as written in CMML draft. Basically it consists of XML preamble, "head" tag with some params like "title", "author" and others, "stream" tags for handling bitstreams of different types (audio, video, text, etc) in Annodex tracks, and "clip" tags for handling chapters in these streams. Annodex tracks are created on top of these all tags in CMML file. Annodex mapped into Ogg Skeleton container along with CMML bitstream. Let me show these relations on the figure below:

________ _________ _________ __________
\
| CMML | | Video | | Audio | | ... | |
________ _________ _________ __________ |
|
| skeleton | > Annodex
_____________________________________________ |
|
| Ogg | |
_____________________________________________ /

| HTTP | RTSP |
| _______________________|
|
| | RTP |
_____________________________________________

| TCP | UDP |
_____________________________________________

| IP |
_____________________________________________

As you see, the Annodex is a bit more complex thing than we need. We do not need to operate with media bitstreams - we just need some sort of annotations. And CMML is what we need. Also, Annodex was developed for Ogg Skeleton container (maybe it can be used with another container format, but I didn't find such implementations), and we can't use it for other video formats. So, I've talked with my mentor - Bastien Nocera (I'm really proud to work this summer with him :)) - and decided to use CMML for chapters. CMML was developed to use with Ogg, too (I can't find other implementations). We decided to use external .cmml file along with video file to read/write video chapters (as subtitles in separate file) - in such way we can use chapters with any video format Totem supports. Later maybe I'll implement embedded CMML support for Ogg container (as additional feature, I've already played around with Ogg container, just for future :)). It should looks like this:

----------
|stream | CMML
---------- instance
| head | document
----------
| clip_1 | ---------------------------------------------------
---------- | data bitstream in packets |
| ... | ---------------------------------------------------
---------- |
| clip_n | |
---------- |
| |
------->-<-------
| Multiplexing
|
v
---------------------------------------------------------------------
|stream|head|clip_1| data packets |clip_2| data packets ...
---------------------------------------------------------------------

But it's not the main target for now. By the way, I couldn't get libannodex working for writing, I'll see it more closely a bit later. My first step will be to parse CMML files in Totem plugin using libcmml and extract chapters information from them. I'm not greatly familiar with GLib and GTK+ (tried to write simple examples and did some university stuff with pthreads), so it will be a good expirience to learning these tools for me. I've read GLib docs, GObject docs and they are looking great ;) I like to learn new things and have a pleasure to do it.

And let's see at the CMML example document from the draft[1]:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE cmml SYSTEM "cmml.dtd">

<cmml lang="en">

<stream basetime="0">
<import contenttype="video/x-theora" src="fish.ogg" start="0"/>
</stream>

<head>
<title>Types of fish</title>
<meta name="Producer" content="Joe Ordinary"/>
<meta name="DC.Author" content="Joe's friend"/>
</head>

<clip id="intro" start="0" title="Introduction">
<a href="http://example.com/fish.html">Read more about fish</a>
<desc>This is the introduction to the film Joe made about fish.
</desc>
</clip>

<clip id="dolphin" start="npt:3.5" end="npt:0:05:05.9"
title="Dolphins">
<img src="dolphin.png"/>
<desc>Here, Joe caught sight of a dolphin in the ocean.</desc>
<meta name="Subject" content="dolphin"/>
</clip>

<clip id="goldfish" start="npt:0:05:05.9" title="Goldfish">
<a href="http://example.com/morefish.anx?id=goldfish">
More video clips on goldfish.
</a>
<img src="http://example.com/goldfish.png"/>
<desc>Joe has a fishtank at home with many colourful fish.
The common goldfish is one of them and Joe's favourite.
Here are some fabulous pictures he has taken of them.
</desc>
<meta name="Location" content="Joe's fishtank"/>
<meta name="Subject" content="goldfish"/>
</clip>

</cmml>


As you can see, there are a lot of tags that we don't need, like "stream", "a", "img" and so on. Chapter file will be very simple and clear to read. At least I hope :)

These were my first words via blog. I plan to post here my achievements and thoughts during GSoC (and maybe later, too). Also I will send weekly status reports on GNOME soc mailing list (and post them here, too) to be in touch with community :) Next time (I hope on weekends) I'll write about my plans, what I've already done and more info about my doings.

---------------------------------
[0]Wikipedia page
[1]CMML draft preiffer
[2]Annodex draft preiffer
Here is my first blog message :) It's my first attempt for blog writing.