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.
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.
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
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.
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
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
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
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