Bug 986381 - Allow to use OMX SW decoder when HW is not available r=sotaro
authorBlake Wu <bwu@mozilla.com>
Wed, 07 May 2014 18:10:56 +0800
changeset 182126 a2a9fef81547139dc3c81d65460cd9757152d64e
parent 182125 49831d474b1762d1b7abba056496e218f2f2e29d
child 182127 86616594f0c96867f561146cfb51f46cdbd4fd39
push id26748
push userryanvm@gmail.com
push dateThu, 08 May 2014 19:44:34 +0000
treeherdermozilla-central@4cafec48a1f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs986381
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 986381 - Allow to use OMX SW decoder when HW is not available r=sotaro
content/media/omx/OmxDecoder.cpp
--- a/content/media/omx/OmxDecoder.cpp
+++ b/content/media/omx/OmxDecoder.cpp
@@ -489,17 +489,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(),