From 88d909fefc0e0d484113d68c799bd3ddcf3bf38b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Wed, 27 Jan 2021 14:41:32 -0500
Subject: [PATCH] jni: update package to net.jami

Change-Id: I1b4dd0f9cba07cc343a7dfb707333f210359503a
---
 bin/jni/JavaJNI2CJNI_Load.py   |  2 +-
 bin/jni/make-swig.sh           |  2 +-
 bin/jni/ringservice.c.template |  2 +-
 bin/jni/videomanager.i         | 16 ++++++++--------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/bin/jni/JavaJNI2CJNI_Load.py b/bin/jni/JavaJNI2CJNI_Load.py
index f2d83c702e..3fa4f8df72 100755
--- a/bin/jni/JavaJNI2CJNI_Load.py
+++ b/bin/jni/JavaJNI2CJNI_Load.py
@@ -51,7 +51,7 @@ def type_to_signature(itype):
 		return "Ljava/lang/String;"
 	if itype == "Object" or itype == "java.lang.Object":
 		return "Ljava/lang/Object;"
-	return "Lcx/ring/daemon/%s;" % itype.replace('.', '$')
+	return "Lnet/jami/daemon/%s;" % itype.replace('.', '$')
 
 def parse_java_file(input_stream, package, module):
 	outputs = []
diff --git a/bin/jni/make-swig.sh b/bin/jni/make-swig.sh
index 8392c707fa..1d4230dc27 100755
--- a/bin/jni/make-swig.sh
+++ b/bin/jni/make-swig.sh
@@ -20,7 +20,7 @@
 set -e
 
 JNIDIR=`pwd`
-PACKAGE=cx.ring.daemon
+PACKAGE=net.jami.daemon
 
 if [ -z "$PACKAGEDIR" ]; then
    echo "Define PACKAGEDIR: output dir of generated java files"
diff --git a/bin/jni/ringservice.c.template b/bin/jni/ringservice.c.template
index 4c4bcf25d0..a903b0ed95 100644
--- a/bin/jni/ringservice.c.template
+++ b/bin/jni/ringservice.c.template
@@ -24,7 +24,7 @@ extern "C" {
 }
 
 JavaVM *gJavaVM;
-const char *kringservicePath = "cx/ring/daemon/RingserviceJNI";
+const char *kringservicePath = "net/jami/daemon/RingserviceJNI";
 
 void deinitClassHelper(JNIEnv *env, jobject obj) {
 	JAMI_INFO("deinitClassHelper");
diff --git a/bin/jni/videomanager.i b/bin/jni/videomanager.i
index 6ddf5abc69..95f41e5410 100644
--- a/bin/jni/videomanager.i
+++ b/bin/jni/videomanager.i
@@ -119,7 +119,7 @@ void rotateNV21(uint8_t* yinput, uint8_t* uvinput, unsigned ystride, unsigned uv
     return;
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_setVideoFrame(JNIEnv *jenv, jclass jcls, jbyteArray frame, int frame_size, jlong target, int w, int h, int rotation)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_setVideoFrame(JNIEnv *jenv, jclass jcls, jbyteArray frame, int frame_size, jlong target, int w, int h, int rotation)
 {
     uint8_t* f_target = (uint8_t*) ((intptr_t) target);
     if (rotation == 0)
@@ -149,7 +149,7 @@ int AndroidFormatToAVFormat(int androidformat) {
     }
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_captureVideoPacket(JNIEnv *jenv, jclass jcls, jobject buffer, jint size, jint offset, jboolean keyframe, jlong timestamp, jint rotation)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_captureVideoPacket(JNIEnv *jenv, jclass jcls, jobject buffer, jint size, jint offset, jboolean keyframe, jlong timestamp, jint rotation)
 {
     try {
         auto frame = DRing::getNewFrame();
@@ -180,7 +180,7 @@ JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_captureVideoPacket(JNI
     }
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_captureVideoFrame(JNIEnv *jenv, jclass jcls, jobject image, jint rotation)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_captureVideoFrame(JNIEnv *jenv, jclass jcls, jobject image, jint rotation)
 {
     static jclass imageClass = jenv->GetObjectClass(image);
     static jmethodID imageGetFormat = jenv->GetMethodID(imageClass, "getFormat", "()I");
@@ -283,19 +283,19 @@ JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_captureVideoFrame(JNIE
     }
 }
 
-JNIEXPORT jlong JNICALL Java_cx_ring_daemon_RingserviceJNI_acquireNativeWindow(JNIEnv *jenv, jclass jcls, jobject javaSurface)
+JNIEXPORT jlong JNICALL Java_net_jami_daemon_RingserviceJNI_acquireNativeWindow(JNIEnv *jenv, jclass jcls, jobject javaSurface)
 {
     return (jlong)(intptr_t)ANativeWindow_fromSurface(jenv, javaSurface);
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_releaseNativeWindow(JNIEnv *jenv, jclass jcls, jlong window_)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_releaseNativeWindow(JNIEnv *jenv, jclass jcls, jlong window_)
 {
     std::lock_guard<std::mutex> guard(windows_mutex);
     ANativeWindow *window = (ANativeWindow*)((intptr_t) window_);
     ANativeWindow_release(window);
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_setNativeWindowGeometry(JNIEnv *jenv, jclass jcls, jlong window_, int width, int height)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_setNativeWindowGeometry(JNIEnv *jenv, jclass jcls, jlong window_, int width, int height)
 {
     ANativeWindow *window = (ANativeWindow*)((intptr_t) window_);
     ANativeWindow_setBuffersGeometry(window, width, height, WINDOW_FORMAT_RGBA_8888);
@@ -351,7 +351,7 @@ std::unique_ptr<DRing::FrameBuffer> sinkTargetPullCallback(ANativeWindow *window
     }
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_registerVideoCallback(JNIEnv *jenv, jclass jcls, jstring sinkId, jlong window)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_registerVideoCallback(JNIEnv *jenv, jclass jcls, jstring sinkId, jlong window)
 {
     if(!sinkId) {
         SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string");
@@ -372,7 +372,7 @@ JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_registerVideoCallback(
     DRing::registerSinkTarget(sink, DRing::SinkTarget {.pull=p_display_cb, .push=f_display_cb});
 }
 
-JNIEXPORT void JNICALL Java_cx_ring_daemon_RingserviceJNI_unregisterVideoCallback(JNIEnv *jenv, jclass jcls, jstring sinkId, jlong window)
+JNIEXPORT void JNICALL Java_net_jami_daemon_RingserviceJNI_unregisterVideoCallback(JNIEnv *jenv, jclass jcls, jstring sinkId, jlong window)
 {
     if(!sinkId) {
         SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string");
-- 
GitLab