*/
public native static void setLogger(AVLogger logger);
+ /**
+ * Set log level.
+ *
+ * @param level AVLogger.AV_LOG* constants.
+ */
+ public native static void setLogLevel(int level);
+
+ /**
+ * Get log level.
+ *
+ * @return AVLogger.AV_LOG* constants.
+ */
+ public native static int getLogLevel();
+
private static final int levels[] = {
AVLogger.AV_LOG_QUIET,
AVLogger.AV_LOG_PANIC,
char log[1024];
int prefix = 1;
int res;
-
+
res = DLCALL(av_log_format_line2)(ptr, level, fmt, vl, log, sizeof(log), &prefix);
if (res > 1) {
jvalue args[2];
args[0].i = level;
args[1].l = nativez_NewString(env, log);
-
+
(*env)->CallVoidMethodA(env, jlogger_ref, AVLogger_log_il, args);
}
}
DLCALL(av_log_set_callback)(DLCALL(av_log_default_callback));
}
}
+
+JNIEXPORT void JNICALL Java_au_notzed_jjmpeg_AVUtil_setLogLevel
+(JNIEnv *env, jclass jc, jint level) {
+ DLCALL(av_log_set_level(level));
+}
+
+JNIEXPORT jint JNICALL Java_au_notzed_jjmpeg_AVUtil_getLogLevel
+(JNIEnv *env, jclass jc) {
+ return DLCALL(av_log_get_level());
+}