android/jni/pipeline.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 #include "../../../include/librealsense2/h/rs_pipeline.h"
8 
9 extern "C" JNIEXPORT jlong JNICALL
11  jlong context) {
12  rs2_error* e = NULL;
13  rs2_pipeline* rv = rs2_create_pipeline(reinterpret_cast<rs2_context *>(context), &e);
14  handle_error(env, e);
15  return reinterpret_cast<jlong>(rv);
16 }
17 
18 extern "C" JNIEXPORT jlong JNICALL
20  rs2_error* e = NULL;
21  auto rv = rs2_pipeline_start(reinterpret_cast<rs2_pipeline *>(handle), &e);
22  handle_error(env, e);
23  return reinterpret_cast<jlong>(rv);
24 }
25 
26 extern "C" JNIEXPORT jlong JNICALL
28  jlong handle, jlong configHandle) {
29  rs2_error *e = NULL;
30  auto rv = rs2_pipeline_start_with_config(reinterpret_cast<rs2_pipeline *>(handle),
31  reinterpret_cast<rs2_config *>(configHandle), &e);
32  handle_error(env, e);
33  return reinterpret_cast<jlong>(rv);
34 }
35 
36 extern "C" JNIEXPORT void JNICALL
38  rs2_error* e = NULL;
39  rs2_pipeline_stop(reinterpret_cast<rs2_pipeline *>(handle), &e);
40  handle_error(env, e);
41 }
42 
43 extern "C" JNIEXPORT void JNICALL
45  jlong handle) {
46  rs2_delete_pipeline(reinterpret_cast<rs2_pipeline *>(handle));
47 }
48 
49 extern "C" JNIEXPORT jlong JNICALL
51  jlong handle, jint timeout) {
52  rs2_error* e = NULL;
53  rs2_frame *rv = rs2_pipeline_wait_for_frames(reinterpret_cast<rs2_pipeline *>(handle), timeout, &e);
54  handle_error(env, e);
55  return reinterpret_cast<jlong>(rv);
56 }
57 
58 extern "C" JNIEXPORT void JNICALL
60  jlong handle) {
61  rs2_delete_pipeline_profile(reinterpret_cast<rs2_pipeline_profile *>(handle));
62 }
63 
64 extern "C" JNIEXPORT jlong JNICALL
66  jlong handle) {
67  rs2_error* e = NULL;
68  rs2_device *rv = rs2_pipeline_profile_get_device(reinterpret_cast<rs2_pipeline_profile *>(handle), &e);
69  handle_error(env, e);
70  return reinterpret_cast<jlong>(rv);
71 }
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_Pipeline_nWaitForFrames(JNIEnv *env, jclass type, jlong handle, jint timeout)
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_Pipeline_nCreate(JNIEnv *env, jclass type, jlong context)
rs2_pipeline_profile * rs2_pipeline_start(rs2_pipeline *pipe, rs2_error **error)
Definition: rs.cpp:1827
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_Pipeline_nDelete(JNIEnv *env, jclass type, jlong handle)
GLuint64 GLenum void * handle
Definition: glext.h:7785
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_PipelineProfile_nGetDevice(JNIEnv *env, jclass type, jlong handle)
rs2_pipeline * rs2_create_pipeline(rs2_context *ctx, rs2_error **error)
Definition: rs.cpp:1756
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_PipelineProfile_nDelete(JNIEnv *env, jclass type, jlong handle)
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_Pipeline_nStop(JNIEnv *env, jclass type, jlong handle)
void handle_error(JNIEnv *env, rs2_error *error)
Definition: error.cpp:6
e
Definition: rmse.py:177
rs2_device * rs2_pipeline_profile_get_device(rs2_pipeline_profile *profile, rs2_error **error)
Definition: rs.cpp:1888
rs2_frame * rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)
Definition: rs.cpp:1774
Definition: api.h:28
rs2_pipeline_profile * rs2_pipeline_start_with_config(rs2_pipeline *pipe, rs2_config *config, rs2_error **error)
Definition: rs.cpp:1834
GLbitfield GLuint64 timeout
GLenum type
void rs2_pipeline_stop(rs2_pipeline *pipe, rs2_error **error)
Definition: rs.cpp:1766
#define NULL
Definition: tinycthread.c:47
void rs2_delete_pipeline_profile(rs2_pipeline_profile *profile)
Definition: rs.cpp:1905
void rs2_delete_pipeline(rs2_pipeline *pipe)
Definition: rs.cpp:1819
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_Pipeline_nStartWithConfig(JNIEnv *env, jclass type, jlong handle, jlong configHandle)
struct rs2_frame rs2_frame
Definition: rs_types.h:261
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_Pipeline_nStart(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:39