File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
src/org/freedesktop/gstreamer/webrtc
test/org/freedesktop/gstreamer Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,15 @@ public WebRTCPeerConnectionState getConnectionState() {
266
266
return NativeEnum .fromInt (WebRTCPeerConnectionState .class , (Integer ) get ("connection-state" ));
267
267
}
268
268
269
+ /**
270
+ * Retrieve ICE gathering state this {@link WebRTCBin} is currently in
271
+ *
272
+ * @return a {@link WebRTCICEGatheringState} describing gathering state
273
+ */
274
+ public WebRTCICEGatheringState getICEGatheringState () {
275
+ return NativeEnum .fromInt (WebRTCICEGatheringState .class , (Integer ) get ("ice-gathering-state" ));
276
+ }
277
+
269
278
/**
270
279
* Retrieve the local description for this {@link WebRTCBin}
271
280
*
Original file line number Diff line number Diff line change
1
+ package org .freedesktop .gstreamer .webrtc ;
2
+
3
+ import org .freedesktop .gstreamer .Gst ;
4
+ import org .freedesktop .gstreamer .glib .NativeEnum ;
5
+
6
+ /**
7
+ * The ICE gathering state of WebRTC peer
8
+ * Available since GStreamer 1.14
9
+ */
10
+ @ Gst .Since (minor = 14 )
11
+ public enum WebRTCICEGatheringState implements NativeEnum <WebRTCICEGatheringState > {
12
+ /** New gathering */
13
+ NEW (0 ),
14
+ /** Gathering in progress */
15
+ GATHERING (1 ),
16
+ /** Gathering completed */
17
+ COMPLETE (2 );
18
+
19
+ private final int value ;
20
+
21
+ private WebRTCICEGatheringState (int value ) {
22
+ this .value = value ;
23
+ }
24
+
25
+ @ Override
26
+ public int intValue () {
27
+ return this .value ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change 1
1
package org .freedesktop .gstreamer ;
2
2
3
3
import org .freedesktop .gstreamer .glib .NativeEnum ;
4
+ import org .freedesktop .gstreamer .webrtc .WebRTCICEGatheringState ;
4
5
import org .freedesktop .gstreamer .webrtc .WebRTCPeerConnectionState ;
5
6
import org .junit .Test ;
6
7
@@ -16,4 +17,11 @@ public void connectionStateTest() {
16
17
assertEquals (NativeEnum .fromInt (WebRTCPeerConnectionState .class , 4 ), WebRTCPeerConnectionState .FAILED );
17
18
assertEquals (NativeEnum .fromInt (WebRTCPeerConnectionState .class , 5 ), WebRTCPeerConnectionState .CLOSED );
18
19
}
20
+
21
+ @ Test
22
+ public void iceGatheringStateTest () {
23
+ assertEquals (NativeEnum .fromInt (WebRTCICEGatheringState .class , 0 ), WebRTCICEGatheringState .NEW );
24
+ assertEquals (NativeEnum .fromInt (WebRTCICEGatheringState .class , 1 ), WebRTCICEGatheringState .GATHERING );
25
+ assertEquals (NativeEnum .fromInt (WebRTCICEGatheringState .class , 2 ), WebRTCICEGatheringState .COMPLETE );
26
+ }
19
27
}
You can’t perform that action at this time.
0 commit comments