Working is becoming more and more fun. Working on streaming and seeing it evolve is rewarding. I must say I'm quite impressed how decent the 0.8 GStreamer core has become; most of my time is spent looking at fixing plug-in issues.
David did a great job on the caps rewrite; he put in stuff he wasn't sure of yet how to use (like, all of the fixating hooks), but as I learn how it works in actual use day by day it seems to get easier to fix bugs on it, and I get the feeling he had the right hunch. I'm not sure he's yet able to express exactly how the hooks are supposed to be used :) but his gut instinct seemed to point in the right place, and now it's up to fixing plugins.
Benjamin has been plugging memleaks all over, which is great. I should really build a custom valgrind that works with GStreamer, my system one has GStreamer running into some hardcoded limits.
Ronald meanwhile is beating the crap out of any media file we're currently not playing. The number is shrinking rapidly. One of these days someone is going to add mp4v/mp4a support to qtdemux, which I need for some other project.
All in all, it's moving at a pretty quick speed.
This week, I dove into the v4lsrc element, which didn't work with the qc-usb drivers because those drivers use an internal buffer of only one frame, and Ronald coded the v4lsrc element to work in streaming mode, which requires at least 2. After some fiddling and reading, I learnt that this specific driver has a hack which enables streaming mode by exposing two buffers, with both buffers being the same physical ones in the driver.
That didn't get it to work yet either. But this was due to some code in v4lsrc that only used the buffer's pointer to check which buffer to requeue in the driver, and since the driver is handing the EXACT same pointer this didn't work. So, attach the frame number as private data to the buffer, and use this to requeue the proper frame, and v4lsrc was fixed.
Next in line was rewriting TCP elements. As I've blogged before, this entailed modelling four elements (two servers and two clients) on the fdsrc/fdsink elements. At first I was just sending over raw buffer data. That, combined with an element that is able to figure out correct buffer size for raw video frames (since you can calculate this based on the output format), allowed us to stream raw video.
This breaks of course when you want to stream encoded video. There's no way to transfer the buffer size properly, so the second pipeline cannot chop up the incoming data to one buffer per frame.
So, on to writing a simple protocol to transfer GstBuffer, GstCaps and GstEvent over the TCP link. It's a bit messy at the moment, but I got it to work today. I did spend three hours over a random bug that in the end was caused by my own stupid code that freed a caps structure right before returning it :/ (In my defense, I haven't had a decent night of sleep all week).
I used to only work on audio, and am slowly picking up on video-related issues. The fun thing about hacking video is that the experiments and bugs are very rewarding. For example, as soon as we got JPEG streaming to work, we dropped down the quality level to 0, which looks like this. (It's a lot cooler if you see it move :))
It's fun to invent a protocol, as simple as it is, and write the code to handle it, all in some vacuum where you don't have to care too much yet about other opinions. It's a small simple unit with a simple design that I can easily put together, and I like doing stuff like that. I had the worst headache yesterday when I decided to do this, and having fun with it all day made my headache seem to go away.
So, yesterday I woke up at 6 with a splitting headache, took something, went back to sleep, woke up againt at 7.30, huge headache, took something, back to sleep, woke up at 9, still a huge headache. It lasted all through the day.
At night, early to bed, but no chance of getting any sleep. Got up at 1 again and started to look at doing a decent addressbook OpenLDAP setup, and this time documenting it properly with my new docbook-xml-template. Was happy to figure out how to make computer output look like a computer screen, and simple stuff like that. Hope to finish this simple HOWTO as soon as I figure out some of the more intricate details. But this time I want the stupid addressbook setup to Just Work.
I also tried out conglomerate quickly. I'm not sure it works well yet, but it looks sweet for sure, and it seems pretty responsive. I should check up on if I can use it do to real work yet.
arrived today, yay ! Johan and I are excited to have someone extra in our huge office. We're only taking up a quarter of the space right now. Granted, we don't have our definitive furniture yet, and we're still missing the pool table, pingpong table, couch, plasma TV, sauna, shower, and minibar. But still ...