mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
avcodec/mediacodec_wrapper: add helper to fetch SDK_INT
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Aman Gupta <aman@tmm1.net>
This commit is contained in:
parent
7074a7ccd9
commit
fe0a6bcbda
@ -1687,3 +1687,18 @@ int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec)
|
||||
fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ff_Build_SDK_INT(AVCodecContext *avctx)
|
||||
{
|
||||
int ret = -1;
|
||||
JNIEnv *env = NULL;
|
||||
jclass versionClass;
|
||||
jfieldID sdkIntFieldID;
|
||||
JNI_GET_ENV_OR_RETURN(env, avctx, -1);
|
||||
|
||||
versionClass = (*env)->FindClass(env, "android/os/Build$VERSION");
|
||||
sdkIntFieldID = (*env)->GetStaticFieldID(env, versionClass, "SDK_INT", "I");
|
||||
ret = (*env)->GetStaticIntField(env, versionClass, sdkIntFieldID);
|
||||
(*env)->DeleteLocalRef(env, versionClass);
|
||||
return ret;
|
||||
}
|
||||
|
@ -124,4 +124,6 @@ int ff_AMediaCodec_getConfigureFlagEncode(FFAMediaCodec *codec);
|
||||
|
||||
int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec);
|
||||
|
||||
int ff_Build_SDK_INT(AVCodecContext *avctx);
|
||||
|
||||
#endif /* AVCODEC_MEDIACODEC_WRAPPER_H */
|
||||
|
Loading…
Reference in New Issue
Block a user