diff --git a/gst-libs/gst/dvm/Makefile.am b/gst-libs/gst/dvm/Makefile.am deleted file mode 100644 index 3da6f8616c..0000000000 --- a/gst-libs/gst/dvm/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -lib_LTLIBRARIES = libgstdvm-@GST_MAJORMINOR@.la -libgstdvmincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/dvm - -libgstdvminclude_HEADERS = \ - gstdvm.h - -libgstdvm_@GST_MAJORMINOR@_la_SOURCES = \ - gstdvm.c - -libgstdvm_@GST_MAJORMINOR@_la_CFLAGS = \ - $(GST_PLUGINS_BAD_CFLAGS) \ - $(GST_CFLAGS) -libgstdvm_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) -libgstdvm_@GST_MAJORMINOR@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) - -Android.mk: $(BUILT_SOURCES) Makefile.am - androgenizer -:PROJECT libgstdvm -:STATIC libgstdvm-@GST_MAJORMINOR@ \ - -:TAGS eng debug \ - -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ - -:SOURCES $(libgstdvm_@GST_MAJORMINOR@_la_SOURCES) \ - -:CFLAGS $(DEFS) $(libgstdvm_@GST_MAJORMINOR@_la_CFLAGS) \ - -:LDFLAGS $(libgstdvm_@GST_MAJORMINOR@_la_LDFLAGS) \ - $(libgstdvm_@GST_MAJORMINOR@_la_LIBADD) \ - -ldl \ - -:HEADER_TARGET gstreamer-@GST_MAJORMINOR@/gst/dvm \ - -:HEADERS $(libgstdvminclude_HEADERS) - -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ - > $@ diff --git a/gst-libs/gst/dvm/gstdvm.c b/gst-libs/gst/dvm/gstdvm.c deleted file mode 100644 index 82dea7b750..0000000000 --- a/gst-libs/gst/dvm/gstdvm.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (C) 2012, Collabora Ltd. - * Author: Sebastian Dröge - * Copyright (C) 2012, Cisco Systems, Inc. - * Author: Youness Alaoui - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "gstdvm.h" - -#include - -GST_DEBUG_CATEGORY (gst_dvm_debug); -#define GST_CAT_DEFAULT gst_dvm_debug - -static GModule *java_module; -static jint (*get_created_java_vms) (JavaVM ** vmBuf, jsize bufLen, - jsize * nVMs); -static jint (*create_java_vm) (JavaVM ** p_vm, JNIEnv ** p_env, void *vm_args); -static JavaVM *java_vm = NULL; -static gboolean started_java_vm = FALSE; - -static pthread_key_t current_jni_env; - -static JNIEnv * -gst_dvm_attach_current_thread (void) -{ - JNIEnv *env; - JavaVMAttachArgs args; - - GST_DEBUG ("Attaching thread %p", g_thread_self ()); - args.version = JNI_VERSION_1_6; - args.name = NULL; - args.group = NULL; - - if ((*java_vm)->AttachCurrentThread (java_vm, &env, &args) < 0) { - GST_ERROR ("Failed to attach current thread"); - return NULL; - } - - return env; -} - -static void -gst_dvm_detach_current_thread (void *env) -{ - GST_DEBUG ("Detaching thread %p", g_thread_self ()); - (*java_vm)->DetachCurrentThread (java_vm); -} - -JNIEnv * -gst_dvm_get_env (void) -{ - JNIEnv *env; - - if ((env = pthread_getspecific (current_jni_env)) == NULL) { - env = gst_dvm_attach_current_thread (); - pthread_setspecific (current_jni_env, env); - } - - return env; -} - -gboolean -gst_dvm_init (void) -{ - jsize n_vms; - - GST_DEBUG_CATEGORY_INIT (gst_dvm_debug, "dvm", 0, "DVM"); - - pthread_key_create (¤t_jni_env, gst_dvm_detach_current_thread); - - java_module = g_module_open ("libdvm", G_MODULE_BIND_LOCAL); - if (!java_module) - goto load_failed; - - if (!g_module_symbol (java_module, "JNI_CreateJavaVM", - (gpointer *) & create_java_vm)) - goto symbol_error; - - if (!g_module_symbol (java_module, "JNI_GetCreatedJavaVMs", - (gpointer *) & get_created_java_vms)) - goto symbol_error; - - n_vms = 0; - if (get_created_java_vms (&java_vm, 1, &n_vms) < 0) - goto get_created_failed; - - if (n_vms > 0) { - GST_DEBUG ("Successfully got existing Java VM %p", java_vm); - } else { - JNIEnv *env; - JavaVMInitArgs vm_args; - JavaVMOption options[4]; - - options[0].optionString = "-verbose:jni"; - options[1].optionString = "-verbose:gc"; - options[2].optionString = "-Xcheck:jni"; - options[3].optionString = "-Xdebug"; - - vm_args.version = JNI_VERSION_1_4; - vm_args.options = options; - vm_args.nOptions = 4; - vm_args.ignoreUnrecognized = JNI_TRUE; - if (create_java_vm (&java_vm, &env, &vm_args) < 0) - goto create_failed; - GST_DEBUG ("Successfully created Java VM %p", java_vm); - - started_java_vm = TRUE; - } - - return java_vm != NULL; - -load_failed: - { - GST_ERROR ("Failed to load libdvm: %s", g_module_error ()); - return FALSE; - } -symbol_error: - { - GST_ERROR ("Failed to locate required JNI symbols in libdvm: %s", - g_module_error ()); - g_module_close (java_module); - java_module = NULL; - return FALSE; - } -get_created_failed: - { - GST_ERROR ("Failed to get already created VMs"); - g_module_close (java_module); - java_module = NULL; - return FALSE; - } -create_failed: - { - GST_ERROR ("Failed to create a Java VM"); - g_module_close (java_module); - java_module = NULL; - return FALSE; - } -} - -gboolean -gst_dvm_is_own_vm (void) -{ - return started_java_vm; -} diff --git a/gst-libs/gst/dvm/gstdvm.h b/gst-libs/gst/dvm/gstdvm.h deleted file mode 100644 index 1f4b6dee97..0000000000 --- a/gst-libs/gst/dvm/gstdvm.h +++ /dev/null @@ -1,147 +0,0 @@ -/* Dalvik Virtual Machine helper functions - * - * Copyright (C) 2012, Collabora Ltd. - * Author: Sebastian Dröge - * Copyright (C) 2012, Cisco Systems, Inc. - * Author: Youness Alaoui - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __GST_DVM_H__ -#define __GST_DVM_H__ - -#include -#include - -#define GST_DVM_GET_CLASS(k, name) { \ - jclass tmp; \ - \ - tmp = (*env)->FindClass (env, name); \ - if (!tmp) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get class %s", name); \ - return FALSE; \ - } \ - \ - k.klass = (*env)->NewGlobalRef (env, tmp); \ - if (!k.klass) { \ - (*env)->ExceptionClear (env); \ - (*env)->DeleteLocalRef (env, tmp); \ - GST_ERROR ("Failed to get %s class global reference", name); \ - return FALSE; \ - } \ - (*env)->DeleteLocalRef (env, tmp); \ - } -#define GST_DVM_GET_STATIC_METHOD(k, method, signature) \ - k.method = (*env)->GetStaticMethodID (env, k.klass, #method, \ - signature); \ - if (!k.method) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get static method %s for %s", #method, #k); \ - return FALSE; \ - } - -#define GST_DVM_GET_METHOD(k, method, signature) \ - k.method = (*env)->GetMethodID (env, k.klass, #method, signature); \ - if (!k.method) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get method %s for %s", #method, #k); \ - return FALSE; \ - } - -#define GST_DVM_GET_CONSTRUCTOR(k, field, signature) \ - k.field = (*env)->GetMethodID (env, k.klass, "", signature); \ - if (!k.field) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get constructor %s for %s", #field, #k); \ - return FALSE; \ - } - -#define GST_DVM_GET_STATIC_FIELD(k, field, signature) \ - k.field = (*env)->GetStaticFieldID (env, k.klass, #field, signature); \ - if (!k.field) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get static field %s for %s", #field, #k); \ - return FALSE; \ - } - -#define GST_DVM_GET_FIELD(k, field, signature) \ - k.field = (*env)->GetFieldID (env, k.klass, #field, signature); \ - if (!k.field) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get field %s for %s", #field, #k); \ - return FALSE; \ - } - -#define GST_DVM_GET_CONSTANT(k, field, type, signature) { \ - jfieldID id; \ - \ - id = (*env)->GetStaticFieldID (env, k.klass, #field, signature); \ - if (!id) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get static field %s for %s", #field, #k); \ - return FALSE; \ - } \ - k.field = (*env)->GetStatic##type##Field (env, k.klass, id); \ - if ((*env)->ExceptionCheck (env)) { \ - (*env)->ExceptionClear (env); \ - GST_ERROR ("Failed to get " #type " constant %s", #field); \ - return FALSE; \ - } \ - } - -#define GST_DVM_STATIC_CALL(error_statement, type, k, method, ...) \ - (*env)->CallStatic##type##Method (env, k.klass, k.method, ## __VA_ARGS__); \ - if ((*env)->ExceptionCheck (env)) { \ - GST_ERROR ("Failed to call Java method"); \ - (*env)->ExceptionDescribe (env); \ - (*env)->ExceptionClear (env); \ - error_statement; \ - } - -#define GST_DVM_CALL(error_statement, obj, type, k, method, ...) \ - (*env)->Call##type##Method (env, obj, k.method, ## __VA_ARGS__); \ - if ((*env)->ExceptionCheck (env)) { \ - GST_ERROR ("Failed to call Java method"); \ - (*env)->ExceptionDescribe (env); \ - (*env)->ExceptionClear (env); \ - error_statement; \ - } - -#define GST_DVM_FIELD(error_statement, obj, type, k, field) \ - (*env)->Get##type##Field (env, obj, k.field); \ - if ((*env)->ExceptionCheck (env)) { \ - GST_ERROR ("Failed to get Java field"); \ - (*env)->ExceptionDescribe (env); \ - (*env)->ExceptionClear (env); \ - error_statement; \ - } - -#define GST_DVM_STATIC_FIELD(error_statement, type, k, field) \ - (*env)->GetStatic##type##Field (env, k.klass, k.field); \ - if ((*env)->ExceptionCheck (env)) { \ - GST_ERROR ("Failed to get Java static field"); \ - (*env)->ExceptionDescribe (env); \ - (*env)->ExceptionClear (env); \ - error_statement; \ - } - -JNIEnv *gst_dvm_get_env (void); -gboolean gst_dvm_init (void); -gboolean gst_dvm_is_own_vm (void); - -#endif /* __GST_DVM_H__ */ diff --git a/pkgconfig/gstreamer-dvm-uninstalled.pc.in b/pkgconfig/gstreamer-dvm-uninstalled.pc.in deleted file mode 100644 index c1de57e9bf..0000000000 --- a/pkgconfig/gstreamer-dvm-uninstalled.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix= -exec_prefix= -libdir=${pcfiledir}/../gst-libs/gst/dvm -includedir=${pcfiledir}/../gst-libs - -Name: GStreamer DVM, Uninstalled -Description: Dalvik Virtual Machine helpers, Uninstalled -Requires: gstreamer-@GST_MAJORMINOR@ -Version: @VERSION@ -Libs: -L${libdir} ${libdir}/libgstdvm-@GST_MAJORMINOR@.la -Cflags: -I${includedir} - diff --git a/pkgconfig/gstreamer-dvm.pc.in b/pkgconfig/gstreamer-dvm.pc.in deleted file mode 100644 index a3203a5fd1..0000000000 --- a/pkgconfig/gstreamer-dvm.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/gstreamer-@GST_MAJORMINOR@ - -Name: GStreamer DVM -Description: Dalvik Virtual Machine helpers -Requires: gstreamer-@GST_MAJORMINOR@ -Version: @VERSION@ -Libs: -L${libdir} -lgstdvm-@GST_MAJORMINOR@ -Cflags: -I${includedir} - diff --git a/sys/androidcamera/Makefile.am b/sys/androidcamera/Makefile.am deleted file mode 100644 index e24e94404f..0000000000 --- a/sys/androidcamera/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -plugin_LTLIBRARIES = libgstandroidcamera.la - -libgstandroidcamera_la_SOURCES = \ - gst-androidcamera.c \ - gst-android-hardware-camera.c \ - gst-android-graphics-surfacetexture.c \ - gst-android-graphics-imageformat.c \ - gstahcsrc.c \ - gstahccallback.c - -JAVA_SOURCE = com/gstreamer/GstAhcCallback.java - -noinst_HEADERS = \ - gstahcsrc.h \ - gstahccallback.h \ - gst-android-hardware-camera.h \ - gst-android-graphics-surfacetexture.h \ - gst-android-graphics-imageformat.h - -libgstandroidcamera_la_CFLAGS = \ - $(GST_PLUGINS_BAD_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) \ - $(GST_BASE_CFLAGS) \ - $(GST_CFLAGS) \ - -I$(srcdir) -libgstandroidcamera_la_LIBADD = \ - $(GST_PLUGINS_BASE_LIBS) \ - $(GST_BASE_LIBS) \ - $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/dvm/libgstdvm-@GST_MAJORMINOR@.la -libgstandroidcamera_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstandroidcamera_la_LIBTOOLFLAGS = --tag=disable-static - -EXTRA_DIST = $(JAVA_SOURCE) -CLEANFILES = gstahccallback.c - -if HAVE_ANDROID_SDK -gstahccallback.c: $(JAVA_SOURCE) - @echo -e " JAVAC\t $(JAVA_SOURCE)" - @$(JAVAC) -target 1.6 -source 1.6 -nowarn \ - -classpath $(ANDROID_SDK_DIR)/platforms/android-$(ANDROID_PLATFORM)/android.jar $(JAVA_SOURCE) - @echo -e " DEX\t $(JAVA_SOURCE:.java=.class)" - @$(DX) --dex --output GstAhcCallback.jar $(JAVA_SOURCE:.java=.class) - @echo -e " GEN\t $@" - @echo "#include \"gstahccallback.h\"" > $@ - @echo "" >> $@ - @echo "const static guint8 jar_file[] = {" >> $@ - @hexdump -v -e '" "' -e '8/1 "0x%02x, "' -e '"\n"' GstAhcCallback.jar | sed 's/0x ,//g' >> $@ - @echo "};" >> $@ - @echo "" >> $@ - @echo "const guint8 *gst_ahc_callback_jar = jar_file;" >> $@ - @echo "const gsize gst_ahc_callback_jar_size = sizeof(jar_file);" >> $@ - @rm -f GstAhcCallback.jar -else -gstahccallback.c: - @echo -e " GEN\t $@" - @echo "#include \"gstahccallback.h\"" > $@ - @echo "" >> $@ - @echo "const guint8 *gst_ahc_callback_jar = NULL;" >> $@ - @echo "const gsize gst_ahc_callback_jar_size = 0;" >> $@ -endif - -Android.mk: Makefile.am $(BUILT_SOURCES) - androgenizer \ - -:PROJECT libgstandroidcamera -:SHARED libgstandroidcamera \ - -:TAGS eng debug \ - -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ - -:SOURCES $(libgstandroidcamera_la_SOURCES) \ - $(libgstandroidcamera_la_SOURCES) \ - -:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstandroidcamera_la_CFLAGS) \ - -:LDFLAGS $(libgstandroidcamera_la_LDFLAGS) \ - $(libgstandroidcamera_la_LIBADD) \ - -ldl \ - -:PASSTHROUGH LOCAL_ARM_MODE:=arm \ - LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-@GST_MAJOR_MINOR@' \ - > $@ diff --git a/sys/androidcamera/com/gstreamer/GstAhcCallback.java b/sys/androidcamera/com/gstreamer/GstAhcCallback.java deleted file mode 100644 index 0763d91f6e..0000000000 --- a/sys/androidcamera/com/gstreamer/GstAhcCallback.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gstreamer; - -import android.hardware.Camera; - -public class GstAhcCallback implements Camera.PreviewCallback, - Camera.ErrorCallback, - Camera.AutoFocusCallback { - public long mUserData; - public long mCallback; - - public static native void gst_ah_camera_on_preview_frame(byte[] data, Camera camera, - long callback, long user_data); - public static native void gst_ah_camera_on_error(int error, Camera camera, - long callback, long user_data); - public static native void gst_ah_camera_on_auto_focus(boolean success, Camera camera, - long callback, long user_data); - - public GstAhcCallback(long callback, long user_data) { - mCallback = callback; - mUserData = user_data; - } - - @Override - public void onPreviewFrame(byte[] data, Camera camera) { - gst_ah_camera_on_preview_frame(data, camera, mCallback, mUserData); - } - - @Override - public void onError(int error, Camera camera) { - gst_ah_camera_on_error(error, camera, mCallback, mUserData); - } - - @Override - public void onAutoFocus(boolean success, Camera camera) { - gst_ah_camera_on_auto_focus(success, camera, mCallback, mUserData); - } -} diff --git a/sys/androidcamera/gstahccallback.h b/sys/androidcamera/gstahccallback.h deleted file mode 100644 index df4d6d20bf..0000000000 --- a/sys/androidcamera/gstahccallback.h +++ /dev/null @@ -1,33 +0,0 @@ -/* com/gstreamer/GstAhcCallbac.java wrapper header - * - * Copyright (C) 2012, Cisco Systems, Inc. - * Author: Youness Alaoui - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GST_AHC_CALLBACK_H__ -#define __GST_AHC_CALLBACK_H__ - -#include - -G_BEGIN_DECLS - -extern const guint8 *gst_ahc_callback_jar; -extern const gsize gst_ahc_callback_jar_size; - -G_END_DECLS -#endif /* __GST_AHC_CALLBACK_H__ */ diff --git a/sys/androidcamera/gst-android-graphics-imageformat.c b/sys/androidmedia/gst-android-graphics-imageformat.c similarity index 100% rename from sys/androidcamera/gst-android-graphics-imageformat.c rename to sys/androidmedia/gst-android-graphics-imageformat.c diff --git a/sys/androidcamera/gst-android-graphics-imageformat.h b/sys/androidmedia/gst-android-graphics-imageformat.h similarity index 100% rename from sys/androidcamera/gst-android-graphics-imageformat.h rename to sys/androidmedia/gst-android-graphics-imageformat.h diff --git a/sys/androidcamera/gst-android-graphics-surfacetexture.c b/sys/androidmedia/gst-android-graphics-surfacetexture.c similarity index 100% rename from sys/androidcamera/gst-android-graphics-surfacetexture.c rename to sys/androidmedia/gst-android-graphics-surfacetexture.c diff --git a/sys/androidcamera/gst-android-graphics-surfacetexture.h b/sys/androidmedia/gst-android-graphics-surfacetexture.h similarity index 100% rename from sys/androidcamera/gst-android-graphics-surfacetexture.h rename to sys/androidmedia/gst-android-graphics-surfacetexture.h diff --git a/sys/androidcamera/gst-android-hardware-camera.c b/sys/androidmedia/gst-android-hardware-camera.c similarity index 100% rename from sys/androidcamera/gst-android-hardware-camera.c rename to sys/androidmedia/gst-android-hardware-camera.c diff --git a/sys/androidcamera/gst-android-hardware-camera.h b/sys/androidmedia/gst-android-hardware-camera.h similarity index 100% rename from sys/androidcamera/gst-android-hardware-camera.h rename to sys/androidmedia/gst-android-hardware-camera.h diff --git a/sys/androidcamera/gst-androidcamera.c b/sys/androidmedia/gst-androidcamera.c similarity index 100% rename from sys/androidcamera/gst-androidcamera.c rename to sys/androidmedia/gst-androidcamera.c diff --git a/sys/androidcamera/gstahcsrc.c b/sys/androidmedia/gstahcsrc.c similarity index 100% rename from sys/androidcamera/gstahcsrc.c rename to sys/androidmedia/gstahcsrc.c diff --git a/sys/androidcamera/gstahcsrc.h b/sys/androidmedia/gstahcsrc.h similarity index 100% rename from sys/androidcamera/gstahcsrc.h rename to sys/androidmedia/gstahcsrc.h