android/jni/context.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 #include "../../../include/librealsense2/rs.h"
7 
8 #include "../../../include/librealsense2/hpp/rs_context.hpp"
9 
10 extern "C" JNIEXPORT jlong JNICALL
12  rs2_error* e = NULL;
14  handle_error(env, e);
15  return (jlong) handle;
16 }
17 
18 extern "C" JNIEXPORT void JNICALL
20  rs2_delete_context((rs2_context *) handle);
21 }
22 
23 extern "C" JNIEXPORT jlong JNICALL
25  jlong handle, jint mask) {
26  rs2_error* e = NULL;
27  rs2_device_list* device_list_handle = rs2_query_devices_ex((rs2_context *) handle, mask, &e);
28  handle_error(env, e);
29  return (jlong) device_list_handle;
30 }
31 
32 extern "C"
33 JNIEXPORT jstring JNICALL
35  return env->NewStringUTF(RS2_API_VERSION_STR);
36 }
#define RS2_API_VERSION
Definition: rs.h:41
GLuint64 GLenum void * handle
Definition: glext.h:7785
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
Definition: rs.cpp:163
GLint GLuint mask
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
Definition: rs.cpp:171
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_RsContext_nCreate(JNIEnv *env, jclass type)
void handle_error(JNIEnv *env, rs2_error *error)
Definition: error.cpp:6
e
Definition: rmse.py:177
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_RsContext_nQueryDevices(JNIEnv *env, jclass type, jlong handle, jint mask)
JNIEXPORT jstring JNICALL Java_com_intel_realsense_librealsense_RsContext_nGetVersion(JNIEnv *env, jclass type)
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
Definition: rs.cpp:214
GLenum type
#define RS2_API_VERSION_STR
Definition: rs.h:43
#define NULL
Definition: tinycthread.c:47
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_RsContext_nDelete(JNIEnv *env, jclass type, jlong handle)


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