Skip to content

Commit 72d94d4

Browse files
committed
Calls: Introduce simulcast API
1 parent 070d77b commit 72d94d4

File tree

1 file changed

+143
-1
lines changed

1 file changed

+143
-1
lines changed

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

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.0
22
info:
33
title: Cloudflare Calls API
4-
version: "1.0"
4+
version: "1.1"
55
externalDocs:
66
description: Find out more about Cloudflare Calls
77
url: https://developers.cloudflare.com/calls/
@@ -135,6 +135,33 @@ paths:
135135
sessionId: 2a45361d5fd7cc14eface0587c276c94
136136
trackName: generated-audio
137137
kind: "audio"
138+
simulcast_track:
139+
description: Share a track with simulcast configuration
140+
value:
141+
sessionDescription:
142+
sdp: |
143+
v=0
144+
o=- 0 0 IN IP4 127.0.0.1
145+
s=-
146+
c=IN IP4 127.0.0.1
147+
t=0 0
148+
m=audio 4000 RTP/AVP 111
149+
a=rtpmap:111 OPUS/48000/2
150+
m=video 4002 RTP/AVP 96
151+
a=rtpmap:96 VP8/90000
152+
a=simulcast:send f;h;q
153+
a=rid:f send
154+
a=rid:h send
155+
a=rid:q send
156+
...
157+
type: offer
158+
tracks:
159+
- location: local
160+
trackName: simulcast-video-track
161+
mid: "1"
162+
simulcast:
163+
preferredRid: "h"
164+
preferredRidNotAvailable: "leastbandwidth"
138165
security:
139166
- secret: []
140167
parameters:
@@ -324,6 +351,75 @@ paths:
324351
requiresImmediateRenegotiation: false
325352
tracks:
326353
- mid: "7"
354+
/apps/{appId}/sessions/{sessionId}/tracks/change:
355+
post:
356+
tags:
357+
- Change tracks
358+
summary: Change tracks by reusing existing transceivers
359+
requestBody:
360+
content:
361+
application/json:
362+
schema:
363+
$ref: "#/components/schemas/ChangeTracksRequest"
364+
examples:
365+
reuse_transceiver:
366+
description: Reuse an existing transceiver for a new track
367+
value:
368+
tracks:
369+
some-track-name:
370+
location: "remote"
371+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
372+
trackName: "other-track-name"
373+
mid: "7"
374+
reuse_with_simulcast:
375+
description: Reuse an existing transceiver with simulcast preferences
376+
value:
377+
tracks:
378+
trackID2:
379+
location: "remote"
380+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
381+
trackName: "simulcast-track"
382+
mid: "8"
383+
simulcast:
384+
preferredRid: "h"
385+
preferredRidNotAvailable: "leastbandwidth"
386+
security:
387+
- secret: []
388+
parameters:
389+
- in: path
390+
name: appId
391+
schema:
392+
type: string
393+
required: true
394+
description: WebRTC application ID
395+
- in: path
396+
name: sessionId
397+
schema:
398+
type: string
399+
required: true
400+
description: Current PeerConnection session ID
401+
responses:
402+
"200":
403+
description: OK
404+
headers:
405+
vary:
406+
schema:
407+
type: string
408+
example: Origin
409+
content:
410+
application/json:
411+
schema:
412+
$ref: "#/components/schemas/ChangeTracksResponse"
413+
examples:
414+
success:
415+
value:
416+
requiresImmediateRenegotiation: false
417+
tracks:
418+
trackID1:
419+
mid: "7"
420+
sessionId: "2a45361d5fd7cc14eface0587c276c94"
421+
trackName: "new-track-name"
422+
327423
/apps/{appId}/sessions/{sessionId}:
328424
get:
329425
tags:
@@ -407,6 +503,21 @@ components:
407503
kind:
408504
type: string
409505
description: Give a hint to the SFU about the transceiver kind. This is required when the SFU generates the offer
506+
simulcast:
507+
type: object
508+
description: Simulcast configuration for the track
509+
properties:
510+
preferredRid:
511+
type: string
512+
description: Preferred RID (Resolution ID) for simulcast streams
513+
preferredRidNotAvailable:
514+
type: string
515+
enum:
516+
- leastbandwidth
517+
- none
518+
- error
519+
default: leastbandwidth
520+
description: Fallback strategy when preferred RID is not available anymore from the remote peer
410521
CloseTrackObject:
411522
type: object
412523
properties:
@@ -538,3 +649,34 @@ components:
538649
type: string
539650
sessionDescription:
540651
$ref: "#/components/schemas/SessionDescription"
652+
ChangeTracksRequest:
653+
type: object
654+
properties:
655+
tracks:
656+
type: object
657+
additionalProperties:
658+
allOf:
659+
- $ref: "#/components/schemas/TrackObject"
660+
description: Map of track IDs to track objects for changing tracks
661+
sessionDescription:
662+
$ref: "#/components/schemas/SessionDescription"
663+
ChangeTracksResponse:
664+
type: object
665+
properties:
666+
errorCode:
667+
type: string
668+
errorDescription:
669+
type: string
670+
requiresImmediateRenegotiation:
671+
type: boolean
672+
tracks:
673+
type: object
674+
additionalProperties:
675+
allOf:
676+
- $ref: "#/components/schemas/TrackObject"
677+
- properties:
678+
errorCode:
679+
type: string
680+
errorDescription:
681+
type: string
682+
description: Map of track IDs to track objects with results

0 commit comments

Comments
 (0)