示例#1
0
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2GetStreamProfileCount
  (JNIEnv *env, jclass, jlong streamProfileListAddr) {
    rs2_error *error = NULL;

    rs2_stream_profile_list* streamProfileList = (rs2_stream_profile_list*) streamProfileListAddr;
    int count = rs2_get_stream_profiles_count(streamProfileList, &error);
    checkErrors(env, error);
    return (jint)count;
}
示例#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;
        }