Эх сурвалжийг харах

Fix up some things

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 жил өмнө
parent
commit
2a84ae003f

+ 1 - 3
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -218,8 +218,6 @@ public class CallActivity extends AppCompatActivity {
         // And finally, with our VideoRenderer ready, we
         // can add our renderer to the VideoTrack.
         localVideoTrack.addRenderer(localRenderer);
-
-
     }
 
 
@@ -291,7 +289,7 @@ public class CallActivity extends AppCompatActivity {
                         localPeer.setRemoteDescription(new MagicSdpObserver(), sessionDescription);
 
                     }
-                }, new MediaConstraints());
+                }, sdpConstraints);
             }
         }, sdpConstraints);
     }

+ 39 - 0
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java

@@ -0,0 +1,39 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.api.models.json.signaling;
+
+import com.bluelinelabs.logansquare.annotation.JsonField;
+import com.bluelinelabs.logansquare.annotation.JsonObject;
+
+import lombok.Data;
+
+@Data
+@JsonObject
+public class NCIceCandidate {
+    @JsonField(name = "sdpMLineIndex")
+    String sdpMLineIndex;
+
+    @JsonField(name = "sdpMid")
+    String sdpMid;
+
+    @JsonField(name = "candidate")
+    String candidate;
+}

+ 42 - 0
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java

@@ -0,0 +1,42 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.api.models.json.signaling;
+
+import com.bluelinelabs.logansquare.annotation.JsonField;
+import com.bluelinelabs.logansquare.annotation.JsonObject;
+
+import lombok.Data;
+
+@Data
+@JsonObject
+public class NCMessagePayload {
+    @JsonField(name = "type")
+    String type;
+
+    @JsonField(name = "sdp")
+    String sdp;
+
+    @JsonField(name = "nick")
+    String nick;
+
+    @JsonField(name = "candidate")
+    NCIceCandidate iceCandidate;
+}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.api.models.json.signaling;
+
+import com.bluelinelabs.logansquare.annotation.JsonField;
+import com.bluelinelabs.logansquare.annotation.JsonObject;
+
+import lombok.Data;
+
+@Data
+@JsonObject
+public class NCMessageWrapper {
+    @JsonField(name = "fn")
+    NCSignalingMessage signalingMessage;
+
+    // always a "message"
+    @JsonField(name = "ev")
+    String ev;
+
+    @JsonField(name = "sessionId")
+    String sessionId;
+}

+ 2 - 5
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java

@@ -23,8 +23,6 @@ package com.nextcloud.talk.api.models.json.signaling;
 import com.bluelinelabs.logansquare.annotation.JsonField;
 import com.bluelinelabs.logansquare.annotation.JsonObject;
 
-import java.util.HashMap;
-
 import lombok.Data;
 
 @Data
@@ -34,12 +32,11 @@ public class NCSignalingMessage {
     String from;
     @JsonField(name = "to")
     String to;
-    @JsonField(name = "sid")
-    String sid;
     @JsonField(name = "type")
     String type;
     @JsonField(name = "payload")
-    HashMap<String, Object> payload;
+    NCMessagePayload payload;
     @JsonField(name = "roomType")
     String roomType;
+
 }

+ 0 - 1
app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionObserver.java

@@ -62,7 +62,6 @@ public class MagicPeerConnectionObserver implements PeerConnection.Observer {
 
     @Override
     public void onAddStream(MediaStream mediaStream) {
-
     }
 
     @Override