react-native-webrtc 106.0.5 → 106.0.7
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/.clang-format +11 -0
- package/LICENSE +2 -1
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +0 -1
- package/android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java +7 -15
- package/android/src/main/java/com/oney/WebRTCModule/CameraEventsHandler.java +3 -12
- package/android/src/main/java/com/oney/WebRTCModule/DataChannelWrapper.java +12 -16
- package/android/src/main/java/com/oney/WebRTCModule/DisplayUtils.java +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/EglUtils.java +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +29 -43
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +123 -116
- package/android/src/main/java/com/oney/WebRTCModule/RTCVideoViewManager.java +60 -61
- package/android/src/main/java/com/oney/WebRTCModule/ReactBridgeUtil.java +1 -2
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +11 -13
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +116 -119
- package/android/src/main/java/com/oney/WebRTCModule/StringUtils.java +8 -14
- package/android/src/main/java/com/oney/WebRTCModule/ThreadUtils.java +1 -2
- package/android/src/main/java/com/oney/WebRTCModule/TrackCapturerEventsEmitter.java +3 -4
- package/android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java +5 -9
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +335 -350
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModulePackage.java +4 -10
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +74 -98
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/ProcessorProvider.java +10 -9
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +2 -6
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoFrameProcessorFactoryInterface.java +4 -5
- package/ios/RCTWebRTC/CaptureController.h +2 -9
- package/ios/RCTWebRTC/CaptureController.m +0 -7
- package/ios/RCTWebRTC/DataChannelWrapper.h +9 -13
- package/ios/RCTWebRTC/DataChannelWrapper.m +4 -5
- package/ios/RCTWebRTC/RCTConvert+WebRTC.h +2 -2
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +166 -171
- package/ios/RCTWebRTC/RTCMediaStreamTrack+React.h +1 -1
- package/ios/RCTWebRTC/RTCMediaStreamTrack+React.m +1 -1
- package/ios/RCTWebRTC/RTCVideoViewManager.h +0 -8
- package/ios/RCTWebRTC/RTCVideoViewManager.m +205 -214
- package/ios/RCTWebRTC/ScreenCaptureController.h +2 -9
- package/ios/RCTWebRTC/ScreenCaptureController.m +10 -16
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.h +0 -7
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +26 -34
- package/ios/RCTWebRTC/ScreenCapturer.h +1 -8
- package/ios/RCTWebRTC/ScreenCapturer.m +56 -55
- package/ios/RCTWebRTC/SerializeUtils.h +16 -16
- package/ios/RCTWebRTC/SerializeUtils.m +98 -99
- package/ios/RCTWebRTC/SocketConnection.h +1 -8
- package/ios/RCTWebRTC/SocketConnection.m +31 -38
- package/ios/RCTWebRTC/TrackCapturerEventsEmitter.h +4 -4
- package/ios/RCTWebRTC/TrackCapturerEventsEmitter.m +5 -6
- package/ios/RCTWebRTC/VideoCaptureController.h +6 -7
- package/ios/RCTWebRTC/VideoCaptureController.m +54 -53
- package/ios/RCTWebRTC/WebRTCModule+Permissions.m +14 -13
- package/ios/RCTWebRTC/WebRTCModule+RTCDataChannel.h +3 -3
- package/ios/RCTWebRTC/WebRTCModule+RTCDataChannel.m +105 -100
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h +3 -2
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +196 -226
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h +7 -14
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +625 -603
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +128 -139
- package/ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.h +4 -5
- package/ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.m +26 -35
- package/ios/RCTWebRTC/WebRTCModule.h +13 -20
- package/ios/RCTWebRTC/WebRTCModule.m +69 -84
- package/ios/RCTWebRTC.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/RTCPeerConnection.js +79 -56
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +12 -3
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +79 -56
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +12 -3
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCRtpTransceiver.js +1 -1
- package/lib/module/RTCRtpTransceiver.js.map +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +4 -4
- package/package.json +3 -2
- package/src/RTCPeerConnection.ts +70 -63
- package/src/RTCRtpEncodingParameters.ts +12 -3
- package/src/RTCRtpTransceiver.ts +1 -1
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
package com.oney.WebRTCModule;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import java.util.ArrayList;
|
|
5
|
-
import java.util.HashMap;
|
|
6
|
-
import java.util.List;
|
|
7
|
-
import java.util.Map;
|
|
8
|
-
import java.util.stream.Collectors;
|
|
9
|
-
|
|
10
|
-
import org.webrtc.*;
|
|
11
|
-
|
|
12
3
|
import com.facebook.react.bridge.Arguments;
|
|
13
4
|
import com.facebook.react.bridge.ReadableArray;
|
|
14
5
|
import com.facebook.react.bridge.ReadableMap;
|
|
15
6
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
16
7
|
import com.facebook.react.bridge.ReadableType;
|
|
17
|
-
import com.facebook.react.bridge.WritableMap;
|
|
18
8
|
import com.facebook.react.bridge.WritableArray;
|
|
9
|
+
import com.facebook.react.bridge.WritableMap;
|
|
10
|
+
|
|
11
|
+
import org.webrtc.*;
|
|
12
|
+
|
|
13
|
+
import java.util.ArrayList;
|
|
14
|
+
import java.util.HashMap;
|
|
15
|
+
import java.util.List;
|
|
16
|
+
import java.util.Map;
|
|
17
|
+
import java.util.stream.Collectors;
|
|
19
18
|
|
|
20
19
|
public class SerializeUtils {
|
|
21
|
-
|
|
22
20
|
/**
|
|
23
21
|
* Serialization APIs
|
|
24
22
|
*/
|
|
@@ -30,17 +28,16 @@ public class SerializeUtils {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
public static ReadableMap serializeStream(int pcId, String streamReactTag, MediaStream stream) {
|
|
33
|
-
|
|
34
31
|
WritableMap params = Arguments.createMap();
|
|
35
32
|
params.putString("streamId", stream.getId());
|
|
36
33
|
params.putString("streamReactTag", streamReactTag);
|
|
37
34
|
|
|
38
35
|
WritableArray tracks = Arguments.createArray();
|
|
39
36
|
|
|
40
|
-
for (VideoTrack track: stream.videoTracks) {
|
|
37
|
+
for (VideoTrack track : stream.videoTracks) {
|
|
41
38
|
tracks.pushMap(SerializeUtils.serializeTrack(pcId, track));
|
|
42
39
|
}
|
|
43
|
-
for (AudioTrack track: stream.audioTracks) {
|
|
40
|
+
for (AudioTrack track : stream.audioTracks) {
|
|
44
41
|
tracks.pushMap(SerializeUtils.serializeTrack(pcId, track));
|
|
45
42
|
}
|
|
46
43
|
|
|
@@ -50,7 +47,7 @@ public class SerializeUtils {
|
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
public static String serializeDirection(RtpTransceiver.RtpTransceiverDirection src) {
|
|
53
|
-
switch(src) {
|
|
50
|
+
switch (src) {
|
|
54
51
|
case INACTIVE:
|
|
55
52
|
return "inactive";
|
|
56
53
|
case RECV_ONLY:
|
|
@@ -122,77 +119,77 @@ public class SerializeUtils {
|
|
|
122
119
|
}
|
|
123
120
|
|
|
124
121
|
public static ReadableMap serializeRtpParameters(RtpParameters params) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
122
|
+
WritableMap result = Arguments.createMap();
|
|
123
|
+
WritableArray encodings = Arguments.createArray();
|
|
124
|
+
WritableArray codecs = Arguments.createArray();
|
|
125
|
+
WritableArray headerExtensions = Arguments.createArray();
|
|
126
|
+
WritableMap rtcp = Arguments.createMap();
|
|
127
|
+
|
|
128
|
+
// Preparing RTCP
|
|
129
|
+
rtcp.putString("cname", params.getRtcp().getCname());
|
|
130
|
+
rtcp.putBoolean("reducedSize", params.getRtcp().getReducedSize());
|
|
131
|
+
|
|
132
|
+
// Preparing header extensions
|
|
133
|
+
params.getHeaderExtensions().forEach(extension -> {
|
|
134
|
+
WritableMap extensionMap = Arguments.createMap();
|
|
135
|
+
extensionMap.putInt("id", extension.getId());
|
|
136
|
+
extensionMap.putString("uri", extension.getUri());
|
|
137
|
+
extensionMap.putBoolean("encrypted", extension.getEncrypted());
|
|
138
|
+
headerExtensions.pushMap(extensionMap);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Preparing encodings
|
|
142
|
+
params.encodings.forEach(encoding -> {
|
|
143
|
+
WritableMap encodingMap = Arguments.createMap();
|
|
144
|
+
encodingMap.putBoolean("active", encoding.active);
|
|
145
|
+
if (encoding.rid != null) {
|
|
146
|
+
encodingMap.putString("rid", encoding.rid);
|
|
147
|
+
}
|
|
148
|
+
// Since they return integer objects that are nullable,
|
|
149
|
+
// while the map does not accept nullable integer values.
|
|
150
|
+
if (encoding.maxBitrateBps != null) {
|
|
151
|
+
encodingMap.putInt("maxBitrate", encoding.maxBitrateBps);
|
|
152
|
+
}
|
|
153
|
+
if (encoding.maxFramerate != null) {
|
|
154
|
+
encodingMap.putInt("maxFramerate", encoding.maxFramerate);
|
|
155
|
+
}
|
|
156
|
+
if (encoding.scaleResolutionDownBy != null) {
|
|
157
|
+
encodingMap.putDouble("scaleResolutionDownBy", encoding.scaleResolutionDownBy);
|
|
158
|
+
}
|
|
159
|
+
encodings.pushMap(encodingMap);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Preparing codecs
|
|
163
|
+
params.codecs.forEach(codec -> {
|
|
164
|
+
WritableMap codecMap = Arguments.createMap();
|
|
165
|
+
codecMap.putInt("payloadType", codec.payloadType);
|
|
166
|
+
codecMap.putString("mimeType", codec.name);
|
|
167
|
+
codecMap.putInt("clockRate", codec.clockRate);
|
|
168
|
+
if (codec.numChannels != null) {
|
|
169
|
+
codecMap.putInt("channels", codec.numChannels);
|
|
170
|
+
}
|
|
171
|
+
// Serializing sdpFmptLine.
|
|
172
|
+
if (!codec.parameters.isEmpty()) {
|
|
173
|
+
final String sdpFmptLineParams = codec.parameters.keySet()
|
|
174
|
+
.stream()
|
|
175
|
+
.map(key -> key + "=" + codec.parameters.get(key))
|
|
176
|
+
.collect(Collectors.joining(";"));
|
|
177
|
+
codecMap.putString("sdpFmtpLine", sdpFmptLineParams);
|
|
178
|
+
}
|
|
181
179
|
|
|
182
|
-
|
|
183
|
-
|
|
180
|
+
codecs.pushMap(codecMap);
|
|
181
|
+
});
|
|
184
182
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
183
|
+
result.putString("transactionId", params.transactionId);
|
|
184
|
+
result.putMap("rtcp", rtcp);
|
|
185
|
+
result.putArray("encodings", encodings);
|
|
186
|
+
result.putArray("codecs", codecs);
|
|
187
|
+
result.putArray("headerExtensions", headerExtensions);
|
|
188
|
+
if (params.degradationPreference != null) {
|
|
189
|
+
result.putString("degradationPreference", params.degradationPreference.toString());
|
|
190
|
+
}
|
|
194
191
|
|
|
195
|
-
|
|
192
|
+
return result;
|
|
196
193
|
}
|
|
197
194
|
|
|
198
195
|
/**
|
|
@@ -200,41 +197,41 @@ public class SerializeUtils {
|
|
|
200
197
|
*/
|
|
201
198
|
|
|
202
199
|
public static RtpParameters updateRtpParameters(ReadableMap updateParams, RtpParameters rtpParams) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
200
|
+
// Preparing encodings
|
|
201
|
+
ReadableArray encodingsArray = updateParams.getArray("encodings");
|
|
202
|
+
List<RtpParameters.Encoding> encodings = rtpParams.encodings;
|
|
203
|
+
if (encodingsArray.size() != encodings.size()) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
for (int i = 0; i < encodingsArray.size(); i++) {
|
|
208
|
+
ReadableMap encodingUpdate = encodingsArray.getMap(i);
|
|
209
|
+
RtpParameters.Encoding encoding = encodings.get(i);
|
|
210
|
+
// Dealing with nullable Integers
|
|
211
|
+
Integer maxBitrate = encodingUpdate.hasKey("maxBitrate") ? encodingUpdate.getInt("maxBitrate") : null;
|
|
212
|
+
Integer maxFramerate = encodingUpdate.hasKey("maxFramerate") ? encodingUpdate.getInt("maxFramerate") : null;
|
|
213
|
+
Double scaleResolutionDownBy = encodingUpdate.hasKey("scaleResolutionDownBy")
|
|
214
|
+
? encodingUpdate.getDouble("scaleResolutionDownBy")
|
|
215
|
+
: null;
|
|
216
|
+
|
|
217
|
+
encoding.active = encodingUpdate.getBoolean("active");
|
|
218
|
+
encoding.rid = encodingUpdate.getString("rid");
|
|
219
|
+
encoding.maxBitrateBps = maxBitrate;
|
|
220
|
+
encoding.maxFramerate = maxFramerate;
|
|
221
|
+
encoding.scaleResolutionDownBy = scaleResolutionDownBy;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (updateParams.hasKey("degradationPreference")) {
|
|
225
|
+
rtpParams.degradationPreference =
|
|
226
|
+
RtpParameters.DegradationPreference.valueOf(updateParams.getString("degradationPreference"));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return rtpParams;
|
|
233
230
|
}
|
|
234
231
|
|
|
235
232
|
public static MediaStreamTrack.MediaType parseMediaType(String type) {
|
|
236
|
-
switch(type) {
|
|
237
|
-
case "audio":
|
|
233
|
+
switch (type) {
|
|
234
|
+
case "audio":
|
|
238
235
|
return MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO;
|
|
239
236
|
case "video":
|
|
240
237
|
return MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO;
|
|
@@ -242,7 +239,7 @@ public class SerializeUtils {
|
|
|
242
239
|
throw new Error("Unknown media type");
|
|
243
240
|
}
|
|
244
241
|
}
|
|
245
|
-
|
|
242
|
+
|
|
246
243
|
public static RtpTransceiver.RtpTransceiverDirection parseDirection(String src) {
|
|
247
244
|
switch (src) {
|
|
248
245
|
case "sendrecv":
|
|
@@ -253,8 +250,8 @@ public class SerializeUtils {
|
|
|
253
250
|
return RtpTransceiver.RtpTransceiverDirection.RECV_ONLY;
|
|
254
251
|
case "inactive":
|
|
255
252
|
return RtpTransceiver.RtpTransceiverDirection.INACTIVE;
|
|
256
|
-
|
|
257
|
-
|
|
253
|
+
// Here we ignore the "stopped" direction because user code should
|
|
254
|
+
// never set it.
|
|
258
255
|
}
|
|
259
256
|
throw new Error("Invalid direction");
|
|
260
257
|
}
|
|
@@ -304,7 +301,7 @@ public class SerializeUtils {
|
|
|
304
301
|
if (map.hasKey("sendEncodings")) {
|
|
305
302
|
ReadableArray encodingsArray = map.getArray("sendEncodings");
|
|
306
303
|
if (encodingsArray != null) {
|
|
307
|
-
for (int i = 0; i < encodingsArray.size(); i++){
|
|
304
|
+
for (int i = 0; i < encodingsArray.size(); i++) {
|
|
308
305
|
ReadableMap encoding = encodingsArray.getMap(i);
|
|
309
306
|
sendEncodings.add(SerializeUtils.parseEncoding(encoding));
|
|
310
307
|
}
|
|
@@ -28,7 +28,6 @@ public class StringUtils {
|
|
|
28
28
|
Map<String, RTCStats> statsMap = report.getStatsMap();
|
|
29
29
|
|
|
30
30
|
for (String key : report.getStatsMap().keySet()) {
|
|
31
|
-
|
|
32
31
|
if (firstKey) {
|
|
33
32
|
firstKey = false;
|
|
34
33
|
} else {
|
|
@@ -38,21 +37,16 @@ public class StringUtils {
|
|
|
38
37
|
builder.append("[\"").append(key).append("\",{");
|
|
39
38
|
|
|
40
39
|
RTCStats stats = statsMap.get(key);
|
|
41
|
-
builder
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.append("\"");
|
|
40
|
+
builder.append("\"timestamp\":")
|
|
41
|
+
.append(stats.getTimestampUs() / 1000.0)
|
|
42
|
+
.append(",\"type\":\"")
|
|
43
|
+
.append(stats.getType())
|
|
44
|
+
.append("\",\"id\":\"")
|
|
45
|
+
.append(stats.getId())
|
|
46
|
+
.append("\"");
|
|
49
47
|
|
|
50
48
|
for (Map.Entry<String, Object> entry : stats.getMembers().entrySet()) {
|
|
51
|
-
builder
|
|
52
|
-
.append(",")
|
|
53
|
-
.append("\"")
|
|
54
|
-
.append(entry.getKey())
|
|
55
|
-
.append("\":");
|
|
49
|
+
builder.append(",").append("\"").append(entry.getKey()).append("\":");
|
|
56
50
|
appendValue(builder, entry.getValue());
|
|
57
51
|
}
|
|
58
52
|
|
|
@@ -11,8 +11,7 @@ final class ThreadUtils {
|
|
|
11
11
|
* they don't run on the calling thread anyway, we are deferring the calls
|
|
12
12
|
* to this thread to avoid (potentially) blocking the calling thread.
|
|
13
13
|
*/
|
|
14
|
-
private static final ExecutorService executor
|
|
15
|
-
= Executors.newSingleThreadExecutor();
|
|
14
|
+
private static final ExecutorService executor = Executors.newSingleThreadExecutor();
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Runs the given {@link Runnable} on the executor.
|
|
@@ -2,17 +2,16 @@ package com.oney.WebRTCModule;
|
|
|
2
2
|
|
|
3
3
|
import android.util.*;
|
|
4
4
|
|
|
5
|
-
import org.webrtc.CapturerObserver;
|
|
6
|
-
import org.webrtc.VideoFrame;
|
|
7
|
-
|
|
8
5
|
import com.facebook.react.bridge.Arguments;
|
|
9
6
|
import com.facebook.react.bridge.WritableMap;
|
|
10
7
|
|
|
8
|
+
import org.webrtc.CapturerObserver;
|
|
9
|
+
import org.webrtc.VideoFrame;
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* A capturer observer that emits track ended events when the capturer is stopped.
|
|
13
13
|
*/
|
|
14
14
|
public class TrackCapturerEventsEmitter implements AbstractVideoCaptureController.CapturerEventsListener {
|
|
15
|
-
|
|
16
15
|
private static final String TAG = TrackCapturerEventsEmitter.class.getCanonicalName();
|
|
17
16
|
|
|
18
17
|
private final WebRTCModule webRTCModule;
|
|
@@ -2,13 +2,13 @@ package com.oney.WebRTCModule;
|
|
|
2
2
|
|
|
3
3
|
import android.util.*;
|
|
4
4
|
|
|
5
|
+
import com.facebook.react.bridge.Arguments;
|
|
6
|
+
import com.facebook.react.bridge.WritableMap;
|
|
7
|
+
|
|
5
8
|
import org.webrtc.VideoFrame;
|
|
6
9
|
import org.webrtc.VideoSink;
|
|
7
10
|
import org.webrtc.VideoTrack;
|
|
8
11
|
|
|
9
|
-
import com.facebook.react.bridge.Arguments;
|
|
10
|
-
import com.facebook.react.bridge.WritableMap;
|
|
11
|
-
|
|
12
12
|
import java.util.*;
|
|
13
13
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
14
14
|
|
|
@@ -119,13 +119,9 @@ public class VideoTrackAdapter {
|
|
|
119
119
|
params.putString("trackId", trackId);
|
|
120
120
|
params.putBoolean("muted", muted);
|
|
121
121
|
|
|
122
|
-
Log.d(TAG,
|
|
123
|
-
(muted ? "Mute" : "Unmute" )
|
|
124
|
-
+ " event pcId: " + peerConnectionId
|
|
125
|
-
+ " trackId: " + trackId);
|
|
122
|
+
Log.d(TAG, (muted ? "Mute" : "Unmute") + " event pcId: " + peerConnectionId + " trackId: " + trackId);
|
|
126
123
|
|
|
127
|
-
VideoTrackAdapter.this.webRTCModule.sendEvent(
|
|
128
|
-
"mediaStreamTrackMuteChanged", params);
|
|
124
|
+
VideoTrackAdapter.this.webRTCModule.sendEvent("mediaStreamTrackMuteChanged", params);
|
|
129
125
|
}
|
|
130
126
|
|
|
131
127
|
void dispose() {
|