diff options
-rw-r--r-- | cpcam/java/com/ti/omap/android/cpcam/CPCamBufferQueue.java | 11 | ||||
-rw-r--r-- | cpcam/jni/com_ti_omap_android_cpcam_CPCamBufferQueue.cpp | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/cpcam/java/com/ti/omap/android/cpcam/CPCamBufferQueue.java b/cpcam/java/com/ti/omap/android/cpcam/CPCamBufferQueue.java index 3258769..b567131 100644 --- a/cpcam/java/com/ti/omap/android/cpcam/CPCamBufferQueue.java +++ b/cpcam/java/com/ti/omap/android/cpcam/CPCamBufferQueue.java @@ -143,6 +143,16 @@ public class CPCamBufferQueue { } /** + * Gets the unique ID of the Buffer Queue + * + * @param slot indicates the slot index of the buffer to be released + * + */ + public String getId() { + return nativeGetId(); + } + + /** * Retrieve the timestamp associated with the texture image set by the most recent call to * updateTexImage. * @@ -224,6 +234,7 @@ public class CPCamBufferQueue { private native void nativeReleaseBuffer(int slot); private native int nativeGetQueuedCount(); private native void nativeRelease(); + private native final String nativeGetId(); /* * We use a class initializer to allow the native code to cache some diff --git a/cpcam/jni/com_ti_omap_android_cpcam_CPCamBufferQueue.cpp b/cpcam/jni/com_ti_omap_android_cpcam_CPCamBufferQueue.cpp index 9eb1396..227f4fa 100644 --- a/cpcam/jni/com_ti_omap_android_cpcam_CPCamBufferQueue.cpp +++ b/cpcam/jni/com_ti_omap_android_cpcam_CPCamBufferQueue.cpp @@ -360,6 +360,13 @@ static void CPCamBufferQueue_release(JNIEnv* env, jobject thiz) env->SetIntField(thiz, fields.context, 0); } +static jstring CPCamBufferQueue_getId(JNIEnv* env, jobject thiz) +{ + sp<BufferQueue> bufferQueue(CPCamBufferQueue_getCPCamBufferQueue(env, thiz)); + String8 id = bufferQueue->getId(); + return env->NewStringUTF(id.string()); +} + // ---------------------------------------------------------------------------- static JNINativeMethod gCPCamBufferQueueMethods[] = { @@ -371,6 +378,7 @@ static JNINativeMethod gCPCamBufferQueueMethods[] = { {"nativeReleaseBuffer", "(I)V", (void*)CPCamBufferQueue_releaseBuffer }, {"nativeGetTimestamp", "(I)J", (void*)CPCamBufferQueue_getTimestamp }, {"nativeRelease", "()V", (void*)CPCamBufferQueue_release }, + {"nativeGetId", "()Ljava/lang/String;", (void*)CPCamBufferQueue_getId }, }; struct field { |