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
dd4dbeae
Commit
dd4dbeae
authored
Aug 01, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spatial scalability support.
Only used as a last-resort fallback.
parent
efb298f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
rtpconn/rtpconn.go
rtpconn/rtpconn.go
+12
-1
No files found.
rtpconn/rtpconn.go
View file @
dd4dbeae
...
...
@@ -304,21 +304,32 @@ func (t *rtpDownTrack) GetMaxBitrate() (uint64, int, int) {
return
r
,
int
(
layer
.
sid
),
int
(
layer
.
tid
)
}
// adjustLayer checks the allowable bitrate reported for a down track and
// adjusts the layer by one step. It prefers temporal layers, and only
// uses spatial layers as a last resort.
func
(
t
*
rtpDownTrack
)
adjustLayer
()
{
max
,
_
,
_
:=
t
.
GetMaxBitrate
()
r
,
_
:=
t
.
rate
.
Estimate
()
rate
:=
uint64
(
r
)
*
8
if
rate
<
max
*
7
/
8
{
// switch up
layer
:=
t
.
getLayerInfo
()
if
layer
.
tid
<
layer
.
maxTid
{
if
layer
.
sid
<
layer
.
maxSid
{
layer
.
wantedSid
=
layer
.
sid
+
1
t
.
setLayerInfo
(
layer
)
}
else
if
layer
.
tid
<
layer
.
maxTid
{
layer
.
wantedTid
=
layer
.
tid
+
1
t
.
setLayerInfo
(
layer
)
}
}
else
if
rate
>
max
*
3
/
2
{
// switch down
layer
:=
t
.
getLayerInfo
()
if
layer
.
tid
>
0
{
layer
.
wantedTid
=
layer
.
tid
-
1
t
.
setLayerInfo
(
layer
)
}
else
if
layer
.
sid
>
0
{
layer
.
wantedSid
=
layer
.
sid
-
1
t
.
setLayerInfo
(
layer
)
}
}
}
...
...
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