diff --git a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/device_impl.cpp b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/device_impl.cpp index d0c4150..3a573b0 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/device_impl.cpp +++ b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/device_impl.cpp @@ -13,6 +13,7 @@ #include "stream_data_impl.hpp" #include "mynteye/uvc/uvc.h" +#include "mynteye/util/strings.h" #include "internal/uvc_device.h" MYNTEYE_USE_NAMESPACE @@ -58,6 +59,14 @@ std::shared_ptr Device::Create(const ::mynteye_jni::DeviceUsbInfo & info auto pid = uvc::get_product_id(*device); VLOG(2) << "UVC device detected, name: " << name << ", vid: 0x" << std::hex << vid << ", pid: 0x" << std::hex << pid; + if (strings::starts_with(name, "MYNT-EYE-")) { + std::string model_s = name.substr(9, 5); + if (strings::starts_with(model_s, "S1")) { + uvc::set_bytes_per_packet(device, 0x4000); + } else if (strings::starts_with(model_s, "S2")) { + uvc::set_bytes_per_packet(device, 0x5400); + } + } return std::make_shared( MYNTEYE_NAMESPACE::Device::Create(name, device)); } diff --git a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/internal/uvc_device.h b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/internal/uvc_device.h index 0e5b9ed..120a087 100644 --- a/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/internal/uvc_device.h +++ b/wrappers/android/mynteye/libmynteye/src/main/cpp/mynteye/impl/internal/uvc_device.h @@ -9,6 +9,7 @@ namespace uvc { struct device; MYNTEYE_API std::shared_ptr create_device(UsbInfo info); +MYNTEYE_API void set_bytes_per_packet(std::shared_ptr, int bytes); } // namespace uvc diff --git a/wrappers/android/mynteye/libmynteye/src/main/jniLibs/arm64-v8a/libmynteye_internal.so b/wrappers/android/mynteye/libmynteye/src/main/jniLibs/arm64-v8a/libmynteye_internal.so index f08ea76..a6aeb48 100755 Binary files a/wrappers/android/mynteye/libmynteye/src/main/jniLibs/arm64-v8a/libmynteye_internal.so and b/wrappers/android/mynteye/libmynteye/src/main/jniLibs/arm64-v8a/libmynteye_internal.so differ diff --git a/wrappers/android/mynteye/libmynteye/src/main/jniLibs/armeabi-v7a/libmynteye_internal.so b/wrappers/android/mynteye/libmynteye/src/main/jniLibs/armeabi-v7a/libmynteye_internal.so index 9dbcabf..60899ca 100755 Binary files a/wrappers/android/mynteye/libmynteye/src/main/jniLibs/armeabi-v7a/libmynteye_internal.so and b/wrappers/android/mynteye/libmynteye/src/main/jniLibs/armeabi-v7a/libmynteye_internal.so differ