avcodec/mediacodec_wrapper: check if codec is software earlier

This commit is contained in:
sfan5 2021-02-17 16:50:00 +01:00 committed by Matthieu Bouron
parent c35e456f54
commit 1a033008e8
1 changed files with 60 additions and 59 deletions

View File

@ -441,22 +441,6 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int e
goto done_with_info;
}
type_count = (*env)->GetArrayLength(env, types);
for (j = 0; j < type_count; j++) {
int k;
int profile_count;
type = (*env)->GetObjectArrayElement(env, types, j);
if (ff_jni_exception_check(env, 1, log_ctx) < 0) {
goto done;
}
supported_type = ff_jni_jstring_to_utf_chars(env, type, log_ctx);
if (!supported_type) {
goto done;
}
if (!av_strcasecmp(supported_type, mime)) {
codec_name = (*env)->CallObjectMethod(env, info, jfields.get_name_id);
if (ff_jni_exception_check(env, 1, log_ctx) < 0) {
goto done;
@ -478,7 +462,25 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int e
strstr(name, "OMX.ffmpeg") ||
(strstr(name, "OMX.SEC") && strstr(name, ".sw.")) ||
!strcmp(name, "OMX.qcom.video.decoder.hevcswvdec")) {
av_freep(&name);
goto done_with_info;
}
type_count = (*env)->GetArrayLength(env, types);
for (j = 0; j < type_count; j++) {
int k;
int profile_count;
type = (*env)->GetObjectArrayElement(env, types, j);
if (ff_jni_exception_check(env, 1, log_ctx) < 0) {
goto done;
}
supported_type = ff_jni_jstring_to_utf_chars(env, type, log_ctx);
if (!supported_type) {
goto done;
}
if (av_strcasecmp(supported_type, mime)) {
goto done_with_type;
}
@ -525,7 +527,6 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int e
break;
}
}
}
done_with_type:
if (profile_levels) {
@ -548,8 +549,6 @@ done_with_type:
if (found_codec) {
break;
}
av_freep(&name);
}
done_with_info:
@ -566,6 +565,8 @@ done_with_info:
if (found_codec) {
break;
}
av_freep(&name);
}
done: