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
d56628be
Commit
d56628be
authored
May 21, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send FIR when WriteRTP returns ErrKeyframeNeeded.
parent
88fbce26
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
client.go
client.go
+22
-1
conn.go
conn.go
+2
-0
No files found.
client.go
View file @
d56628be
...
...
@@ -471,11 +471,14 @@ func writeLoop(conn *upConnection, track *upTrack, ch <-chan packetIndex) {
local
:=
make
([]
downTrack
,
0
)
firSent
:=
false
for
{
select
{
case
action
:=
<-
track
.
localCh
:
if
action
.
add
{
local
=
append
(
local
,
action
.
track
)
firSent
=
false
}
else
{
found
:=
false
for
i
,
t
:=
range
local
{
...
...
@@ -505,16 +508,34 @@ func writeLoop(conn *upConnection, track *upTrack, ch <-chan packetIndex) {
continue
}
kfNeeded
:=
false
for
_
,
l
:=
range
local
{
err
:=
l
.
WriteRTP
(
&
packet
)
if
err
!=
nil
{
if
err
!=
io
.
ErrClosedPipe
{
if
err
==
ErrKeyframeNeeded
{
kfNeeded
=
true
}
else
if
err
!=
io
.
ErrClosedPipe
{
log
.
Printf
(
"WriteRTP: %v"
,
err
)
}
continue
}
l
.
Accumulate
(
uint32
(
bytes
))
}
if
kfNeeded
{
err
:=
conn
.
sendFIR
(
track
,
!
firSent
)
if
err
==
ErrUnsupportedFeedback
{
err
:=
conn
.
sendPLI
(
track
)
if
err
!=
nil
&&
err
!=
ErrUnsupportedFeedback
{
log
.
Printf
(
"sendPLI: %v"
,
err
)
}
}
else
if
err
!=
nil
{
log
.
Printf
(
"sendFIR: %v"
,
err
)
}
firSent
=
true
}
}
}
}
...
...
conn.go
View file @
d56628be
...
...
@@ -241,6 +241,8 @@ func (s *receiverStats) Get(now uint64) (uint8, uint32) {
return
uint8
(
atomic
.
LoadUint32
(
&
s
.
loss
)),
atomic
.
LoadUint32
(
&
s
.
jitter
)
}
var
ErrKeyframeNeeded
=
errors
.
New
(
"keyframe needed"
)
type
downTrack
interface
{
WriteRTP
(
packat
*
rtp
.
Packet
)
error
Accumulate
(
bytes
uint32
)
...
...
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