<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Bluish Coder: firefox</title>
 <link href="http://bluishcoder.co.nz/tag/firefox/atom.xml" rel="self"/>
 <link href="http://bluishcoder.co.nz/"/>
 <updated>2018-12-17T08:49:52+13:00</updated>
 <id>http://bluishcoder.co.nz/</id>
 <author>
   <name>Bluishcoder</name>
   <email>admin@bluishcoder.co.nz</email>
 </author>

 
 <entry>
   <title>New Wave Audio Backend Landed</title>
   <link href="http://bluishcoder.co.nz/2011/03/31/new-wave-audio-backend-landed.html"/>
   <updated>2011-03-31T16:00:00+13:00</updated>
   <id>http://bluishcoder.co.nz/2011/03/31/new-wave-audio-backend-landed</id>
   <content type="html">&lt;p&gt;Yesterday I landed &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=635649&quot;&gt;bug 635649&lt;/a&gt; on &lt;a href=&quot;https://hg.mozilla.org/mozilla-central&quot;&gt;mozilla-central&lt;/a&gt;. This is a refactoring of the wave backend for the HTML audio element. The initial work on this bug was done by &lt;a href=&quot;http://blog.mjg.im/&quot;&gt;Matthew Gregan&lt;/a&gt; with me completing the patch.&lt;/p&gt;

&lt;p&gt;Prior to this landing the wave backend implemented the HTML audio API itself, sharing very little implementation details with the other audio backends. This meant the backend had to implement the intricate details of what events get raised and when they get raised. When we wrote the WebM backend we refactored the code so we could share this sort of thing amongst backends. This bug refactored the wave backend to share this code.&lt;/p&gt;

&lt;p&gt;The advantages of this are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less likelihood of &#39;wave backend only&#39; bugs.&lt;/li&gt;
&lt;li&gt;Less code to maintain.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;https://wiki.mozilla.org/Audio_Data_API&quot;&gt;Audio Data API&lt;/a&gt; can now use wave files as this was implemented in the shared backend code.&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Firefox video scaling during YCbCr to RGB conversion</title>
   <link href="http://bluishcoder.co.nz/2010/11/24/firefox-video-scaling-during-ycbcr-to-rgb-conversion.html"/>
   <updated>2010-11-24T15:00:00+13:00</updated>
   <id>http://bluishcoder.co.nz/2010/11/24/firefox-video-scaling-during-ycbcr-to-rgb-conversion</id>
   <content type="html">&lt;p&gt;When I changed to using the &lt;a href=&quot;http://bluishcoder.co.nz/2010/03/12/changes-to-firefox-ycbcr-code.html&quot;&gt;Chromium YCbCr color conversion code&lt;/a&gt; I didn&#39;t use the code that scales the video during the conversion as there was no infrastructure in place to do this at the time.&lt;/p&gt;

&lt;p&gt;What this meant was we&#39;d do the YCbCr conversion on the original image size and then later, during rendering, scale this using the browser&#39;s scaling routines. This was slow in the case of large videos being scaled using the &#39;width&#39; and &#39;height&#39; attributes on video elements.&lt;/p&gt;

&lt;p&gt;YouTube&#39;s HTML 5 video user interface often scales down. By default it plays a good quality video scaled down to fit the standard YouTube user interface. In Firefox this results in a performance hit due to the slow scaling.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=577843&quot;&gt;Bug 577843&lt;/a&gt; was raised to address this issue. The fix was to implement scaling at YCbCr conversion time using the scaling code that already existed in Chromium&#39;s YCbCr code that we were using. This has now landed and will be in Firefox 4 resulting in better video playback when scaled.&lt;/p&gt;

&lt;p&gt;As part of this work I also updated to the latest Chromium code. This was done in &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=583138&quot;&gt;bug 583138&lt;/a&gt;. This gives more performant conversion routines and better quality. This has also landed recently and will be in Firefox 4.&lt;/p&gt;

&lt;p&gt;For performance comparisons to see if there were improvements in playback I tested video playback using WebM, Theora and a commonly used open source flash-based video player playing an MP4 video. I compared dropped frame statistics using stats available from the flash player and the &lt;a href=&quot;http://bluishcoder.co.nz/2010/08/24/experimental-playback-statistics-for-html-video-audio.html&quot;&gt;experimental playback statistics&lt;/a&gt; I wrote about earlier.&lt;/p&gt;

&lt;p&gt;For a 1080p sized video, scaled down, the performance on my laptop improved by about 25% with these patches applied and was at least as good as the flash based player. For the Theora video performance was better - I suspect due to the lower CPU requirements to decode Theora video.&lt;/p&gt;

&lt;p&gt;[update from feedback: Removed comment about YouTube&#39;s fullscreen not being hardware accelerated. Apparently Firefox trunk now accelerates it. Clarified that by &#39;flash player&#39; I meant an open source video player written in Flash, not an open source Flash implementation]&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Changes to Firefox Video Implementation</title>
   <link href="http://bluishcoder.co.nz/2010/09/15/changes-to-firefox-video-implementation.html"/>
   <updated>2010-09-15T06:25:00+12:00</updated>
   <id>http://bluishcoder.co.nz/2010/09/15/changes-to-firefox-video-implementation</id>
   <content type="html">&lt;p&gt;I mentioned in my &lt;a href=&quot;http://bluishcoder.co.nz/2010/08/24/experimental-playback-statistics-for-html-video-audio.html&quot;&gt;previous post&lt;/a&gt; about the Firefox video implementation that some changes were going to be made to make our implementation more spec compliant. These have now landed and will be in Firefox 4. The relevant bugs are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=571822&quot;&gt;Bug 571822&lt;/a&gt; - Fire timeupdate less frequently than once per frame&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=584615&quot;&gt;Bug 584615&lt;/a&gt; - Make media progress events be simple events&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Prior to these landing we would try to fire a &#39;timeupdate&#39; event every time a video frame changed. This allowed JavaScript applications to listen to this event and do things (like display subtitles) at fairly accurate time intervals. Unfortunately other browsers fire this event at different rates, usually with about 200ms between events. This made applications non-portable across browsers if they relied on per-frame events. As a result we&#39;ve moved to firing &#39;timeupdate&#39; no more frequently than 250ms. If you need to process time changes more often than this then it&#39;s best to use &#39;setTimeout&#39; or &#39;setInterval&#39; to query &#39;currentTime&#39; at the rate you need. This will work across all browsers that support the media API.&lt;/p&gt;

&lt;p&gt;The other change was to remove the &#39;progress&#39; information from the &#39;progress&#39; events. This was driven by a spec change. The &#39;progress&#39; events used to contain additional information about the byte position and total number of bytes for the download. This additional information has been removed from the spec and we were the only browser that implemented that part. To prevent cross browser issues we&#39;ve removed the information too. The alternative is to use the &#39;buffered&#39; attribute on the media element and work with time data. &#39;buffered&#39; support was also landed recently which is why we can now remove the non-compliant &#39;progress&#39; event data.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Experimental Playback Statistics for HTML Video and Audio</title>
   <link href="http://bluishcoder.co.nz/2010/08/24/experimental-playback-statistics-for-html-video-audio.html"/>
   <updated>2010-08-24T17:30:00+12:00</updated>
   <id>http://bluishcoder.co.nz/2010/08/24/experimental-playback-statistics-for-html-video-audio</id>
   <content type="html">&lt;p&gt;Now that HTML video is getting more usage there have been requests for statistics during playback so performance can be measured from JavaScript. This has come up a few times on &lt;a href=&quot;http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-May/026523.html&quot;&gt;the WHATWG mailing list&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I raised &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=580531&quot;&gt;bug 580531&lt;/a&gt; to add some additional data to media and video DOM elements to provide this information. The patch in that bug adds two attributes to the DOM HTMLVideoElement object, both prefixed by &#39;moz&#39; to prevent name clashes as they are experimental:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement
{
   ...
   // A count of the number of frames that have been decoded and ready
   // to be displayed. This can be used for computing the decoding framerate
   readonly attribute unsigned long mozDecodedFrames;

   // A count of the number of frames that have been dropped for performance
   // reasons during playback.
   readonly attribute unsigned long mozDroppedFrames;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;mozDecodedFrames is an incrementing count each time a frame is decoded and ready to be displayed. mozDroppedFrames is incremented each to a frame is dropped to keep playback going at the correct frame rate. These can be used to compute the current framerate that the video is being decoded at, and the framerate that it should be decoding at by combining the two counts. This will give client JavaScript code an indication if the hardware is able to play the video.&lt;/p&gt;

&lt;p&gt;Another requested feature is information on the download rate. Currently the Firefox implementation of HTML video and audio uses a non-standard extension to &#39;progress&#39; events. We provide information attached to the event that gives the current byte position in the media file as it downloads, and the total bytes available. This was actually required by the &lt;a href=&quot;http://www.whatwg.org/specs/web-apps/current-work/multipage/#video&quot;&gt;WHATWG spec&lt;/a&gt; at one point but it changed a while back and I don&#39;t think any other browser implements it.&lt;/p&gt;

&lt;p&gt;This has been used in experimental pages to compute things like download rate and we use it in our own controls implementation to display a progress bar as we didn&#39;t implement the &#39;buffered&#39; attribute. &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=462957&quot;&gt;Support for &#39;buffered&#39; has now landed&lt;/a&gt; so we want to &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=584615&quot;&gt;remove the non-standard &#39;progress&#39; information&lt;/a&gt; to be spec compliant.&lt;/p&gt;

&lt;p&gt;To address the needs of those using the progress data for bandwidth calculation I&#39;ve added two attributes to HTMLMediaElement:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
{
   ...
   // The approximate rate at which the media resource is being downloaded in
   // bytes per second. If the rate is not available (possibly due
   // to not having downloaded enough data to compute a consistent value)
   // this will be NaN.
   readonly attribute float mozDownloadRate;

   // The approximate rate at which the media resource is being decoded in
   // bytes per second. If the rate is not available this will be
   // NaN.
   readonly attribute float mozDecodeRate;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;mozDownloadRate is an estimate, in bytes per second, of the current download rate of the media. If not enough information has been downloaded for a reliable estimate this will be NaN. mozDecodeRate provides the rate at which decoding is occurring. In the patch this is the length of the video divided by the duration and remains constant.&lt;/p&gt;

&lt;p&gt;Whether this gets landed is yet to be determined but I think the information is useful and I&#39;d be interested in any feedback on the data I&#39;ve decided to include. There is some feedback in the bug from the patch review already and there&#39;s plenty of time between now and when the Firefox 4 rush is over to look over ideas of what could be included, removed or changed. I &lt;a href=&quot;http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027929.html&quot;&gt;posted about the proposed additions&lt;/a&gt; in the WHATWG mailing list and there are some responses in that thread.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Building Firefox with WebM support</title>
   <link href="http://bluishcoder.co.nz/2010/05/20/building-firefox-with-webm-support.html"/>
   <updated>2010-05-20T21:20:00+12:00</updated>
   <id>http://bluishcoder.co.nz/2010/05/20/building-firefox-with-webm-support</id>
   <content type="html">&lt;p&gt;All the patches to get Firefox built with &lt;a href=&quot;http://www.webmproject.org&quot;&gt;WebM&lt;/a&gt; support have now been attached to their relevant bugs. These patches aren&#39;t ready for review yet but can be used to get a build that has the functionality of the &lt;a href=&quot;http://nightly.mozilla.org/webm&quot;&gt;special Firefox WebM builds&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To build use &lt;a href=&quot;http://hg.mozilla.org/mozilla-central&quot;&gt;Mozilla Central&lt;/a&gt; as the base with the patches from the following bugs applied:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566241&quot;&gt;Bug 566241 - Video playback stops intermittently&lt;/a&gt; - This has now landed in mozilla-central.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566498&quot;&gt;Bug 566498 - Move generic video duration computing into Ogg decoder&lt;/a&gt; - This has now landed in mozilla-central.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566501&quot;&gt;Bug 566501 - Fix seeks needed only by Ogg backend&lt;/a&gt; - This has now landed in mozilla-central.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=567056&quot;&gt;Bug 567056 - Rename some variables&lt;/a&gt; - This has now landed in mozilla-central.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566246&quot;&gt;Bug 566246 - nestegg, the webm container parser we use&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566247&quot;&gt;Bug 566247 - libvpx, The VP8 SDK and associated build changes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=566245&quot;&gt;Bug 566245 - nsWebMDecoder implementation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hopefully these will be finished, reviewed and landed in short order.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>VP8, WebM and Firefox</title>
   <link href="http://bluishcoder.co.nz/2010/05/20/vp8-webm-firefox.html"/>
   <updated>2010-05-20T04:40:00+12:00</updated>
   <id>http://bluishcoder.co.nz/2010/05/20/vp8-webm-firefox</id>
   <content type="html">&lt;p&gt;For all the details on the recent announcing of VP8 video code support in Firefox, the WebM container and playing YouTube videos with Firefox, read &lt;a href=&quot;http://hacks.mozilla.org/2010/05/firefox-youtube-and-webm/&quot;&gt;Firefox, YouTube and WebM&lt;/a&gt; on &lt;a href=&quot;http://hacks.mozilla.org&quot;&gt;hacks.mozilla.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;More links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.webmproject.org/&quot;&gt;WebM Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nightly.mozilla.org/webm&quot;&gt;Firefox builds with WebM support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.webmproject.org/users/&quot;&gt;How to Play YouTube videos using WebM&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And don&#39;t forget the &lt;a href=&quot;http://labs.opera.com/news/2010/05/19/&quot;&gt;Opera WebM builds&lt;/a&gt; and &lt;a href=&quot;http://build.chromium.org/buildbot/snapshots&quot;&gt;Chromium builds&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To find WebM videos on YouTube:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search using the YouTube search&lt;/li&gt;
&lt;li&gt;On the URL for the search and &quot;&amp;amp;webm=1&amp;amp;html5=1&quot; and visit that URL.&lt;/li&gt;
&lt;li&gt;Click on a video.&lt;/li&gt;
&lt;li&gt;Add to the end of that video URL: &amp;amp;html5=1&lt;/li&gt;
&lt;li&gt;Enjoy WebM goodness.&lt;/li&gt;
&lt;li&gt;Right click in Firefox on the video to get fullscreen.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This post is available in &lt;a href=&quot;http://www.webhostinghub.com/support/vp8-webm-firefox-be&quot;&gt;the Ukranian language&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 
</feed>
