frame_queue.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #include <jni.h>
5 #include "error.h"
6 
7 #include "../../../include/librealsense2/rs.h"
8 
9 extern "C" JNIEXPORT jlong JNICALL
11  rs2_error *e = NULL;
12  rs2_frame_queue *rv = rs2_create_frame_queue(capacity, &e);
13  handle_error(env, e);
14  return (jlong) rv;
15 }
16 
17 extern "C" JNIEXPORT void JNICALL
20 }
21 
22 extern "C" JNIEXPORT jlong JNICALL
24  jlong handle) {
25  rs2_frame *output_frame = NULL;
26  rs2_error *e = NULL;
27  int rv = rs2_poll_for_frame((rs2_frame_queue *) handle, &output_frame, &e);
28  handle_error(env, e);
29  return (jlong) (rv ? output_frame : 0);
30 }
31 
32 extern "C" JNIEXPORT jlong JNICALL
34  jlong handle, jint timeout) {
35  rs2_error *e = NULL;
36  rs2_frame *rv = rs2_wait_for_frame((rs2_frame_queue *) handle, (unsigned int) timeout, &e);
37  handle_error(env, e);
38  return (jlong) rv;
39 }
40 
41 extern "C" JNIEXPORT void JNICALL
43  jlong frameHandle) {
44  rs2_error *e = NULL;
45  rs2_frame_add_ref((rs2_frame *) frameHandle, &e);
46  handle_error(env, e);
47  rs2_enqueue_frame((rs2_frame *) frameHandle, (void *) handle);
48 }
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
Definition: rs.cpp:1058
GLuint64 GLenum void * handle
Definition: glext.h:7785
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_FrameQueue_nCreate(JNIEnv *env, jclass type, jint capacity)
Definition: frame_queue.cpp:10
void rs2_delete_frame_queue(rs2_frame_queue *queue)
Definition: rs.cpp:1036
void handle_error(JNIEnv *env, rs2_error *error)
Definition: error.cpp:6
rs2_frame_queue * rs2_create_frame_queue(int capacity, rs2_error **error)
Definition: rs.cpp:1030
rs2_frame * rs2_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_error **error)
Definition: rs.cpp:1043
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_FrameQueue_nEnqueue(JNIEnv *env, jclass type, jlong handle, jlong frameHandle)
Definition: frame_queue.cpp:42
e
Definition: rmse.py:177
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_FrameQueue_nWaitForFrames(JNIEnv *env, jclass type, jlong handle, jint timeout)
Definition: frame_queue.cpp:33
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
Definition: rs.cpp:1092
GLbitfield GLuint64 timeout
GLenum type
void rs2_frame_add_ref(rs2_frame *frame, rs2_error **error)
Definition: rs.cpp:1015
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_FrameQueue_nDelete(JNIEnv *env, jclass type, jlong handle)
Definition: frame_queue.cpp:18
#define NULL
Definition: tinycthread.c:47
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_FrameQueue_nPollForFrame(JNIEnv *env, jclass type, jlong handle)
Definition: frame_queue.cpp:23
struct rs2_frame rs2_frame
Definition: rs_types.h:261


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:14