Skip to content

Commit 45cb682

Browse files
committed
Calls: Introduce simulcast API
1 parent 2a75199 commit 45cb682

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

public/realtime/static/calls-api-2024-05-21.yaml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,33 @@ paths:
140140
sessionId: 2a45361d5fd7cc14eface0587c276c94
141141
trackName: generated-audio
142142
kind: "audio"
143+
simulcast_track:
144+
description: Share a track with simulcast configuration
145+
value:
146+
sessionDescription:
147+
sdp: |
148+
v=0
149+
o=- 0 0 IN IP4 127.0.0.1
150+
s=-
151+
c=IN IP4 127.0.0.1
152+
t=0 0
153+
m=audio 4000 RTP/AVP 111
154+
a=rtpmap:111 OPUS/48000/2
155+
m=video 4002 RTP/AVP 96
156+
a=rtpmap:96 VP8/90000
157+
a=simulcast:send f;h;q
158+
a=rid:f send
159+
a=rid:h send
160+
a=rid:q send
161+
...
162+
type: offer
163+
tracks:
164+
- location: local
165+
trackName: simulcast-video-track
166+
mid: "1"
167+
simulcast:
168+
preferredRid: "h"
169+
preferredRidNotAvailable: "leastbandwidth"
143170
security:
144171
- secret: []
145172
parameters:
@@ -329,6 +356,75 @@ paths:
329356
requiresImmediateRenegotiation: false
330357
tracks:
331358
- mid: "7"
359+
/apps/{appId}/sessions/{sessionId}/tracks/change:
360+
post:
361+
tags:
362+
- Change tracks
363+
summary: Change tracks by reusing existing transceivers
364+
requestBody:
365+
content:
366+
application/json:
367+
schema:
368+
$ref: "#/components/schemas/ChangeTracksRequest"
369+
examples:
370+
reuse_transceiver:
371+
description: Reuse an existing transceiver for a new track
372+
value:
373+
tracks:
374+
some-track-name:
375+
location: "remote"
376+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
377+
trackName: "other-track-name"
378+
mid: "7"
379+
reuse_with_simulcast:
380+
description: Reuse an existing transceiver with simulcast preferences
381+
value:
382+
tracks:
383+
trackID2:
384+
location: "remote"
385+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
386+
trackName: "simulcast-track"
387+
mid: "8"
388+
simulcast:
389+
preferredRid: "h"
390+
preferredRidNotAvailable: "leastbandwidth"
391+
security:
392+
- secret: []
393+
parameters:
394+
- in: path
395+
name: appId
396+
schema:
397+
type: string
398+
required: true
399+
description: WebRTC application ID
400+
- in: path
401+
name: sessionId
402+
schema:
403+
type: string
404+
required: true
405+
description: Current PeerConnection session ID
406+
responses:
407+
"200":
408+
description: OK
409+
headers:
410+
vary:
411+
schema:
412+
type: string
413+
example: Origin
414+
content:
415+
application/json:
416+
schema:
417+
$ref: "#/components/schemas/ChangeTracksResponse"
418+
examples:
419+
success:
420+
value:
421+
requiresImmediateRenegotiation: false
422+
tracks:
423+
trackID1:
424+
mid: "7"
425+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
426+
trackName: "new-track-name"
427+
332428
/apps/{appId}/sessions/{sessionId}:
333429
get:
334430
tags:
@@ -412,6 +508,21 @@ components:
412508
kind:
413509
type: string
414510
description: Give a hint to the SFU about the transceiver kind. This is required when the SFU generates the offer
511+
simulcast:
512+
type: object
513+
description: Simulcast configuration for the track
514+
properties:
515+
preferredRid:
516+
type: string
517+
description: Preferred RID (Resolution ID) for simulcast streams
518+
preferredRidNotAvailable:
519+
type: string
520+
enum:
521+
- leastbandwidth
522+
- none
523+
- error
524+
default: leastbandwidth
525+
description: Fallback strategy when preferred RID is not available anymore from the remote peer
415526
CloseTrackObject:
416527
type: object
417528
properties:
@@ -543,3 +654,34 @@ components:
543654
type: string
544655
sessionDescription:
545656
$ref: "#/components/schemas/SessionDescription"
657+
ChangeTracksRequest:
658+
type: object
659+
properties:
660+
tracks:
661+
type: object
662+
additionalProperties:
663+
allOf:
664+
- $ref: "#/components/schemas/TrackObject"
665+
description: Map of track IDs to track objects for changing tracks
666+
sessionDescription:
667+
$ref: "#/components/schemas/SessionDescription"
668+
ChangeTracksResponse:
669+
type: object
670+
properties:
671+
errorCode:
672+
type: string
673+
errorDescription:
674+
type: string
675+
requiresImmediateRenegotiation:
676+
type: boolean
677+
tracks:
678+
type: object
679+
additionalProperties:
680+
allOf:
681+
- $ref: "#/components/schemas/TrackObject"
682+
- properties:
683+
errorCode:
684+
type: string
685+
errorDescription:
686+
type: string
687+
description: Map of track IDs to track objects with results

0 commit comments

Comments
 (0)