androidmedia: Prefer software codecs over hardware codecs for audio
authorSebastian Dröge <sebastian@centricular.com>
Thu, 18 Jun 2015 12:31:39 +0000 (14:31 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 18 Jun 2015 12:31:39 +0000 (14:31 +0200)
Hardware codecs don't make sense for audio and are generally less reliable on
Android than the software codecs.

sys/androidmedia/gstamc.c

index 87633ac..862e74f 100644 (file)
@@ -3143,7 +3143,9 @@ register_codecs (GstPlugin * plugin)
        */
       if (g_str_has_prefix (codec_info->name, "OMX.google") ||
           g_str_has_suffix (codec_info->name, ".sw.dec")) {
-        rank = GST_RANK_SECONDARY;
+        /* For video we prefer hardware codecs, for audio we prefer software
+         * codecs. Hardware codecs don't make much sense for audio */
+        rank = is_video ? GST_RANK_SECONDARY : GST_RANK_PRIMARY;
       } else if (g_str_has_prefix (codec_info->name, "OMX.Exynos.")
           && !is_video) {
         /* OMX.Exynos. audio codecs are existing on some devices like the
@@ -3156,7 +3158,7 @@ register_codecs (GstPlugin * plugin)
          */
         rank = GST_RANK_MARGINAL;
       } else if (g_str_has_prefix (codec_info->name, "OMX.")) {
-        rank = GST_RANK_PRIMARY;
+        rank = is_video ? GST_RANK_PRIMARY : GST_RANK_SECONDARY;
       } else {
         rank = GST_RANK_MARGINAL;
       }