Skip to content

Commit a3d99dd

Browse files
authored
Merge pull request #5 from orbbec/develop
Develop
2 parents 13401f6 + 52ed2e2 commit a3d99dd

File tree

143 files changed

+13656
-2868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+13656
-2868
lines changed

README.md

+43-53
Original file line numberDiff line numberDiff line change
@@ -91,26 +91,30 @@ targetSdk 27
9191
**targetSdkVersion** 27 to fixed bug 'Android 10 Devices Do NOT Support USB Camera Connection' which fixed on android 11.
9292

9393
# Support orbbec device
94-
OrbbecSDK:v1.8.1
95-
Publish: 2023-11-16
94+
OrbbecSDK:v1.10.3
95+
Publish: 2024-11-08
9696
Support device list (firmware version):
9797
| SDK version | Product | Firmware version |
9898
| --- | --- | --- |
99-
| v1.8.1 | Gemini 2 XL | Obox: V1.2.5 VL:1.4.54 |
100-
| | Astra 2 | 2.8.20 |
101-
| | Gemini 2 L | 1.4.32 |
102-
| | Gemini 2 | 1.4.60 /1.4.76 |
103-
| | Astra+ | 1.0.22/1.0.21/1.0.20/1.0.19 |
104-
| | Femto | 1.6.7 |
105-
| | Femto W | 1.1.8 |
106-
| | DaBai | 2436 |
107-
| | DaBai DCW | 2460 |
108-
| | DaBai DW | 2606 |
109-
| | Astra Mini Pro | 1007 |
110-
| | Gemini E | 3460 |
111-
| | Gemini E Lite | 3606 |
112-
| | Gemini | 3.0.18 |
113-
| | Astra Mini S Pro | 1.0.05 |
99+
| v1.10.3 | Gemini 335 | 1.2.20 |
100+
| | Gemini 335L | 1.2.20 |
101+
| | Gemini 336 | 1.2.20 |
102+
| | Gemini 336L | 1.2.20 |
103+
| | Gemini 2 XL | Obox: V1.2.5 VL:1.4.54 |
104+
| | Astra 2 | 2.8.20 |
105+
| | Gemini 2 L | 1.4.32 |
106+
| | Gemini 2 | 1.4.60 /1.4.76 |
107+
| | Astra+ | 1.0.22/1.0.21/1.0.20/1.0.19 |
108+
| | Femto | 1.6.7 |
109+
| | Femto W | 1.1.8 |
110+
| | DaBai | 2436 |
111+
| | DaBai DCW | 2460 |
112+
| | DaBai DW | 2606 |
113+
| | Astra Mini Pro | 1007 |
114+
| | Gemini E | 3460 |
115+
| | Gemini E Lite | 3606 |
116+
| | Gemini | 3.0.18 |
117+
| | Astra Mini S Pro | 1.0.05 |
114118

115119
# Simple code of open depth stream
116120
Create OBContext global member to manager attach devices
@@ -127,52 +131,38 @@ Initialize OBContext with DeviceChangedCallback
127131
mOBContext = new OBContext(getApplicationContext(), new DeviceChangedCallback() {
128132
@Override
129133
public void onDeviceAttach(DeviceList deviceList) {
130-
synchronized (mCurrentDeviceLock) {
131-
if (null == mCurrentDevice) {
132-
// DeviceList#getDevice(index) can only call once inside onDeviceAttach()
133-
mCurrentDevice = deviceList.getDevice(0);
134-
mCurrentDeviceInfo = mCurrentDevice.getInfo();
135-
Log.d("Orbbec", "Device connection. name: " + mCurrentDeviceInfo.getName() + ", uid: " + mCurrentDeviceInfo.getUid());
136-
}
137-
}
138-
try {
134+
try {
135+
mDevice = deviceList.getDevice(0);
139136
deviceList.close();
140-
} catch (Exception e) {
137+
// do something
138+
mDevice.close();
139+
} catch (Exception e) {
141140
e.printStackTrace();
142-
}
141+
}
143142
}
144143

145144
@Override
146145
public void onDeviceDetach(DeviceList deviceList) {
147146
try {
148-
int deviceCount = deviceList.getDeviceCount();
149-
for (int i = 0; i < deviceCount; i++) {
150-
String uid = deviceList.getUid();
151-
if (null != mCurrentDevice) {
152-
synchronized (mCurrentDeviceLock) {
153-
if (null != mCurrentDeviceInfo && mCurrentDeviceInfo.getUid().equals(uid)) {
154-
// handle device disconnection
155-
// do something
156-
157-
Log.d("Orbbec", "Device disconnection. name: " + mCurrentDeviceInfo.getName() + ", uid: " + mCurrentDeviceInfo.getUid());
158-
mCurrentDevice.close();
159-
mCurrentDevice = null;
160-
161-
mCurrentDeviceInfo.close();
162-
mCurrentDeviceInfo null;
163-
}
164-
} // synchronized
165-
}
166-
} // for
147+
if (null != mCurrentDevice){
148+
int deviceCount=deviceList.getDeviceCount();
149+
for(int i=0;i<deviceCount; i++){
150+
String uid=deviceList.getUid();
151+
if(null!=mCurrentDeviceInfo&&mCurrentDeviceInfo.getUid().equals(uid)){
152+
// handle device disconnection
153+
// do something
154+
155+
Log.d("Orbbec","Device disconnection. name: "+mCurrentDeviceInfo.getName()+", uid: "+mCurrentDeviceInfo.getUid());
156+
mCurrentDevice.close();
157+
mCurrentDevice=null;
158+
}
159+
}
160+
}
167161
} catch (Exception e) {
168162
e.printStackTrace();
169-
}
170-
171-
try {
163+
} finally {
172164
deviceList.close();
173-
} catch (Exception e) {
174-
e.printStackTrace();
175-
}
165+
}
176166
}
177167
});
178168
```
1.03 MB
Loading
38 KB
Loading
1.18 MB
Loading
-5.51 KB
Loading

doc/readme-images/run-example.png

-156 KB
Binary file not shown.

example/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ android {
2020
def dataFormat = format.format(new Date())
2121
dataFormat+="01"//01是当天得第几版。默认是第一版
2222
versionCode Integer.parseInt(project.hasProperty('JENKINS_BUILD_VERSION_CODE')?JENKINS_BUILD_VERSION_CODE:dataFormat)
23-
versionName project.hasProperty('JENKINS_BUILD_VERSION_NAME') ? JENKINS_BUILD_VERSION_NAME : "1.8.1"
23+
versionName project.hasProperty('JENKINS_BUILD_VERSION_NAME') ? JENKINS_BUILD_VERSION_NAME : "1.10.3"
2424

2525
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2626
externalNativeBuild {

example/src/main/AndroidManifest.xml

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
<uses-permission android:name="android.permission.CAMERA" />
99
<uses-permission android:name="android.permission.INTERNET" />
1010
<uses-feature android:name="android.hardware.usb.host" />
11-
<uses-feature
12-
android:name="android.hardware.camera"
13-
android:required="false" />
1411

1512
<application
1613
android:name=".application.MyApplication"
@@ -34,6 +31,11 @@
3431
<activity android:name=".activity.ImuActivity" />
3532
<activity android:name=".activity.DepthModeActivity" />
3633
<activity android:name=".activity.MultiDeviceActivity" />
34+
<activity android:name=".activity.AlignFilterViewerActivity" />
35+
<activity android:name=".activity.HdrMergeActivity" />
36+
<activity android:name=".activity.PostProcessingActivity" />
37+
<activity android:name=".activity.MultiStreamActivity" />
38+
<activity android:name=".activity.FirmwareUpgradeActivity" />
3739
<activity android:name=".activity.MainActivity">
3840
<intent-filter>
3941
<action android:name="android.intent.action.MAIN" />

example/src/main/cpp/orbbecsdkexamples.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ uint8_t *depthAlignToColor(uint8_t *colorData, uint8_t *depthData, int colorW, i
371371
rgbPixel++;
372372
}
373373
}
374-
rgbPixel = colorData;
374+
// rgbPixel = colorData;
375375

376-
return rgbPixel;
376+
return colorData;
377377
}
378378

379379
void uyvyToRgb(uint8_t *src, uint8_t *dst, int width, int height) {

0 commit comments

Comments
 (0)