• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pions / srtp / 63 / 1
41%
master: 41%

Build:
Build:
LAST BUILD BRANCH: optimize-new-ctr
DEFAULT BRANCH: master
Ran 01 Mar 2019 10:02PM UTC
Files 11
Run time 57min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Mar 2019 09:59PM UTC coverage: 39.681% (-2.2%) from 41.842%
GO111MODULE=on

Pull #13

travis-ci

web-flow
Use batched network writes if supported

Will use batching if net.Conn also implements:
    `WriteBatch(packets [][]byte) (n int, err error)`
    `ReadBatch(packets [][]byte) (n int, err error)`

In this case, `n` is the number of packets read/written, which can be
less than `len(packets)`. This matches how sendmmsg behaves.

In order to support writing multiple packets at once, we either need a
new function or modify the existing API. I'm really not a fan of
`WriteRTP(payload []byte, header *rtp.Packet) (n int, err error)`.

I've replaced it with `WriteRTP(packets ...*rtp.Packet) error` instead
of making a new function. This is a breaking API change but matches the
new webrtc API.

Alongside this change, I have a new version of `encryptRTP` that takes
an `rtp.Packet` instead of `[]byte plaintext`. When used in the
`WriteRTP` pipeline, it avoids an extra header Unmarshal and an extra
payload Marshal (aka copy).

note: This compares new `encryptRTP` and old `EncryptRTP`, which is only
used for `WriteRTP` and not `Write`.

```
EncryptRTP-8         1.93µs ± 1%  1.85µs ± 5%  -3.93%
EncryptRTPInPlace-8  1.90µs ± 3%  1.80µs ± 7%  -5.31%
WriteRTP-8           5.29µs ± 2%  5.28µs ± 1%    ~
```
Pull Request #13: Use batched network writes if supported

323 of 814 relevant lines covered (39.68%)

10.07 hits per line

Source Files on job 63.1 (GO111MODULE=on)
  • Tree
  • List 0
  • Changed 5
  • Source Changed 5
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 53
  • Travis Job 63.1
  • 5896f1ac on github
  • Prev Job for GO111MODULE=on on write-batch (#59.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc