add Stream::getTimestamp() to java api

This commit is contained in:
Mathias Agopian
2018-10-16 16:16:07 -07:00
committed by Mathias Agopian
parent f697b41a2b
commit 3b504f2941
2 changed files with 11 additions and 0 deletions

View File

@@ -154,3 +154,9 @@ Java_com_google_android_filament_Stream_nReadPixels(JNIEnv *env, jclass,
return 0;
}
extern "C" JNIEXPORT jlong JNICALL
Java_com_google_android_filament_Stream_nGetTimestamp(JNIEnv*, jclass, jlong nativeStream) {
Stream *stream = (Stream *) nativeStream;
return stream->getTimestamp();
}

View File

@@ -128,6 +128,10 @@ public class Stream {
}
}
public long getTimestamp() {
return nGetTimestamp(getNativeObject());
}
long getNativeObject() {
if (mNativeObject == 0) {
throw new IllegalStateException("Calling method on destroyed Stream");
@@ -153,6 +157,7 @@ public class Stream {
Buffer storage, int remaining,
int left, int top, int type, int alignment, int stride, int format,
Object handler, Runnable callback);
private static native long nGetTimestamp(long nativeStream);
private static native boolean nIsNative(long nativeStream);
}