@aguacerowx/react-native 0.0.51 → 0.0.53
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.
- package/android/src/main/cpp/satellite_ktx_jni.cpp +6 -1
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayer.java +121 -1
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayerView.java +556 -384
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +315 -311
- package/ios/SatelliteLayerView.swift +517 -510
- package/ios/WeatherFrameProcessorModule.swift +222 -219
- package/lib/commonjs/WeatherLayerManager.js +82 -46
- package/lib/commonjs/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/aguaceroRnDebug.js +9 -1
- package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
- package/lib/commonjs/gridCdnAuth.js +64 -0
- package/lib/commonjs/gridCdnAuth.js.map +1 -0
- package/lib/commonjs/index.js +50 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nexrad/nexradAndroidController.js +25 -25
- package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/commonjs/nexrad/nexradDiag.js +24 -24
- package/lib/commonjs/satellite/satelliteAndroidController.js +32 -24
- package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/commonjs/satelliteRnDebug.js +261 -0
- package/lib/commonjs/satelliteRnDebug.js.map +1 -0
- package/lib/module/WeatherLayerManager.js +82 -46
- package/lib/module/WeatherLayerManager.js.map +1 -1
- package/lib/module/aguaceroRnDebug.js +9 -1
- package/lib/module/aguaceroRnDebug.js.map +1 -1
- package/lib/module/gridCdnAuth.js +56 -0
- package/lib/module/gridCdnAuth.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nexrad/nexradAndroidController.js +25 -25
- package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/module/nexrad/nexradDiag.js +24 -24
- package/lib/module/satellite/satelliteAndroidController.js +32 -24
- package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/module/satelliteRnDebug.js +248 -0
- package/lib/module/satelliteRnDebug.js.map +1 -0
- package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
- package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
- package/lib/typescript/gridCdnAuth.d.ts +24 -0
- package/lib/typescript/gridCdnAuth.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
- package/lib/typescript/satelliteRnDebug.d.ts +81 -0
- package/lib/typescript/satelliteRnDebug.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/WeatherLayerManager.js +2044 -2004
- package/src/aguaceroRnDebug.js +9 -1
- package/src/gridCdnAuth.js +56 -0
- package/src/index.js +27 -15
- package/src/nexrad/nexradAndroidController.js +1078 -1078
- package/src/nexrad/nexradDiag.js +150 -150
- package/src/satellite/satelliteAndroidController.js +257 -245
- package/src/satelliteRnDebug.js +269 -0
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
#define LOG_TAG "AguaceroSatKtx"
|
|
10
10
|
#define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
|
|
11
|
+
#define ALOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
|
|
11
12
|
|
|
12
13
|
namespace {
|
|
13
14
|
|
|
@@ -104,10 +105,13 @@ Java_com_aguacerowx_reactnative_SatelliteKtxDecoder_nativeTranscodeKtx2(
|
|
|
104
105
|
std::vector<uint8_t> out_pixels;
|
|
105
106
|
basist::transcoder_texture_format used_fmt = basist::transcoder_texture_format::cTFTotalTextureFormats;
|
|
106
107
|
|
|
108
|
+
// Android: prefer ETC2 (GLES 3.0 baseline), then uncompressed RGBA32, then ASTC last.
|
|
109
|
+
// CPU-side ASTC transcode can succeed while Mapbox's GL context cannot sample it → black tiles.
|
|
110
|
+
// Web (satelliteKtxWorker.js) probes WebGL extensions before picking ASTC; match that intent here.
|
|
107
111
|
static const basist::transcoder_texture_format k_try_order[] = {
|
|
108
|
-
basist::transcoder_texture_format::cTFASTC_LDR_4x4_RGBA,
|
|
109
112
|
basist::transcoder_texture_format::cTFETC2_RGBA,
|
|
110
113
|
basist::transcoder_texture_format::cTFRGBA32,
|
|
114
|
+
basist::transcoder_texture_format::cTFASTC_LDR_4x4_RGBA,
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
bool ok = false;
|
|
@@ -131,6 +135,7 @@ Java_com_aguacerowx_reactnative_SatelliteKtxDecoder_nativeTranscodeKtx2(
|
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
const int32_t fmt_ordinal = static_cast<int32_t>(used_fmt);
|
|
138
|
+
ALOGI("KTX2 transcoded %ux%u to format ordinal %d", width, height, fmt_ordinal);
|
|
134
139
|
|
|
135
140
|
const uint32_t header_size = 20;
|
|
136
141
|
const uint32_t payload_size = static_cast<uint32_t>(out_pixels.size());
|
|
@@ -26,11 +26,46 @@ import java.util.Map;
|
|
|
26
26
|
public class SatelliteLayer implements CustomLayerHost {
|
|
27
27
|
|
|
28
28
|
private static final String TAG = "AguaceroSatellite";
|
|
29
|
+
/** Matches Metro filter {@code [AguaceroRN][satellite]} when debug is on. */
|
|
30
|
+
private static final String DIAG_TAG = "AguaceroRN";
|
|
29
31
|
private static final int MAX_GPU_CACHED_FRAMES = 64;
|
|
30
32
|
|
|
33
|
+
private static volatile boolean debugLogging = false;
|
|
34
|
+
private int debugRenderTick = 0;
|
|
35
|
+
|
|
31
36
|
private static final int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
|
|
32
37
|
private static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
|
|
33
38
|
|
|
39
|
+
public static void setDebugLogging(boolean enabled) {
|
|
40
|
+
debugLogging = enabled;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private static void diag(String msg) {
|
|
44
|
+
if (debugLogging) {
|
|
45
|
+
android.util.Log.w(DIAG_TAG, "[satellite.native] " + msg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private static String basisFormatName(int fmt) {
|
|
50
|
+
if (fmt == SatelliteKtxDecoder.TF_ETC2_RGBA) return "ETC2_RGBA";
|
|
51
|
+
if (fmt == SatelliteKtxDecoder.TF_ASTC_LDR_4x4_RGBA) return "ASTC_LDR_4x4";
|
|
52
|
+
if (fmt == SatelliteKtxDecoder.TF_RGBA32) return "RGBA32";
|
|
53
|
+
return "ordinal_" + fmt;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Snapshot for debug events (thread-safe). */
|
|
57
|
+
public void fillDebugSnapshot(@NonNull java.util.Map<String, Object> out) {
|
|
58
|
+
synchronized (lock) {
|
|
59
|
+
out.put("cachedFrameCount", cache.size());
|
|
60
|
+
out.put("pendingGpuUploads", pendingGpuQueue.size());
|
|
61
|
+
out.put("activeUnix", activeUnix);
|
|
62
|
+
out.put("targetUnix", targetUnix);
|
|
63
|
+
out.put("visible", visible);
|
|
64
|
+
out.put("opacity", opacity);
|
|
65
|
+
out.put("programReady", program != 0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
34
69
|
private final Object lock = new Object();
|
|
35
70
|
|
|
36
71
|
private int program;
|
|
@@ -197,6 +232,17 @@ public class SatelliteLayer implements CustomLayerHost {
|
|
|
197
232
|
defaultIrColormapTex = uploadColormapTexture(ir);
|
|
198
233
|
defaultWvColormapTex = uploadColormapTexture(wv);
|
|
199
234
|
userColormapTex = 0;
|
|
235
|
+
|
|
236
|
+
if (debugLogging) {
|
|
237
|
+
String ext = GLES20.glGetString(GLES20.GL_EXTENSIONS);
|
|
238
|
+
if (ext == null) ext = "";
|
|
239
|
+
diag(
|
|
240
|
+
"gl.extensions hasASTC="
|
|
241
|
+
+ ext.contains("ASTC")
|
|
242
|
+
+ " hasETC2="
|
|
243
|
+
+ (ext.contains("ETC2") || ext.contains("EAC"))
|
|
244
|
+
+ " (black geocolor tiles often mean ASTC upload on unsupported GPU)");
|
|
245
|
+
}
|
|
200
246
|
}
|
|
201
247
|
|
|
202
248
|
private int uploadColormapTexture(byte[] rgba) {
|
|
@@ -401,6 +447,51 @@ public class SatelliteLayer implements CustomLayerHost {
|
|
|
401
447
|
return null;
|
|
402
448
|
}
|
|
403
449
|
|
|
450
|
+
int glErr = GLES20.glGetError();
|
|
451
|
+
if (glErr != GLES20.GL_NO_ERROR) {
|
|
452
|
+
Log.w(
|
|
453
|
+
TAG,
|
|
454
|
+
"GPU texture upload failed (GL 0x"
|
|
455
|
+
+ Integer.toHexString(glErr)
|
|
456
|
+
+ ") fmt="
|
|
457
|
+
+ fmt
|
|
458
|
+
+ " "
|
|
459
|
+
+ w
|
|
460
|
+
+ "x"
|
|
461
|
+
+ h
|
|
462
|
+
+ " — device may not support this compressed format; rebuild SDK with latest KTX transcode order");
|
|
463
|
+
diag(
|
|
464
|
+
"gpu.upload.fail unix="
|
|
465
|
+
+ p.unix
|
|
466
|
+
+ " gl=0x"
|
|
467
|
+
+ Integer.toHexString(glErr)
|
|
468
|
+
+ " fmt="
|
|
469
|
+
+ basisFormatName(fmt)
|
|
470
|
+
+ " "
|
|
471
|
+
+ w
|
|
472
|
+
+ "x"
|
|
473
|
+
+ h
|
|
474
|
+
+ " trueColor="
|
|
475
|
+
+ p.trueColor);
|
|
476
|
+
GLES20.glDeleteTextures(1, texArr, 0);
|
|
477
|
+
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
diag(
|
|
482
|
+
"gpu.upload.ok unix="
|
|
483
|
+
+ p.unix
|
|
484
|
+
+ " fmt="
|
|
485
|
+
+ basisFormatName(fmt)
|
|
486
|
+
+ " "
|
|
487
|
+
+ w
|
|
488
|
+
+ "x"
|
|
489
|
+
+ h
|
|
490
|
+
+ " trueColor="
|
|
491
|
+
+ p.trueColor
|
|
492
|
+
+ " useColormap="
|
|
493
|
+
+ p.useColormap);
|
|
494
|
+
|
|
404
495
|
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
|
|
405
496
|
|
|
406
497
|
FloatBuffer vb = p.mesh.vertexBuffer;
|
|
@@ -459,7 +550,36 @@ public class SatelliteLayer implements CustomLayerHost {
|
|
|
459
550
|
synchronized (lock) {
|
|
460
551
|
draw = activeUnix != null ? cache.get(activeUnix) : null;
|
|
461
552
|
}
|
|
462
|
-
if (draw == null || draw.indexCount <= 0)
|
|
553
|
+
if (draw == null || draw.indexCount <= 0) {
|
|
554
|
+
if (debugLogging && ++debugRenderTick % 90 == 0) {
|
|
555
|
+
synchronized (lock) {
|
|
556
|
+
diag(
|
|
557
|
+
"render.noDraw targetUnix="
|
|
558
|
+
+ targetUnix
|
|
559
|
+
+ " activeUnix="
|
|
560
|
+
+ activeUnix
|
|
561
|
+
+ " cached="
|
|
562
|
+
+ cache.size()
|
|
563
|
+
+ " pendingUploads="
|
|
564
|
+
+ pendingGpuQueue.size()
|
|
565
|
+
+ " visible="
|
|
566
|
+
+ visible
|
|
567
|
+
+ " opacity="
|
|
568
|
+
+ opacity);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
if (debugLogging && debugRenderTick % 180 == 0) {
|
|
575
|
+
diag(
|
|
576
|
+
"render.drawing unix="
|
|
577
|
+
+ draw.unix
|
|
578
|
+
+ " trueColor="
|
|
579
|
+
+ draw.trueColor
|
|
580
|
+
+ " indexCount="
|
|
581
|
+
+ draw.indexCount);
|
|
582
|
+
}
|
|
463
583
|
|
|
464
584
|
GLES20.glUseProgram(program);
|
|
465
585
|
|