Do not use GST_ERROR before GStreamer has been initialized

This commit is contained in:
Xavi Artigas 2012-10-15 13:19:27 +02:00
parent 686de232a6
commit 6bdae5f2a6
2 changed files with 3 additions and 1 deletions

View file

@ -5,6 +5,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := tutorial-1 LOCAL_MODULE := tutorial-1
LOCAL_SRC_FILES := tutorial-1.c LOCAL_SRC_FILES := tutorial-1.c
LOCAL_SHARED_LIBRARIES := gstreamer_android LOCAL_SHARED_LIBRARIES := gstreamer_android
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
ifndef GSTREAMER_SDK_ROOT ifndef GSTREAMER_SDK_ROOT

View file

@ -1,5 +1,6 @@
#include <string.h> #include <string.h>
#include <jni.h> #include <jni.h>
#include <android/log.h>
#include <gst/gst.h> #include <gst/gst.h>
/* /*
@ -17,7 +18,7 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) {
JNIEnv *env = NULL; JNIEnv *env = NULL;
if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) { if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
GST_ERROR ("Could not retrieve JNIEnv"); __android_log_print (ANDROID_LOG_ERROR, "tutorial-2", "Could not retrieve JNIEnv");
return 0; return 0;
} }
jclass klass = (*env)->FindClass (env, "com/gst_sdk_tutorials/tutorial_1/Tutorial1"); jclass klass = (*env)->FindClass (env, "com/gst_sdk_tutorials/tutorial_1/Tutorial1");