[libbluray-devel] Cast bdj_make_object() parameters to match Java signatures
hpi1
git at videolan.org
Thu Mar 30 11:55:17 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Mar 30 12:35:02 2017 +0300| [c994ca6060a00b9646c6c2ab1e9d3c40e09316af] | committer: hpi1
Cast bdj_make_object() parameters to match Java signatures
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=c994ca6060a00b9646c6c2ab1e9d3c40e09316af
---
src/libbluray/bdj/native/bdjo.c | 2 +-
src/libbluray/bdj/native/org_videolan_Libbluray.c | 32 +++++++++++++++--------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/src/libbluray/bdj/native/bdjo.c b/src/libbluray/bdj/native/bdjo.c
index 04921a0..9c1056b 100644
--- a/src/libbluray/bdj/native/bdjo.c
+++ b/src/libbluray/bdj/native/bdjo.c
@@ -61,7 +61,7 @@ static jobject _make_terminal_info(JNIEnv* env, const BDJO_TERMINAL_INFO *p)
jstring jdefault_font = (*env)->NewStringUTF(env, p->default_font);
return bdj_make_object(env, "org/videolan/bdjo/TerminalInfo", "(Ljava/lang/String;IZZ)V",
jdefault_font, (jint)p->initial_havi_config_id,
- (jint)p->menu_call_mask, (jint)p->title_search_mask);
+ (jboolean)p->menu_call_mask, (jboolean)p->title_search_mask);
}
static jobject _make_app_cache_info(JNIEnv* env, const BDJO_APP_CACHE_INFO *p)
diff --git a/src/libbluray/bdj/native/org_videolan_Libbluray.c b/src/libbluray/bdj/native/org_videolan_Libbluray.c
index 980ebf5..b908276 100644
--- a/src/libbluray/bdj/native/org_videolan_Libbluray.c
+++ b/src/libbluray/bdj/native/org_videolan_Libbluray.c
@@ -66,7 +66,7 @@ static jobject _make_title_info(JNIEnv* env, const BLURAY_TITLE *title, int titl
int playback_type = (!!title->interactive) + ((!!title->bdj) << 1);
ti = bdj_make_object(env, "org/videolan/TitleInfo",
"(IIII)V",
- title_number, title_type, playback_type, title->id_ref);
+ (jint)title_number, (jint)title_type, (jint)playback_type, (jint)title->id_ref);
}
return ti;
}
@@ -97,9 +97,13 @@ static jobjectArray _make_stream_array(JNIEnv* env, int count, BLURAY_STREAM_INF
for (int i = 0; i < count; i++) {
BLURAY_STREAM_INFO s = streams[i];
jstring lang = (*env)->NewStringUTF(env, (char*)s.lang);
- jobject streamObj = bdj_make_object(env, "org/videolan/StreamInfo",
- "(BBBCLjava/lang/String;BB)V", s.coding_type, s.format,
- s.rate, s.char_code, lang, s.aspect, s.subpath_id);
+ jobject streamObj = bdj_make_object(env,
+ "org/videolan/StreamInfo",
+ "(BBBCLjava/lang/String;BB)V",
+ (jbyte)s.coding_type, (jbyte)s.format,
+ (jbyte)s.rate, (jchar)s.char_code,
+ lang,
+ (jbyte)s.aspect, (jbyte)s.subpath_id);
(*env)->SetObjectArrayElement(env, streamArr, i, streamObj);
}
@@ -113,8 +117,11 @@ static jobject _make_playlist_info(JNIEnv* env, BLURAY_TITLE_INFO* ti)
for (uint32_t i = 0; i < ti->mark_count; i++) {
BLURAY_TITLE_MARK m = ti->marks[i];
- jobject mark = bdj_make_object(env, "org/videolan/TIMark",
- "(IIJJJI)V", m.idx, m.type, m.start, m.duration, m.offset, m.clip_ref);
+ jobject mark = bdj_make_object(env,
+ "org/videolan/TIMark",
+ "(IIJJJI)V",
+ (jint)m.idx, (jint)m.type, (jlong)m.start, (jlong)m.duration,
+ (jlong)m.offset, (jint)m.clip_ref);
(*env)->SetObjectArrayElement(env, marks, i, mark);
}
@@ -142,16 +149,19 @@ static jobject _make_playlist_info(JNIEnv* env, BLURAY_TITLE_INFO* ti)
jobjectArray secAudioStreams = _make_stream_array(env, info.sec_audio_stream_count,
info.sec_audio_streams);
- jobject clip = bdj_make_object(env, "org/videolan/TIClip",
+ jobject clip = bdj_make_object(env,
+ "org/videolan/TIClip",
"(I[Lorg/videolan/StreamInfo;[Lorg/videolan/StreamInfo;[Lorg/videolan/StreamInfo;[Lorg/videolan/StreamInfo;[Lorg/videolan/StreamInfo;[Lorg/videolan/StreamInfo;)V",
- i, videoStreams, audioStreams, pgStreams, igStreams, secVideoStreams, secAudioStreams);
+ (jint)i, videoStreams, audioStreams, pgStreams, igStreams, secVideoStreams, secAudioStreams);
(*env)->SetObjectArrayElement(env, clips, i, clip);
}
- return bdj_make_object(env, "org/videolan/PlaylistInfo",
- "(IJI[Lorg/videolan/TIMark;[Lorg/videolan/TIClip;)V",
- ti->playlist, ti->duration, ti->angle_count, marks, clips);
+ return bdj_make_object(env,
+ "org/videolan/PlaylistInfo",
+ "(IJI[Lorg/videolan/TIMark;[Lorg/videolan/TIClip;)V",
+ (jint)ti->playlist, (jlong)ti->duration, (jint)ti->angle_count,
+ marks, clips);
}
/*
More information about the libbluray-devel
mailing list