Bug 986381 - Allow to use OMX SW decoder when HW is not available. r=sotaro, a=1.4+
authorBlake Wu <bwu@mozilla.com>
Wed, 07 May 2014 18:10:56 +0800
changeset 187415 3ecdbb73c057
parent 187414 b7f5d141c237
child 187416 e96076a30b09
push id71
push userryanvm@gmail.com
push dateThu, 08 May 2014 20:43:47 +0000
treeherdermozilla-b2g30_v1_4@e96076a30b09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro, 1
bugs986381
milestone30.0
Bug 986381 - Allow to use OMX SW decoder when HW is not available. r=sotaro, a=1.4+
content/media/omx/OmxDecoder.cpp
--- a/content/media/omx/OmxDecoder.cpp
+++ b/content/media/omx/OmxDecoder.cpp
@@ -533,17 +533,21 @@ bool OmxDecoder::AllocateMediaResources(
     mNativeWindowClient = new GonkNativeWindowClient(mNativeWindow);
 #endif
 
     // Experience with OMX codecs is that only the HW decoders are
     // worth bothering with, at least on the platforms where this code
     // is currently used, and for formats this code is currently used
     // for (h.264).  So if we don't get a hardware decoder, just give
     // up.
+#ifdef MOZ_OMX_WEBM_DECODER
+    int flags = 0;//fallback to omx sw decoder if there is no hw decoder
+#else
     int flags = kHardwareCodecsOnly;
+#endif//MOZ_OMX_WEBM_DECODER
 
     if (isInEmulator()) {
       // If we are in emulator, allow to fall back to software.
       flags = 0;
     }
     mVideoSource =
           OMXCodecProxy::Create(omx,
                                 mVideoTrack->getFormat(),