Add support for creating WHIP ingress (#1674)

This commit is contained in:
Benjamin Pracht
2023-05-02 13:26:47 -07:00
committed by GitHub
parent 00217c7af1
commit 11749eace9
5 changed files with 17 additions and 6 deletions
+2 -2
View File
@@ -224,9 +224,9 @@ keys:
# ingress server
# ingress:
# # Prefix used to generate RTMP URLs for RTMP ingress.
# # The stream_key will be appended to this base and returned as part of the
# # ingress info
# rtmp_base_url: "rtmp://my.domain.com/live"
# # Prefix used to generate WHIP URLs for WHIP ingress.
# whip_base_url: "http://my.domain.com/whip"
# egress server
# egress:
+1 -1
View File
@@ -18,7 +18,7 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/mediatransportutil v0.0.0-20230326055817-ed569ca13d26
github.com/livekit/protocol v1.5.6-0.20230428011359-db5afb1c7f9b
github.com/livekit/protocol v1.5.6-0.20230501213748-b2974692ebfd
github.com/livekit/psrpc v0.3.1-0.20230502152150-df9dd21fba11
github.com/mackerelio/go-osstat v0.2.4
github.com/magefile/mage v1.14.0
+2 -2
View File
@@ -121,8 +121,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20230326055817-ed569ca13d26 h1:QlQFyMwCDgjyySsrgmrMcVbEBA6KZcyTzvK+z346tUA=
github.com/livekit/mediatransportutil v0.0.0-20230326055817-ed569ca13d26/go.mod h1:eDA41kiySZoG+wy4Etsjb3w0jjLx69i/vAmSjG4bteA=
github.com/livekit/protocol v1.5.6-0.20230428011359-db5afb1c7f9b h1:UEFMJr1OTF0yAX9mRRaQQ/YrTA6H7hCkbuABWfT6wLk=
github.com/livekit/protocol v1.5.6-0.20230428011359-db5afb1c7f9b/go.mod h1:MBW05GWdhbl+o6u2gLLCQtDvr9EvcV4VWckpIYtoM2c=
github.com/livekit/protocol v1.5.6-0.20230501213748-b2974692ebfd h1:5gCLKGemm4JCEZvKIPpKVPOpguFt3/S2ZzYQd+4tInA=
github.com/livekit/protocol v1.5.6-0.20230501213748-b2974692ebfd/go.mod h1:MBW05GWdhbl+o6u2gLLCQtDvr9EvcV4VWckpIYtoM2c=
github.com/livekit/psrpc v0.3.1-0.20230502152150-df9dd21fba11 h1:VS23iVQu/TNiLEM5XjbBSY28+B6nSewjKWPDbieg0Ho=
github.com/livekit/psrpc v0.3.1-0.20230502152150-df9dd21fba11/go.mod h1:n6JntEg+zT6Ji8InoyTpV7wusPNwGqqtxmHlkNhDN0U=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
+1
View File
@@ -259,6 +259,7 @@ type EgressConfig struct {
type IngressConfig struct {
RTMPBaseURL string `yaml:"rtmp_base_url"`
WHIPBaseURL string `yaml:"whip_base_url"`
}
// not exposed to YAML
+11 -1
View File
@@ -56,7 +56,17 @@ func (s *IngressService) CreateIngress(ctx context.Context, req *livekit.CreateI
AppendLogFields(ctx, fields...)
}()
ig, err := s.CreateIngressWithUrlPrefix(ctx, s.conf.RTMPBaseURL, req)
var urlPrefix string
switch req.InputType {
case livekit.IngressInput_RTMP_INPUT:
urlPrefix = s.conf.RTMPBaseURL
case livekit.IngressInput_WHIP_INPUT:
urlPrefix = s.conf.WHIPBaseURL
default:
return nil, ingress.ErrInvalidIngressType
}
ig, err := s.CreateIngressWithUrlPrefix(ctx, urlPrefix, req)
if err != nil {
return nil, err
}