summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-18 14:31:39 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-18 14:31:39 +0200
commitc51b012991de39dcd7e50cb188a161495114c72f (patch)
treec6f50b3f31f07d2f9a52a379ea6e536f9e0eddeb /sys
parent26396bfac2699e6b69702a79fb6bda954f822328 (diff)
downloadgstreamer-plugins-bad-c51b012991de39dcd7e50cb188a161495114c72f.tar.gz
androidmedia: Prefer software codecs over hardware codecs for audio
Hardware codecs don't make sense for audio and are generally less reliable on Android than the software codecs.
Diffstat (limited to 'sys')
-rw-r--r--sys/androidmedia/gstamc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/androidmedia/gstamc.c b/sys/androidmedia/gstamc.c
index 87633ac5a..862e74fa0 100644
--- a/sys/androidmedia/gstamc.c
+++ b/sys/androidmedia/gstamc.c
@@ -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;
}