Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
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
Alain Takoudjou
sfu
Commits
9c9748b8
Commit
9c9748b8
authored
Apr 27, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unmarshal RTP directly instead of using helper functions.
This avoids allocating a new header each time.
parent
015699a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
client.go
client.go
+9
-1
go.mod
go.mod
+1
-0
No files found.
client.go
View file @
9c9748b8
...
...
@@ -18,6 +18,7 @@ import (
"github.com/gorilla/websocket"
"github.com/pion/rtcp"
"github.com/pion/rtp"
"github.com/pion/sdp"
"github.com/pion/webrtc/v2"
)
...
...
@@ -296,6 +297,7 @@ func addUpConn(c *client, id string) (*upConnection, error) {
go
func
()
{
buf
:=
make
([]
byte
,
1500
)
var
packet
rtp
.
Packet
for
{
i
,
err
:=
remote
.
Read
(
buf
)
if
err
!=
nil
{
...
...
@@ -305,7 +307,13 @@ func addUpConn(c *client, id string) (*upConnection, error) {
break
}
_
,
err
=
local
.
Write
(
buf
[
:
i
])
err
=
packet
.
Unmarshal
(
buf
[
:
i
])
if
err
!=
nil
{
log
.
Printf
(
"%v"
,
err
)
continue
}
err
=
local
.
WriteRTP
(
&
packet
)
if
err
!=
nil
&&
err
!=
io
.
ErrClosedPipe
{
log
.
Printf
(
"%v"
,
err
)
}
...
...
go.mod
View file @
9c9748b8
...
...
@@ -5,6 +5,7 @@ go 1.13
require (
github.com/gorilla/websocket v1.4.2
github.com/pion/rtcp v1.2.1
github.com/pion/rtp v1.4.0
github.com/pion/sdp v1.3.0
github.com/pion/webrtc/v2 v2.2.5
)
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