Commit Graph

33 Commits

Author SHA1 Message Date
Sean DuBois
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
digitalix
7c60bb96f3 Adds WithPacketHeadHandler to SampleBuilder
This option allows inspecting head packet for
each media.Sample and then lets the user return
their custom metadata. This might be useful
in case when you need to check whether the
given sample is a keyframe.
2023-08-02 14:16:11 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Pion
308f8616a3 Update CI configs to v0.10.6
Update lint scripts and CI configs.
2023-04-08 14:24:19 -04:00
Juliusz Chroboczek
fad7214193 Adapt samplebuilder new depacketizer in pion/rtp
Both partition head and tail checking is now done in the
depacketizer.  For backwards compatibility, there are stubs
for PartitionHeadChecker and WithPartitionHeadChecker that do
nothing; these should be removed for 4.0.

This also fixes a bug with the depacketizer: if no head checker
was present, every packet would be considered as a potential
partition head, even if it was at the beginning of the buffer.
Since a partition head checker is now always present, the bug
cannot happen.

The tests assume the old bug, which is why the fakePacketizer
returns true if headBytes is empty.  It would be better to adapt
the tests to do the right thing, as in jech/depacketizer.
2021-08-23 11:22:53 -04:00
Sean DuBois
cffa6afc34 Rollback pion/rtp to v0
Resolves #1908
2021-08-02 18:05:45 -04:00
Sean DuBois
a67c66a0c5 Upgrade pion/rtp to v2
Also updates interceptor and srtp
2021-07-29 11:18:41 -04:00
Robin Raymond
36cf39516f Fix: sample builder test always returns data
Wrap around issue caused backup of packets in sample builder.
2021-07-12 12:27:14 -04:00
Juliusz Chroboczek
11f6a65fe2 Avoid crash in samplebuilder.PopWithTimestamp
If sample is null, PopWithTimestamp will crash with SIGSEGV.
2021-06-20 14:40:24 -04:00
Robin Raymond
f7f760f8c6 Fix infinitate loop possible in sample builder
Active becomes "empty" after consuming the packets, but instead of the
"filled" getting purged by "purgeConsumedBuffers", it doesn't because
active is now empty and empty buffers cannot cause any purging. So the
solution is to purge the "consumed" area first, then "active".

Fixes #1810
2021-05-26 11:28:17 -04:00
Robin Raymond
7d97c9b5d3 Refactored samplebuilder logic
Many corner cases would cause samplebuilder to fail and return invalid
results. This refactoring is more reliable in all cases.

Fixed bug in H264 writer by reusing the packet object in  H264 writer.
2021-05-06 15:14:21 -04:00
Sean DuBois
91935c7d5b Use nanosecond instead of Millisecond precision
media.SampleBuilder would round time and was breaking audio samples that
required higher precision. This was seen only with alaw/ulaw that needed
microsecond precision. v3 had only been used with Opus so far.

Resolves #1640
2021-01-17 16:02:55 -08:00
mission-liao
f484fcbf6b Add option to add hook for packets released
This hook allow us to recycle the packet buffer via sync.Pool.
2020-12-03 09:49:28 -08:00
OrlandoCo
eef91ea5ac Fix media sample duration calculation
Add float casting to time duration calculation to get correct result
2020-12-02 22:02:36 -08:00
Sean DuBois
7edfb701e0 New Track API
The Pion WebRTC API has been dramatically redesigned. The design docs
are located here [0]

You can also read the release notes [1] on how to migrate your
application.

[0] https://github.com/pion/webrtc-v3-design
[1] https://github.com/pion/webrtc/wiki/Release-WebRTC@v3.0.0
2020-11-15 09:20:47 -08:00
Sean DuBois
ae5c1224ba Add note around memory ownership for SampleBuilder
The SampleBuilder doesn't copy. If you wish to modify the memory that
was passed you should copy it first.

Relates to pion/rtp#88
2020-09-16 20:18:15 -07:00
Atsushi Watanabe
020aebd5f4 Fix SampleBuilder packet unref
It unexpectedly unreferenced all packets
when sequence number is decreased more than 2.
2020-07-07 21:59:54 -07:00
Sean DuBois
89d7de1787 Start /v3
See #9 for the features we have planned, and the breaking changes that
may occur.
2020-06-25 09:45:27 -07:00
Atsushi Watanabe
06156ba2be Unreference garbage in SampleBuilder buffer
SampleBuilder held reference to outdated packets when
the SequenceNumber is jumped.
2020-06-22 13:03:10 +09:00
Josh Bleecher Snyder
feed5e66cb Overhaul the samplebuilder docs
Use complete sentences, with periods.
Explain all parameters.
Cross-reference other useful packages.
2020-06-08 21:23:47 -07:00
Atsushi Watanabe
b361a21c54 Detect partition head in SampleBuilder
Add functional option to set PartitionHeadChecker to detect the
beginning of the frame partition and avoid dropping the first
packet.
2020-01-30 13:39:38 +09:00
Atsushi Watanabe
27d9bbb7bd Upgrade golangci-lint to 1.19.1
Fix whitespace and stylecheck errors.
Disable godox.
2020-01-11 22:59:33 -08:00
Atsushi Watanabe
1d69a90d23 Fix seqnum distance in SampleBuilder
Fix overflow and underflow handling.
2019-12-19 10:24:32 +09:00
Atsushi Watanabe
accfca4575 Add SampleBuilder.PopWithTimestamp
PopWithTimestamp function is added to provide RTP timestamp
of the sample.
This makes it possible to detect frame drops in user application.
2019-12-14 20:35:52 +09:00
Hugo Arregui
6997cc792c Linter fixes
Disable funlen and some fixes

Co-authored-by: Sean DuBois <sean@siobud.com>
2019-09-10 21:48:25 -07:00
Sean DuBois
5e8e1f0869 Bump pion/rtp and pion/srtp
Update rtp.Depacketizer interface to match VP8 and H264 codec
2019-05-07 00:52:18 -07:00
Sean DuBois
dbde6114a2 Update import paths
Add /v2 to import paths everywhere
2019-04-07 02:17:15 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Max Hawkins
0e7086d37a Remove RTC prefix from all names
Let's pull off the bandaid!

* Reduces studdering: webrtc.RTCTrack -> webrtc.Track
* Makes it easier to find types by editor autocomplete
* Makes code read more fluently (less repetition)

Since we're breaking the API in 2.0, our only chance to
do this is now.

Relates to #408
2019-02-17 16:22:56 -08:00
Sean DuBois
5efb6b0b7f Fix SampleBuilder not respecting maxLate
SampleBuilder now respects maxLate after a buffer have been popped
2019-02-14 22:39:02 -08:00
Sean DuBois
2863555984 Export RTP/RTCP to unique packages
Resolves #272
2019-01-28 11:38:54 -08:00
Sean DuBois
f7c4fea4f5 Add RTP Depackatization to SampleBuilder
When constructing a SampleBuilder the caller now passes in a
Depacketizer. This allows the SampleBuilder to take a RTP packet
to a sample. This wasn't possible before because RTP payloads may carry
codec specific metadata in the payloads that need to be stripped

Relates to #63
2018-09-22 16:58:10 -07:00
Sean DuBois
e500917a6e Implement SampleBuilder
SampleBuilder provides a simple API to build an
RTCSample from RTP packets. This is useful when proxying
audio/video data to multiple peers. This is the alternative
to allowing users to push RTP Packets directly. This would be
confusing as we would throw away some of the information that users
give us and could lead to weird edge cases

Resolves #112
2018-09-09 23:16:19 -07:00