Commit 76132454 authored by JPeg's avatar JPeg
Browse files

Log: Use different LOG_TAG for each files

parent f4eac726
......@@ -9,6 +9,8 @@
#include "libvlcjni.h"
#include "aout.h"
#include "vout.h"
#define LOG_TAG "VLC/JNI/main"
#include "log.h"
/* Pointer to the Java virtual machine
......@@ -101,7 +103,8 @@ void Java_vlc_android_LibVLC_readMedia(JNIEnv *env, jobject thiz,
libvlc_video_set_callbacks(mp, vout_lock, vout_unlock, vout_display,
(void*) myJavaLibVLC);
libvlc_audio_set_callbacks(mp, aout_open, aout_play, aout_close, (void*)myJavaLibVLC);
libvlc_audio_set_callbacks(mp, aout_open, aout_play, aout_close,
(void*) myJavaLibVLC);
/* No need to keep the media now */
libvlc_media_release(m);
......
......@@ -3,11 +3,20 @@
#include <android/log.h>
#define LOG_TAG "libvlcjni"
/* C files should define LOG_TAG before including this header */
#ifndef LOG_TAG
# define LOG_TAG "LibVLC/JNI"
#endif
#ifndef NDEBUG
# define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
# define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
#else
# define LOGD(...) (void)0
# define LOGV(...) (void)0
#endif
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARNING,LOG_TAG,__VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
#endif // LIBVLCJNI_LOG_H
......@@ -7,6 +7,8 @@
#include <vlc/vlc.h>
#include "vout.h"
#define LOG_TAG "LibVLC/JNI/vout"
#include "log.h"
/** Unique Java VM instance, as defined in libvlcjni.c */
......@@ -92,6 +94,7 @@ void vout_display(void *opaque, void *picture)
LOGE("Couldn't attach the display thread to the JVM !");
return;
}
p_sys->b_attached = 1;
// Save the environment refernce.
p_sys->p_env = p_env;
......@@ -139,8 +142,6 @@ void vout_display(void *opaque, void *picture)
/* The local reference is no longer useful. */
(*p_env)->DeleteLocalRef(p_env, byteArray);
p_sys->b_attached = 1;
}
// Fill the image buffer for debug purpose.
......
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