react-native-webrtc 118.0.1 → 118.0.3
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/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +17 -3
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +4344 -141
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merged.dir/values/values.xml +9 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +4 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/AbstractVideoCaptureController$CapturerEventsListener.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/AbstractVideoCaptureController.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/CameraCaptureController$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/CameraCaptureController$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/CameraCaptureController.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/CameraEventsHandler.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/DataChannelWrapper$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/DataChannelWrapper.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/DisplayUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/EglUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/GetUserMediaImpl$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/GetUserMediaImpl$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/GetUserMediaImpl$BiConsumer.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/GetUserMediaImpl$TrackPrivate.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/GetUserMediaImpl.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/LibraryLoader.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/MediaProjectionNotification.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/MediaProjectionService.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/PeerConnectionObserver$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/PeerConnectionObserver.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/RTCVideoViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ReactBridgeUtil$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ReactBridgeUtil.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ScreenCaptureController$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ScreenCaptureController$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ScreenCaptureController.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/SerializeUtils$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/SerializeUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/StringUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/ThreadUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/TrackCapturerEventsEmitter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/UVCCamera2Enumerator.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/UVCVideoCapturer$PreviewDataCallback.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/UVCVideoCapturer.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/VideoTrackAdapter$TrackMuteUnmuteImpl$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/VideoTrackAdapter$TrackMuteUnmuteImpl.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/VideoTrackAdapter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$5.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule$6.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModuleOptions.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCModulePackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCView$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCView$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/WebRTCView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/videoEffects/ProcessorProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/videoEffects/VideoFrameProcessor.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/videoEffects/VideoFrameProcessorFactoryInterface.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/webrtcutils/H264AndSoftwareVideoDecoderFactory.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/webrtcutils/H264AndSoftwareVideoEncoderFactory.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/webrtcutils/SoftwareVideoDecoderFactoryProxy.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/oney/WebRTCModule/webrtcutils/SoftwareVideoEncoderFactoryProxy.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +33 -8
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +17 -3
- package/android/build/intermediates/packaged_res/debug/values/values.xml +4 -1
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +2976 -10
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +29 -3
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/src/main/AndroidManifest.xml +8 -0
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +6 -3
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionNotification.java +78 -0
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java +84 -0
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +25 -133
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +14 -1
- package/android/src/main/java/com/oney/WebRTCModule/UVCCamera2Enumerator.java +122 -111
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +5 -4
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModuleOptions.java +1 -0
- package/android/src/main/res/values/strings.xml +5 -0
- package/package.json +1 -1
|
@@ -1,111 +1,122 @@
|
|
|
1
|
-
package com.oney.WebRTCModule;
|
|
2
|
-
|
|
3
|
-
import android.content.Context;
|
|
4
|
-
import android.
|
|
5
|
-
import android.
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import org.webrtc.
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
import java.util.
|
|
19
|
-
import java.util.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
package com.oney.WebRTCModule;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.content.pm.PackageManager;
|
|
5
|
+
import android.hardware.usb.UsbDevice;
|
|
6
|
+
import android.os.Build;
|
|
7
|
+
import android.util.Log;
|
|
8
|
+
|
|
9
|
+
import androidx.annotation.Nullable;
|
|
10
|
+
|
|
11
|
+
import com.jiangdg.ausbc.camera.CameraUvcStrategy;
|
|
12
|
+
import com.jiangdg.ausbc.camera.bean.PreviewSize;
|
|
13
|
+
|
|
14
|
+
import org.webrtc.Camera2Enumerator;
|
|
15
|
+
import org.webrtc.CameraEnumerationAndroid;
|
|
16
|
+
import org.webrtc.CameraVideoCapturer;
|
|
17
|
+
|
|
18
|
+
import java.util.ArrayList;
|
|
19
|
+
import java.util.Arrays;
|
|
20
|
+
import java.util.List;
|
|
21
|
+
import java.util.stream.Collectors;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Camera2Enumerator with UVC Camera support.
|
|
25
|
+
* <p/>
|
|
26
|
+
* This implementation only adds support for UVC camera devices.
|
|
27
|
+
* Ie. Device's (back and/or front) cameras will use the basic implementation of {@link Camera2Enumerator}.
|
|
28
|
+
*/
|
|
29
|
+
public class UVCCamera2Enumerator extends Camera2Enumerator {
|
|
30
|
+
/**
|
|
31
|
+
* UVC camera names will be prefix with this value. Currently, there is no other way to
|
|
32
|
+
* easily distinguish between device's own and external uvc cameras in JS-side.
|
|
33
|
+
*/
|
|
34
|
+
public static final String UVC_PREFIX = "uvc-camera:";
|
|
35
|
+
private final Context context;
|
|
36
|
+
|
|
37
|
+
public UVCCamera2Enumerator(Context context) {
|
|
38
|
+
super(context);
|
|
39
|
+
this.context = context;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public static boolean isSupported(Context context) {
|
|
43
|
+
// Disable for Android 14 because of: https://github.com/jiangdongguo/AndroidUSBCamera/pull/647
|
|
44
|
+
if (Build.VERSION.SDK_INT < 34) {
|
|
45
|
+
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_USB_HOST);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@Override
|
|
52
|
+
public String[] getDeviceNames() {
|
|
53
|
+
ArrayList<String> devicesNames = new ArrayList<>(Arrays.asList(super.getDeviceNames()));
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
CameraUvcStrategy uvcStrategy = new CameraUvcStrategy(context);
|
|
57
|
+
List<UsbDevice> uvcCameras = uvcStrategy.getUsbDeviceList(null); // null := no filtering
|
|
58
|
+
if (uvcCameras != null) {
|
|
59
|
+
uvcCameras.forEach(camera -> devicesNames.add(UVC_PREFIX + camera.getDeviceName()));
|
|
60
|
+
}
|
|
61
|
+
uvcStrategy.unRegister();
|
|
62
|
+
} catch (Exception e) {
|
|
63
|
+
Log.e(WebRTCModule.TAG, "Error in uvc camera enumeration", e);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return devicesNames.toArray(new String[0]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
public boolean isFrontFacing(String deviceName) {
|
|
71
|
+
if (isUvcCamera(deviceName)) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return super.isFrontFacing(deviceName);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public boolean isBackFacing(String deviceName) {
|
|
79
|
+
if (isUvcCamera(deviceName)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return super.isBackFacing(deviceName);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@Nullable
|
|
87
|
+
public List<CameraEnumerationAndroid.CaptureFormat> getSupportedFormats(String deviceName) {
|
|
88
|
+
if (isUvcCamera(deviceName)) {
|
|
89
|
+
CameraUvcStrategy cameraUvcStrategy = new CameraUvcStrategy(this.context);
|
|
90
|
+
List<PreviewSize> sizes =
|
|
91
|
+
cameraUvcStrategy.getAllPreviewSizes(null); // null := Ask all sizes for all aspect ratios.
|
|
92
|
+
cameraUvcStrategy.unRegister();
|
|
93
|
+
if (sizes == null) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
int minFps = 1;
|
|
98
|
+
int maxFps = 30;
|
|
99
|
+
return sizes.stream()
|
|
100
|
+
.map(size
|
|
101
|
+
-> new CameraEnumerationAndroid.CaptureFormat(
|
|
102
|
+
size.getWidth(), size.getHeight(), minFps, maxFps))
|
|
103
|
+
.collect(Collectors.toList());
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return super.getSupportedFormats(deviceName);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@Override
|
|
110
|
+
public CameraVideoCapturer createCapturer(
|
|
111
|
+
String cameraName, CameraVideoCapturer.CameraEventsHandler eventsHandler) {
|
|
112
|
+
if (isUvcCamera(cameraName)) {
|
|
113
|
+
return new UVCVideoCapturer();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return super.createCapturer(cameraName, eventsHandler);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public static boolean isUvcCamera(String deviceName) {
|
|
120
|
+
return deviceName != null && deviceName.startsWith(UVC_PREFIX);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -1244,22 +1244,23 @@ public class WebRTCModule extends ReactContextBaseJavaModule {
|
|
|
1244
1244
|
ThreadUtils.runOnExecutor(() -> {
|
|
1245
1245
|
PeerConnectionObserver pco = mPeerConnectionObservers.get(pcId);
|
|
1246
1246
|
if (pco == null || pco.getPeerConnection() == null) {
|
|
1247
|
-
Log.d(TAG, "
|
|
1247
|
+
Log.d(TAG, "receiverGetStats() peerConnection is null");
|
|
1248
1248
|
promise.reject(new Exception("PeerConnection ID not found"));
|
|
1249
1249
|
} else {
|
|
1250
|
-
pco.
|
|
1250
|
+
pco.receiverGetStats(receiverId, promise);
|
|
1251
1251
|
}
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
|
+
|
|
1254
1255
|
@ReactMethod
|
|
1255
1256
|
public void senderGetStats(int pcId, String senderId, Promise promise) {
|
|
1256
1257
|
ThreadUtils.runOnExecutor(() -> {
|
|
1257
1258
|
PeerConnectionObserver pco = mPeerConnectionObservers.get(pcId);
|
|
1258
1259
|
if (pco == null || pco.getPeerConnection() == null) {
|
|
1259
|
-
Log.d(TAG, "
|
|
1260
|
+
Log.d(TAG, "senderGetStats() peerConnection is null");
|
|
1260
1261
|
promise.reject(new Exception("PeerConnection ID not found"));
|
|
1261
1262
|
} else {
|
|
1262
|
-
pco.
|
|
1263
|
+
pco.senderGetStats(senderId, promise);
|
|
1263
1264
|
}
|
|
1264
1265
|
});
|
|
1265
1266
|
}
|
|
@@ -15,6 +15,7 @@ public class WebRTCModuleOptions {
|
|
|
15
15
|
public Loggable injectableLogger;
|
|
16
16
|
public Logging.Severity loggingSeverity;
|
|
17
17
|
public String fieldTrials;
|
|
18
|
+
public boolean enableMediaProjectionService;
|
|
18
19
|
|
|
19
20
|
public static WebRTCModuleOptions getInstance() {
|
|
20
21
|
if (instance == null) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<resources>
|
|
2
|
+
<string name="media_projection_notification_title">Screen sharing</string>
|
|
3
|
+
<string name="media_projection_notification_text">You are currently sharing your screen.</string>
|
|
4
|
+
<string name="ongoing_notification_channel_name">Screen Sharing Notifications</string>
|
|
5
|
+
</resources>
|