OSD700 – 1.0 Release

Our final release of the course is ment to show not only all the work that we have accomplished but show that we can have something that we can easily show people. Something our in the world of open source that is visible to other people. While obviously all those more “minor” things we do along the way are just as important, if not more, they aren’t quite as noticeable.

For me this was implementing video Playback Jitter, one of many missing media statistics in Firefox. While I have some working at this point, it’s not in a passable state yet because I do not know how to fix one other area of the code.

Playback Jitter, as defined by the spec, is the intended duration of the current video frame spent on screen, minus the actual duration spent on screen. Some of this data (at least, what I think is the correct data) was already available to be inside VideoFrameContainer::SetCurrentFrame via the information passed in about the current frame with aTarget (the target time this frame would be presented) and mPaintTime/lastPaintTime(the time the last frame/current frame being displayed actually was presented). These two seemed like the right information I needed to calculate the second part there, with that being the time the frame actually spent on screen.

if (!lastPaintTime.IsNull() && !aTargetTime.IsNull()) {
mPlaybackJitter += (aIntendedDuration - (aTargetTime - lastPaintTime).ToMilliseconds());

The key part above was that I needed to introduce a way to this method to know the actual time the frame was supposed to spend on the screen. I looked around at what was calling this and found nsBuiltinDecoderStateMachine::RenderVideoFrame which just so happens to have access to a class called VideoData which contains information about the start and end time of the current frame to be rendered.

From there I added a new argument to the SetCurrentFrame method that would contain this information for me:

void SetCurrentFrame(const gfxIntSize& aIntrinsicSize, Image* aImage,
                     TimeStamp aTargetTime,
                     PRInt64 aIntendedDuration);

And with the appropriate linkage through the use if IDLs and making getters available I can now access this information on my own Firefox builds. I’m unsure how close this is to being right, but once someone has time to review it I’ll be fixing up my mistakes ASAP as this stuff is a lot of fun.

I’ve also taken the task of making the HTMLProgressElement no longer inherit from HTMLFormElement and instead inherits from HTMLGenericElement. This required removing an attribute, it’s getters/setters, as well as updating forward declarations of various methods and updating some tests. I liked this one because it was sort of a mini test of everything I have learned along the way. It allows me to step from the IDL level of things and make all the connections needed in the C++ land of the code.

I’ve enjoyed working on all this Firefox stuff because it really allows me to see the kind of thought process and work that goes into making something as simple as document.getElementById in javascript land actually works. I plan on continuing with the bugs I have but also work more with Core/DOM bugs as they have been very fun and a good learning process for me. This course has been a blast and I have loved every minute of it.


One response to “OSD700 – 1.0 Release

  1. Pingback: Soft And Source - All the softs sources you need !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: