Commit fe0a6bcb authored by Aman Gupta's avatar Aman Gupta

avcodec/mediacodec_wrapper: add helper to fetch SDK_INT

Signed-off-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
parent 7074a7cc
......@@ -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 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment