Пример #1
0
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2GetStreamProfile
  (JNIEnv *env, jclass, jlong streamProfileListAddr, jint index) {
    rs2_error *error = NULL;

    rs2_stream_profile_list* streamProfileList = (rs2_stream_profile_list*) streamProfileListAddr;
    const rs2_stream_profile* streamProfile = rs2_get_stream_profile(streamProfileList, index, &error);

    checkErrors(env, error);
    return (jlong) streamProfile;
}
Пример #2
0
        /**
        * Return the selected streams profiles, which are enabled in this profile.
        *
        * \return   Vector of stream profiles
        */
        std::vector<stream_profile> get_streams() const
        {
            std::vector<stream_profile> results;

            rs2_error* e = nullptr;
            std::shared_ptr<rs2_stream_profile_list> list(
                rs2_pipeline_profile_get_streams(_pipeline_profile.get(), &e),
                rs2_delete_stream_profiles_list);
            error::handle(e);

            auto size = rs2_get_stream_profiles_count(list.get(), &e);
            error::handle(e);

            for (auto i = 0; i < size; i++)
            {
                stream_profile profile(rs2_get_stream_profile(list.get(), i, &e));
                error::handle(e);
                results.push_back(profile);
            }

            return results;
        }