Entries Tagged 'General' ↓

Google video

Dear KDE people, I made sure you can watch your own videos now:

You absolutely had to upload them to the only video portal Swfdec didn’t support yet, eh? Anyway, Google video works ok in git now. So it’s your turn to write code so you can watch them on KDE.

My favorite keynote speaker

Since currently the keynote speakers discussion for GUADEC is heating up, here’s my write-in vote: Aaron Seigo. Please all tell Dave that he has to invite him to keynote.

automagic

I found out a thing today that I think a lot of GNOME packages do wrong: Do not put (generated) headers into foo_SOURCES. Changes to these files will not cause a rebuild of files that include them. Put the headers into noinst_HEADERS instead.

Case study: This Makefile.am will not rebuild anything when swfdec_test_function_list.h changes, this one will.

dump-a-link

Found a link to Agner Fog’s code optimizing page in the recent c’t magazine. It contains lots of recent information about optimizing C++ applications. Definitely worth a read unless you’re ds and know that by heart already.

Swfdec 0.5.5

I just noticed I haven’t blogged in a long time about Swfdec development. That might be because it’s been churning along as usual. Pekka and me are the most awesome C developers in the Free software world, more and more Flash files start working and we discover more and more things we do not support yet.

Yesterday I cut a 0.5.5 release in time for Gnome 2.21.4, so people can play with Swfdec inside Gnome. As people might know, I proposed Swfdec-Gnome for Gnome 2.22. Note that this doesn’t mean shipping a browser plugin, but a thumbnailer and standalone player. That’s stuff that the non-free plugin doesn’t give you. And thumbnailed directories just look gorgeous:

What makes this release somewhat exciting is that a lot of Flash files seem to almost be working. For example, the seek bar in Youtube works since this release. Also, we managed to make the new Youtube player almost work. You can at least watch Youtube videos embedded on other pages again! Also, FlowPlayer and the JW player work now and with it video services that use it, such as Dailymotion. The cool thing about FlowPlayer is that it is Free Software, so we almost have a Free stack for doing a video webservice in Free software – the codec is missing again. I’ve also got mails that CNN video, AOL video, Tudou and some others I already forgot also work. Google video doesn’t work yet, so there’s still something to do. Anyway, if you’ve previously had problems with the Flash file of your choice, it seems like a good day to try again.

On completely realted news, I’ve started getting involved with porting Swfdec to embedded devices, in particular running Swfdec on DirectFB, as a lot of embedded people seem to think using Flash as their UI is a good idea, because it’s flashy and has a lot of nice developer tools. I guess there’s a good thing and a bad thing about that. The good thing is that they use Free software for playback, the bad thing is that they still prefer a closed format due to the better editing environment. I guess Free software needs a GUI creation framework that is better than the current Glade. I wonder if Inkscape could be made to create UIs.
One good and one bad thing is also what I can say about running Cairo and Swfdec on embedded devices: The good thing is that it certainly is possible, the bad thing is that there’s still a lot of optimization work needed, just like on desktops. The hardware rendering capabilities just aren’t available to applications and they end up doing software rendering. Even though if they were available, everything would work at least 10x faster. Exciting times ahead I guess.

Open standards

Dear Dobey, standards are crap. Noone has been able so far to produce a standard document that unambigiously describes something in a way that makes people implement it correctly. Standards are just a non-working version of a program in plain English. And even humans fail as compilers for that language. The best-known example for this is HTML, where websites still load different scripts and CSS for every browser to make it work. But even a standard as simple as HTTP is broken in lots of browsers.

The point I’m trying to make is that to programmers open standards don’t matter. What matters is a way to communicate with other people that implement the same thing to answer questions that you have. Because in the end, it doesn’t matter if your application is standards compliant, what matters is that it works. Good examples of this are KDE and GNOME working together at Freedesktop or the communication I see going on between Mozilla and Webkit people. A bad example of this is Microsoft’s communication about OOXML with other people trying to implement it. Which shows why standards are broken: We need to send Jody there right now and hope he asks all important questions before it gets a standard. Because, if it is one and a uestion pops up, noone is gonna answer them.

The only thing standards are good for is marketing. You can label your application as supporting a new standard. And that makes people not familiar with software development think it’s better. My scenario for this is imagining Flash would be standardized by the W3C as the successor of HTML. That wouldn’t help anyone, because no documentation produced by Adobe could explain all the warts of such complex software as a Flash player. The only thing able to ducment this correctly would be the source code.

And this gets me back to OOXML. I had wished the official statement to say something along the lines of “We have to support OOXML no matter what and the only way to get answers for our questions is to ask MS in the standardization process, because MS is not interested in answering questions otherwise. We’d wish the format would just die and nobody ever uses it, but it seems this will not happen. So we had to send Jody there.” This would at least have explained my feelings towards GNOME’s OOXML involvement a lot better.

close

straight from #swfdec IRC:
<Medra> Downloaded MySpace’s vplayer.swf some weeks ago
<Medra> And it has already changed :P
<Medra> http://kirjasto.org/medar/tmp/myspace_1.png http://kirjasto.org/medar/tmp/myspace_2.png
<Medra> Had to disable security
<Medra> And the video doesn’t actually play :P Sound plays and the video just shows the first frame
<Medra> But hey, it’s good for screenshots
<Medra> omg
<Medra> it plays when you press play again :P
<Medra> yey, microsoft’s video ad works
<Medra> Wow, Dailymotion works \o
<Medra> and Google Video downloads a .flv, doesn’t show it, but it requests it
<Medra> Oh, now it plays sound

Seems we’re close…

Note to self

Note to self: When changing a Flash file to contain AS3 code (to be exact: setting the AllowABC flag in the FileAttributes tag), the behavior of masks changes (to be exact: the mask-and-clip test in swfdec’s testsuite creates different results). This is just to remember myself to fix this once we support Flash 9.

PS: Here’s a nice side effect of the mask stuff:

(For everyone not immediately noticing it: The Youtube intro Flash shows correctly. Yay!)

Is Google evil yet?

What would it take to build a better mobile phone?
A commitment to openness, a shared vision for the future, and concrete plans to make the vision a reality.

Why is it different?
The Apache license allows manufacturers and mobile operators to innovate using the platform without the requirement to contribute those innovations back to the open-source community.

robustness testing

In a recent weird moment in #swfdec, we decided we wanted to do memory allocation robustness testing in Swfdec. Swfdec has some beginnings of a memory management facility, which is similar to malloc returning NULL, but is supposed to be able to live in a glib world: If you need memory, you ask if it is available by calling swfdec_as_context_use_mem. In theory that function returns FALSE if your Flash file used up too much memory. Of course, those failure paths were very untested, because returning FALSE has not been implemented. So what we needed was a function, that would be able to return FALSE at any allocation, just like being able to return NULL at some specific malloc.

I knew there were some projects that do rigorous memory checking in their test suites, so I had a look at how they do it. Apparently, there doesn’t exist a tool for doing that, as everybody has their own solution. Cairo for example uses Chris Wilson’s memfault valgrind skin, which injects malloc failures into running code (comand line options). D-Bus uses evironment variables for practically the same thing:
Both allow you to specify to return NULL from the Nth malloc (with N specified by you). So to get complete coverage of your error handling code, you need to run your program again and again with N increased by one until you have failed for every malloc. That is very slow, as some of the Flash files we ran do 150.000 allocations – and we don’t even do good memory management yet, I expect that to increase by a factor of 10 once we refactor this. And it’s extra slow, if you run it in a valgrind skin. So we needed a faster solution.

The problem that takes so much time is of course easy to identify: You need to run all the code with succeeding malloc calls again and again until you arrive at the failure. What would be a lot faster is being able to return NULL from malloc, see if everything turned out ok, and then continue normally from the malloc. It turns out this is easy. It took 100 lines of code to do this for the above-mentioned swfdec memory function. What I do is forking the process on every malloc. The child returns NULL, the parent continues successfully. That way, you spawn a child for every malloc failure and the child just runs the failure handler. All usual code is only run once – in the parent.

There’s many things that are great using this approach. For a start, it is a lot faster. And not only that, it scales linearly with the amount of allocations done as opposed to the old approach, which was O(N^2). It also provides an easy way to do bookkeeping: the parent reaps all the children and checks if they exited succesfully, otherwise it prints an error message. So you even get a nice output.