Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close API fixed - openSensor with multiple profiles API added #9320

Conversation

remibettan
Copy link
Contributor

Tracked by: LRS-132
Using Sensor example, we get (using the new API for getting both depth and infrared profiles from depth sensor):
image

@remibettan remibettan requested review from Nir-Az and ev-mp June 30, 2021 09:44
Copy link
Contributor Author

@remibettan remibettan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes to be done

if (depth_sensor != null) {
List<StreamProfile> sps = depth_sensor.getStreamProfiles();
StreamProfile sp = sps.get(0);
StreamProfile depth_profile = sps.get(0);
StreamProfile ir_profile = sps.get(0);

for (StreamProfile sp2 : sps) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sp2 - change to stream_profile
sps - change to stream_profiles

@@ -203,14 +210,40 @@ private void configAndStart() throws Exception {
if (w == 640 && fps == 30 && (sf.compareTo(StreamFormat.Z16) == 0)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check also height (for both profiles)

Log.d(TAG, "ir stream: " + index + ":" + st.name() + ":" + sf.name() + ":" + w + "x" + h + "@" + fps + "HZ");

ir_profile = sp2;
ir_profile_found = true;
}
}
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add exception if profiles were not found - or if only one was found, play only this one, and add a toast message on the missing profile

Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

JNIEXPORT void JNICALL
Java_com_intel_realsense_librealsense_Sensor_nOpenMultiple(JNIEnv *env, jclass type, jlong device_handle,
jlongArray profiles_handle, int num_of_profiles) {
// retreiving profiles from array
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - retrieving

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@remibettan remibettan force-pushed the android-sensor-api-multiple-profiles branch from ffd33ae to 07230d5 Compare July 4, 2021 08:17
Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ev-mp ev-mp merged commit 02a3fec into IntelRealSense:development Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants