@bits-innovate/react-native-vstarcam 1.0.39 → 1.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,7 +80,6 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
80
80
  put("ACAE", "EEGDFHBLKGJIGEJLEKGOFMEDHAMHHJNAGGFABMCOBGJOLHLJDFAFCPPHGILKIKLMANNHKEDKOINIBNCPJOMK:vstarcam2018"); // Try VSTH params
81
81
  put("ACDG", "EEGDFHBLKGJIGEJLEKGOFMEDHAMHHJNAGGFABMCOBGJOLHLJDFAFCPPHGILKIKLMANNHKEDKOINIBNCPJOMK:vstarcam2018"); // Same as ACAE/VSTH
82
82
  put("ACAQ", "EEGDFHBLKGJIGEJLEKGOFMEDHAMHHJNAGGFABMCOBGJOLHLJDFAFCPPHGILKIKLMANNHKEDKOINIBNCPJOMK:vstarcam2018"); // Same as ACAE/VSTH
83
- put("ACAG", "EEGDFHBLKGJIGEJLEKGOFMEDHAMHHJNAGGFABMCOBGJOLHLJDFAFCPPHGILKIKLMANNHKEDKOINIBNCPJOMK:vstarcam2018"); // Same as ACAE/VSTH
84
83
  // Fallback for unknown prefixes
85
84
  put("DEFAULT", "EBGBEMBMKGJMGAJPEIGIFKEGHBMCHMNFGKEGBFCBBMJELILDCJADCIOLHHLLJBKEAMMBLCDGONMDBJCJJPNFJP");
86
85
  }};
@@ -155,7 +154,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
155
154
 
156
155
  // Client tracking - maps our clientPtr to actual SDK client handle
157
156
  // Made static so VStarCamVideoView can access SDK pointers
158
- private static Map<Integer, ClientInfo> clients = new java.util.concurrent.ConcurrentHashMap<>();
157
+ private static Map<Integer, ClientInfo> clients = new HashMap<>();
159
158
  private boolean isNativeLibraryLoaded = false;
160
159
  private boolean isP2PInitialized = false;
161
160
 
@@ -461,8 +460,8 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
461
460
  return;
462
461
  }
463
462
 
464
- // Generate a unique internal client ID
465
- int ourClientPtr = nextClientPtr.getAndIncrement();
463
+ // Generate our own client ID (hash of deviceId) and store mapping
464
+ int ourClientPtr = Math.abs(deviceId.hashCode());
466
465
 
467
466
  ClientInfo clientInfo = new ClientInfo();
468
467
  clientInfo.deviceId = deviceId;
@@ -866,6 +865,10 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
866
865
  } catch (Exception e) {
867
866
  Log.e(TAG, "checkMode JNI call failed", e);
868
867
  }
868
+ } else {
869
+ Log.w(TAG, "checkMode skipped: clientInfo=" + clientInfo +
870
+ ", jniApiClass=" + (jniApiClass != null) +
871
+ ", sdkPtr=" + (clientInfo != null ? clientInfo.sdkClientPtr : "null"));
869
872
  }
870
873
 
871
874
  // Mode > 0 means connected (1=P2P, 2=Relay, 3=Socket)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",