Логичная структура пакетов без магических чисел
This commit is contained in:
@@ -3,6 +3,8 @@ package io.g365sfu;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.HashSet;
|
||||
|
||||
import io.g365sfu.net.Outgoing;
|
||||
|
||||
/**
|
||||
* Это комната для звонков, она может быть как для двоих участников, так и для групповых звонков.
|
||||
* Комната содержит в себе информацию о том, на каком она SFU сервере, какой у нее ID, кто в ней участвует.
|
||||
@@ -77,7 +79,7 @@ public class Room {
|
||||
/**
|
||||
* 0x03 - SDP offer
|
||||
*/
|
||||
buffer.put((byte)0x03);
|
||||
buffer.put(Outgoing.SDP_OFFER_RETRANSLATE);
|
||||
buffer.putInt(this.roomId.getBytes().length);
|
||||
buffer.put(this.roomId.getBytes());
|
||||
buffer.putInt(participantId.getBytes().length);
|
||||
@@ -111,7 +113,7 @@ public class Room {
|
||||
/**
|
||||
* 0x06 - ICE кандидат
|
||||
*/
|
||||
buffer.put((byte)0x06);
|
||||
buffer.put(Outgoing.ICE_CANDIDATE_RETRANSLATE);
|
||||
buffer.putInt(this.roomId.getBytes().length);
|
||||
buffer.put(this.roomId.getBytes());
|
||||
buffer.putInt(participantId.getBytes().length);
|
||||
@@ -145,7 +147,7 @@ public class Room {
|
||||
/**
|
||||
* 0x07 - SDP answer
|
||||
*/
|
||||
buffer.put((byte)0x07);
|
||||
buffer.put(Outgoing.SDP_ANSWER_RETRANSLATE);
|
||||
buffer.putInt(this.roomId.getBytes().length);
|
||||
buffer.put(this.roomId.getBytes());
|
||||
buffer.putInt(participantId.getBytes().length);
|
||||
|
||||
Reference in New Issue
Block a user