[libbluray-devel] Hide internal symbols (BD-J implementation)

hpi1 git at videolan.org
Wed Sep 26 15:26:38 CEST 2012


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Sep 26 12:10:21 2012 +0300| [f0a018d8694bd383a9b87dca46974c6e146c7ec6] | committer: hpi1

Hide internal symbols (BD-J implementation)

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=f0a018d8694bd383a9b87dca46974c6e146c7ec6
---

 src/libbluray/bdj/bdj.c                           |   12 ++++++------
 src/libbluray/bdj/bdj.h                           |   15 ++++++++-------
 src/libbluray/bdj/bdj_util.h                      |    6 ++++--
 src/libbluray/bdj/native/org_videolan_Libbluray.c |    6 +++---
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 2915ab4..ba34229 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -37,14 +37,14 @@
 
 typedef jint (JNICALL * fptr_JNI_CreateJavaVM) (JavaVM **pvm, void **penv,void *args);
 
-void* load_jvm();
+static void* _load_jvm();
 
 BDJAVA* bdj_open(const char *path,
                  struct bluray *bd, struct bd_registers_s *registers,
                  struct indx_root_s *index)
 {
     // first load the jvm using dlopen
-    void* jvm_lib = load_jvm();
+    void* jvm_lib = _load_jvm();
 
     if (!jvm_lib) {
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Wasn't able to load libjvm.so\n");
@@ -153,10 +153,10 @@ int bdj_start(BDJAVA *bdjava, unsigned title)
     return (status == JNI_TRUE) ? BDJ_SUCCESS : BDJ_ERROR;
 }
 
-void bdj_stop(BDJAVA *bdjava)
+int bdj_stop(BDJAVA *bdjava)
 {
     if (!bdjava) {
-        return;
+        return BDJ_ERROR;
     }
 
     JNIEnv* env = bdjava->env;
@@ -165,7 +165,7 @@ void bdj_stop(BDJAVA *bdjava)
     if (!loader_class) {
         (*env)->ExceptionDescribe(env);
         BD_DEBUG(DBG_BDJ | DBG_CRIT, "Failed to locate org.videolan.BDJLoader class\n");
-        return;
+        return BDJ_ERROR;
     }
 
     jmethodID unload_id = (*env)->GetStaticMethodID(env, loader_class,
@@ -213,7 +213,7 @@ void bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param)
     }
 }
 
-void* load_jvm()
+static void* _load_jvm()
 {
     const char* java_home = getenv("JAVA_HOME"); // FIXME: should probably search multiple directories
     if (java_home == NULL) {
diff --git a/src/libbluray/bdj/bdj.h b/src/libbluray/bdj/bdj.h
index da74ac7..ca042e3 100644
--- a/src/libbluray/bdj/bdj.h
+++ b/src/libbluray/bdj/bdj.h
@@ -22,6 +22,8 @@
 
 #include "common.h"
 
+#include <util/attributes.h>
+
 typedef enum {
     BDJ_EVENT_NONE = 0,
     BDJ_EVENT_CHAPTER,
@@ -40,12 +42,11 @@ struct bluray;
 struct bd_registers_s;
 struct indx_root_s;
 
-BDJAVA* bdj_open(const char *path, struct bluray *bd,
-                 struct bd_registers_s *registers, struct indx_root_s *index);
-int bdj_start(BDJAVA *bdjava, unsigned title);
-void bdj_stop(BDJAVA *bdjava);
-void bdj_close(BDJAVA *bdjava);
-
-void bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param);
+BD_PRIVATE BDJAVA* bdj_open(const char *path, struct bluray *bd,
+                            struct bd_registers_s *registers, struct indx_root_s *index);
+BD_PRIVATE int  bdj_start(BDJAVA *bdjava, unsigned title);
+BD_PRIVATE int  bdj_stop(BDJAVA *bdjava);
+BD_PRIVATE void bdj_close(BDJAVA *bdjava);
+BD_PRIVATE void bdj_process_event(BDJAVA *bdjava, unsigned ev, unsigned param);
 
 #endif
diff --git a/src/libbluray/bdj/bdj_util.h b/src/libbluray/bdj/bdj_util.h
index 1e43b9c..b664ebb 100644
--- a/src/libbluray/bdj/bdj_util.h
+++ b/src/libbluray/bdj/bdj_util.h
@@ -20,13 +20,15 @@
 #ifndef JNIUTIL_H_
 #define JNIUTIL_H_
 
+#include <util/attributes.h>
+
 #include <jni.h>
 #include <stdarg.h>
 
 // makes an object from the specified class name and constructor signature
-jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...);
+BD_PRIVATE jobject bdj_make_object(JNIEnv* env, const char* name, const char* sig, ...);
 
 // makes an array for the specified class name, all elements are initialized to null
-jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count);
+BD_PRIVATE jobjectArray bdj_make_array(JNIEnv* env, const char* name, int count);
 
 #endif
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 2a297a5..44c8966 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -15,7 +15,7 @@
 #pragma GCC diagnostic ignored "-Wunused-parameter"
 #endif
 
-jobject _make_title_info(JNIEnv* env, int title, int objType, int playbackType, const char* bdjoName, int hdmvOID)
+static jobject _make_title_info(JNIEnv* env, int title, int objType, int playbackType, const char* bdjoName, int hdmvOID)
 {
     jstring name = bdjoName ? (*env)->NewStringUTF(env, bdjoName) : NULL;
     jobject ti = bdj_make_object(env, "org/videolan/TitleInfo",
@@ -26,7 +26,7 @@ jobject _make_title_info(JNIEnv* env, int title, int objType, int playbackType,
     return ti;
 }
 
-jobjectArray _make_stream_array(JNIEnv* env, int count, BLURAY_STREAM_INFO* streams)
+static jobjectArray _make_stream_array(JNIEnv* env, int count, BLURAY_STREAM_INFO* streams)
 {
     jobjectArray streamArr = bdj_make_array(env,
                     "org/videolan/StreamInfo", count);
@@ -42,7 +42,7 @@ jobjectArray _make_stream_array(JNIEnv* env, int count, BLURAY_STREAM_INFO* stre
     return streamArr;
 }
 
-jobject _make_playlist_info(JNIEnv* env, BLURAY_TITLE_INFO* ti)
+static jobject _make_playlist_info(JNIEnv* env, BLURAY_TITLE_INFO* ti)
 {
     jobjectArray marks = bdj_make_array(env, "org/videolan/TIMark",
             ti->mark_count);



More information about the libbluray-devel mailing list