@simba-dev/react-native-media-player 3.4.1 → 3.5.0
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/CHANGELOG.md +20 -0
- package/android/src/main/cpp/event.cpp +11 -122
- package/android/src/main/cpp/main.cpp +185 -141
- package/android/src/main/cpp/native_state.cpp +271 -25
- package/android/src/main/cpp/native_state.h +39 -0
- package/android/src/main/cpp/property.cpp +14 -75
- package/android/src/main/java/com/simba/player/mpv/MPVLib.kt +25 -0
- package/android/src/main/java/com/simba/player/mpv/MpvBridgeModule.kt +64 -2
- package/package.json +1 -1
- package/src/bridge/MpvPlayerModule.ts +25 -0
- package/src/bridge/NativeMpvPlayer.ts +4 -0
|
@@ -603,6 +603,24 @@ export interface MpvPlayerModuleBridge {
|
|
|
603
603
|
setDebugLogging(enabled: boolean): void;
|
|
604
604
|
/** Dump all observed mpv properties to logcat. Returns the count. */
|
|
605
605
|
dumpObservedProperties(): number;
|
|
606
|
+
|
|
607
|
+
// ── Hardware-adaptive performance tuning (v3.5.0) ──────────────────────
|
|
608
|
+
/**
|
|
609
|
+
* Switch the native libmpv GPU/scaler/cache tier at runtime:
|
|
610
|
+
* `'auto' | 'low' | 'mid' | 'high' | 'battery-saver' | 'balanced' | 'high-quality'`.
|
|
611
|
+
*/
|
|
612
|
+
setPerformanceProfile(
|
|
613
|
+
profile:
|
|
614
|
+
| 'auto'
|
|
615
|
+
| 'low'
|
|
616
|
+
| 'mid'
|
|
617
|
+
| 'high'
|
|
618
|
+
| 'battery-saver'
|
|
619
|
+
| 'balanced'
|
|
620
|
+
| 'high-quality',
|
|
621
|
+
): void;
|
|
622
|
+
/** Return the active C++ hardware profile as a JSON string. */
|
|
623
|
+
getHardwareProfile(): string;
|
|
606
624
|
}
|
|
607
625
|
|
|
608
626
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -847,6 +865,13 @@ const NOOP_BRIDGE: MpvPlayerModuleBridge = {
|
|
|
847
865
|
void _enabled;
|
|
848
866
|
},
|
|
849
867
|
dumpObservedProperties: () => 0,
|
|
868
|
+
|
|
869
|
+
// Hardware-adaptive performance tuning
|
|
870
|
+
setPerformanceProfile: (_profile: string) => {
|
|
871
|
+
void _profile;
|
|
872
|
+
},
|
|
873
|
+
getHardwareProfile: () =>
|
|
874
|
+
'{"tier":"mid","totalRamMb":0,"cpuCores":0,"screenWidthPx":0,"screenHeightPx":0,"glEsMajor":3,"isLowRam":false}',
|
|
850
875
|
};
|
|
851
876
|
|
|
852
877
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -367,6 +367,10 @@ export interface Spec extends TurboModule {
|
|
|
367
367
|
setDebugLogging(enabled: boolean): void;
|
|
368
368
|
dumpObservedProperties(): number;
|
|
369
369
|
|
|
370
|
+
// ── Hardware-adaptive performance tuning (v3.5.0) ──────────────────────
|
|
371
|
+
setPerformanceProfile(profile: string): void;
|
|
372
|
+
getHardwareProfile(): string;
|
|
373
|
+
|
|
370
374
|
// ── Event emitter plumbing (React Native's NativeEventEmitter) ─────────
|
|
371
375
|
//
|
|
372
376
|
// React Native's `NativeEventEmitter` REQUIRES the native module to
|