Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit a3d88b4

Browse files
committed
Add P2P QUIC support, decouple transport and media in protocol.
Transport can be reused by multiple publications, subscription and data streams.
1 parent 30404de commit a3d88b4

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

doc/Client-Portal Protocol.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ This a format for client reconnects.
144144
{
145145
publish: {
146146
audio: true | false,
147-
video: true | false
147+
video: true | false,
148+
data: true | false
148149
},
149150
subscribe: {
150151
audio: true | false,
151-
video: true | false
152+
video: true | false,
153+
data: true | false
152154
}
153155
}
154156

@@ -164,7 +166,8 @@ This a format for client reconnects.
164166
{
165167
id: string(StreamID),
166168
type: "forward" | "augmented" |"mixed",
167-
media: object(MediaInfo),
169+
media: object(MediaInfo) | null,
170+
data: object(DataInfo) | null,
168171
info: object(PublicationInfo)/*If type equals "forward"*/
169172
| object(AugmentInfo)/*If type equals "augmented"*/
170173
| object(ViewInfo)/*If type equals "mixed"*/
@@ -243,7 +246,7 @@ This a format for client reconnects.
243246
object(PublicationInfo):
244247
{
245248
owner: string(ParticipantId),
246-
type: "webrtc" | "streaming" | "sip",
249+
type: "webrtc" | "streaming" | "sip" | "quic-p2p",
247250
inViews: [String(ViewLabel)],
248251
attributes: object(ClientDefinedAttributes)
249252
}
@@ -350,14 +353,15 @@ This a format for client reconnects.
350353
message: string(Message)
351354
}
352355

353-
### 3.3.7 Participant Starts Publishing a WebRTC Stream to Room
356+
### 3.3.7 Participant Starts Publishing a Stream to Room
354357
**RequestName**: “publish”<br>
355358

356359
**RequestData**: The PublicationRequest object with following definition:
357360

358361
object(PublicationRequest)::
359362
{
360363
media: object(WebRTCMediaOptions),
364+
transport: object(TransportOptions),
361365
attributes: object(ClientDefinedAttributes)
362366
}
363367

@@ -381,7 +385,8 @@ This a format for client reconnects.
381385

382386
object(PublicationResult)::
383387
{
384-
id: string(SessionId) //will be used as the stream id when it gets ready.
388+
transportId: string(transportId), // Can be reused in the following publication or subscription.
389+
publicationId: string(SessionId) //will be used as the stream id when it gets ready.
385390
}
386391
### 3.3.8 Participant Stops Publishing a Stream to Room
387392
**RequestName**: “unpublish”<br>
@@ -431,7 +436,8 @@ This a format for client reconnects.
431436

432437
object(SubscriptionRequest)::
433438
{
434-
media: object(MediaSubOptions)
439+
media: object(MediaSubOptions),
440+
transport: object(TransportOptions),
435441
}
436442

437443
object(MediaSubOptions)::
@@ -464,7 +470,8 @@ This a format for client reconnects.
464470

465471
object(SubscriptionResult)::
466472
{
467-
id: string(SubscriptionId)
473+
transportId: string(transportId), // Can be reused in the following publication or subscription.
474+
subscriptionId: string(SubscriptionId)
468475
}
469476
### 3.3.12 Participant Stops a Self-Initiated Subscription
470477
**RequestName**: “unsubscribe”<br>
@@ -526,7 +533,8 @@ This a format for client reconnects.
526533
object(OfferAnswer)::
527534
{
528535
type: "offer" | "answer",
529-
sdp: string(SDP)
536+
sdp: string(SDP) | null, // WebRTC connection
537+
clientTransportParameters: object(P2PQuicClientParametersMessage) | null // QUIC connection
530538
}
531539

532540
object(CandidateMessage)::
@@ -547,6 +555,30 @@ This a format for client reconnects.
547555
sdpMLineIndex: number(mLineIndex), // optional in RemovedCandidatesMessage
548556
candidate: string(candidateSdp)
549557
}
558+
559+
object(TransportOptions)::
560+
{
561+
type: "webrtc" | "quic-p2p",
562+
id: string(transportId) | null, // null will result to create a new transport channel.
563+
}
564+
565+
object(P2PQuicClientParametersMessage)::
566+
{
567+
type: "quic-p2p-client-parameters",
568+
quicKey: arrayBuffer(Key),
569+
iceParameters: object(IceParameters)
570+
}
571+
object(P2PQuicServerParametersMessage)::
572+
{
573+
type: "quic-p2p-server-parameters",
574+
iceParameters: object(IceParameters)
575+
}
576+
577+
object(IceParameters)::
578+
{
579+
usernameFragment: string(UsernameFragment),
580+
password: string(Password)
581+
}
550582
**ResponseData**: undefined if **ResponseStatus** is “ok”.
551583
### 3.3.15 Participant Receives Session Progress
552584
**NotificationName**: “progress”<br>
@@ -557,7 +589,7 @@ This a format for client reconnects.
557589
{
558590
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
559591
status: "soac" | "ready" | "error",
560-
data: object(OfferAnswer) | object(CandidateMessage)/*If status equals “soac”*/
592+
data: object(OfferAnswer) | object(CandidateMessage) | object(P2PQuicServerParametersMessage) /*If status equals “soac”*/
561593
| (undefined/*If status equals “ready” and session is NOT for recording*/
562594
| object(RecorderInfo)/*If status equals “ready” and session is for recording*/ )
563595
| string(Reason)/*If status equals “error”*/

0 commit comments

Comments
 (0)