Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
cd6920d7
Commit
cd6920d7
authored
Apr 29, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow group.API() to fail.
parent
acca3f9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
group/group.go
group/group.go
+11
-7
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+9
-2
No files found.
group/group.go
View file @
cd6920d7
...
...
@@ -120,7 +120,7 @@ var groups struct {
groups
map
[
string
]
*
Group
}
func
(
g
*
Group
)
API
()
*
webrtc
.
API
{
func
(
g
*
Group
)
API
()
(
*
webrtc
.
API
,
error
)
{
g
.
mu
.
Lock
()
codecs
:=
g
.
description
.
Codecs
g
.
mu
.
Unlock
()
...
...
@@ -198,7 +198,7 @@ func payloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, error) {
}
}
func
APIFromCodecs
(
codecs
[]
webrtc
.
RTPCodecCapability
)
*
webrtc
.
API
{
func
APIFromCodecs
(
codecs
[]
webrtc
.
RTPCodecCapability
)
(
*
webrtc
.
API
,
error
)
{
s
:=
webrtc
.
SettingEngine
{}
s
.
SetSRTPReplayProtectionWindow
(
512
)
if
!
UseMDNS
{
...
...
@@ -229,7 +229,7 @@ func APIFromCodecs(codecs []webrtc.RTPCodecCapability) *webrtc.API {
log
.
Printf
(
"%v"
,
err
)
continue
}
m
.
RegisterCodec
(
err
=
m
.
RegisterCodec
(
webrtc
.
RTPCodecParameters
{
RTPCodecCapability
:
webrtc
.
RTPCodecCapability
{
MimeType
:
codec
.
MimeType
,
...
...
@@ -242,14 +242,18 @@ func APIFromCodecs(codecs []webrtc.RTPCodecCapability) *webrtc.API {
},
tpe
,
)
if
err
!=
nil
{
log
.
Printf
(
"%v"
,
err
)
continue
}
}
return
webrtc
.
NewAPI
(
webrtc
.
WithSettingEngine
(
s
),
webrtc
.
WithMediaEngine
(
&
m
),
)
)
,
nil
}
func
APIFromNames
(
names
[]
string
)
*
webrtc
.
API
{
func
APIFromNames
(
names
[]
string
)
(
*
webrtc
.
API
,
error
)
{
if
len
(
names
)
==
0
{
names
=
[]
string
{
"vp8"
,
"opus"
}
}
...
...
@@ -713,8 +717,8 @@ type Description struct {
// The modtime and size of the file. These are used to detect
// when a file has changed on disk.
modTime
time
.
Time
`json:"-"`
fileSize
int64
`json:"-"`
modTime
time
.
Time
`json:"-"`
fileSize
int64
`json:"-"`
// A user-readable description of the group.
Description
string
`json:"description,omitempty"`
...
...
rtpconn/rtpconn.go
View file @
cd6920d7
...
...
@@ -157,7 +157,10 @@ func (down *rtpDownConnection) getTracks() []*rtpDownTrack {
}
func
newDownConn
(
c
group
.
Client
,
id
string
,
remote
conn
.
Up
)
(
*
rtpDownConnection
,
error
)
{
api
:=
c
.
Group
()
.
API
()
api
,
err
:=
c
.
Group
()
.
API
()
if
err
!=
nil
{
return
nil
,
err
}
pc
,
err
:=
api
.
NewPeerConnection
(
*
ice
.
ICEConfiguration
())
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -463,7 +466,11 @@ func newUpConn(c group.Client, id string, label string, offer string) (*rtpUpCon
return
nil
,
err
}
pc
,
err
:=
c
.
Group
()
.
API
()
.
NewPeerConnection
(
*
ice
.
ICEConfiguration
())
api
,
err
:=
c
.
Group
()
.
API
()
if
err
!=
nil
{
return
nil
,
err
}
pc
,
err
:=
api
.
NewPeerConnection
(
*
ice
.
ICEConfiguration
())
if
err
!=
nil
{
return
nil
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment