StreamProfile.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 
4 public class StreamProfile extends LrsClass {
5  private StreamType mType;
7 
8  private ProfileParams mPp;
9 
10  private class ProfileParams {
11  public int type;
12  public int format;
13  public int index;
14  public int uniqueId;
15  public int frameRate;
16  }
17 
18  StreamProfile(long handle){
19  mHandle = handle;
20  mPp = new ProfileParams();
21  nGetProfile(mHandle, mPp);
22  mType = StreamType.values()[mPp.type];
23  mFormat = StreamFormat.values()[mPp.format];
24  }
25 
26  public StreamType getType() {
27  return mType;
28  }
29 
31  return mFormat;
32  }
33 
34  public int getIndex() {
35  return mPp.index;
36  }
37 
38  public int getUniqueId() {
39  return mPp.uniqueId;
40  }
41 
42  public int getFrameRate() {
43  return mPp.frameRate;
44  }
45 
46  public Extrinsic getExtrinsicTo(StreamProfile other) throws Exception {
47  Extrinsic extrinsic = new Extrinsic();
48  nGetExtrinsicTo(mHandle, other.mHandle, extrinsic);
49  return extrinsic;
50  }
51 
52  public void registerExtrinsic(StreamProfile other, Extrinsic extrinsic)
53  {
54  nRegisterExtrinsic(mHandle, other.mHandle, extrinsic);
55  }
56 
57  public boolean is(Extension extension) {
58  return nIsProfileExtendableTo(mHandle, extension.value());
59  }
60 
61  public <T extends StreamProfile> T as(Extension extension) {
62  switch (extension){
63  case VIDEO_PROFILE: return (T) new VideoStreamProfile(mHandle);
64  case MOTION_PROFILE: return (T) new MotionStreamProfile(mHandle);
65  }
66  throw new RuntimeException("this profile is not extendable to " + extension.name());
67  }
68 
69  @Override
70  public void close() {
71 // if(mOwner)
72 // nDelete(mHandle);
73  }
74 
75  private static native boolean nIsProfileExtendableTo(long handle, int extension);
76  private static native void nGetProfile(long handle, ProfileParams params);
77  private static native void nDelete(long handle);
78  private static native void nGetExtrinsicTo(long handle, long otherHandle, Extrinsic extrinsic);
79  private static native void nRegisterExtrinsic(long handle, long otherHandle, Extrinsic extrinsic);
80 }
static native boolean nIsProfileExtendableTo(long handle, int extension)
void registerExtrinsic(StreamProfile other, Extrinsic extrinsic)
GLuint64 GLenum void * handle
Definition: glext.h:7785
T as(const std::vector< uint8_t > &data, size_t index)
Definition: uvc-types.h:407
Extrinsic getExtrinsicTo(StreamProfile other)
GLenum const GLfloat * params
static native void nGetExtrinsicTo(long handle, long otherHandle, Extrinsic extrinsic)
static native void nGetProfile(long handle, ProfileParams params)
static native void nDelete(long handle)
static native void nRegisterExtrinsic(long handle, long otherHandle, Extrinsic extrinsic)


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