mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
androidmedia: Give lower ranks to codecs not starting with OMX.
On some devices there are codecs that don't start with OMX., while there are also some that do. And on some of these devices the ones that don't start with OMX. just crash during initialization while the others work. To make things even more complicated other devices have codecs with the same name that work and no alternatives. So just give a lower rank to these non-OMX codecs and hope that there's an alternative with a higher rank. Also stagefright gives codecs starting with OMX. a higher rank too and considers other codecs that don't start with OMX. as software codecs.
This commit is contained in:
parent
8f2b65c74d
commit
2e0395aa59
1 changed files with 16 additions and 3 deletions
|
@ -3130,12 +3130,25 @@ register_codecs (GstPlugin * plugin)
|
|||
|
||||
/* Give the Google software codec a secondary rank,
|
||||
* everything else is likely a hardware codec, except
|
||||
* OMX.SEC.*.sw.dec (as seen in Galaxy S4) */
|
||||
* OMX.SEC.*.sw.dec (as seen in Galaxy S4).
|
||||
*
|
||||
* Also on some devices there are codecs that don't start
|
||||
* with OMX., while there are also some that do. And on
|
||||
* some of these devices the ones that don't start with
|
||||
* OMX. just crash during initialization while the others
|
||||
* work. To make things even more complicated other devices
|
||||
* have codecs with the same name that work and no alternatives.
|
||||
* So just give a lower rank to these non-OMX codecs and hope
|
||||
* that there's an alternative with a higher rank.
|
||||
*/
|
||||
if (g_str_has_prefix (codec_info->name, "OMX.google") ||
|
||||
g_str_has_suffix (codec_info->name, ".sw.dec"))
|
||||
g_str_has_suffix (codec_info->name, ".sw.dec")) {
|
||||
rank = GST_RANK_SECONDARY;
|
||||
else
|
||||
} else if (g_str_has_prefix (codec_info->name, "OMX.")) {
|
||||
rank = GST_RANK_PRIMARY;
|
||||
} else {
|
||||
rank = GST_RANK_MARGINAL;
|
||||
}
|
||||
|
||||
ret |= gst_element_register (plugin, element_name, rank, subtype);
|
||||
g_free (element_name);
|
||||
|
|
Loading…
Reference in a new issue