RsContext.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 import android.content.Context;
4 
5 public class RsContext extends LrsClass{
6  private static DeviceWatcher mDeviceWatcher;
8 
9  public static void init(Context context){
10  if(mDeviceWatcher == null)
11  mDeviceWatcher = new DeviceWatcher(context);
12  }
13 
14  public static String getVersion(){
15  return nGetVersion();
16  }
17 
21  @Deprecated
22  public int getDeviceCount() {
23  return mDeviceWatcher.getDeviceCount();
24  }
25 
28  }
29 
30  public DeviceList queryDevices(ProductLine productLine) {
31  return new DeviceList(nQueryDevices(mHandle, productLine.value()));
32  }
33 
34  public synchronized void setDevicesChangedCallback(DeviceListener listener) {
36  mListener = listener;
37  if(mDeviceWatcher != null)
38  mDeviceWatcher.addListener(mListener);
39  }
40 
41  public synchronized void removeDevicesChangedCallback() {
42  if(mListener != null && mDeviceWatcher != null)
43  mDeviceWatcher.removeListener(mListener);
44  }
45 
46  public RsContext() {
47  mHandle = nCreate();
48  }
49 
50  @Override
51  public void close() {
53  nDelete(mHandle);
54  }
55 
56  private static native long nCreate();
57  private static native String nGetVersion();
58  private static native long nQueryDevices(long handle, int mask);
59  private static native void nDelete(long handle);
60 }
static native long nQueryDevices(long handle, int mask)
synchronized void setDevicesChangedCallback(DeviceListener listener)
Definition: RsContext.java:34
GLuint64 GLenum void * handle
Definition: glext.h:7785
GLint GLuint mask
::std_msgs::String_< std::allocator< void > > String
Definition: String.h:47
static void init(Context context)
Definition: RsContext.java:9
static native void nDelete(long handle)
DeviceList queryDevices(ProductLine productLine)
Definition: RsContext.java:30
synchronized void removeDevicesChangedCallback()
Definition: RsContext.java:41


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