Commit Graph

283 Commits

Author SHA1 Message Date
cnderrauber
4c1af4c3e6 H265 reader & writer
H265 raeder & writer
2025-06-30 16:14:49 +08:00
Joe Turki
22dd7b733b Replace interface{} with any 2025-06-19 23:44:08 +03:00
Joe Turki
740e5166c5 Update lint rules, force testify/assert for tests
Use testify's assert package instead of the standard library's testing
package.
2025-03-27 12:08:37 +02:00
Joe Turki
8f8c2322fb Refactor Ivfwriter.WriteRTP implemention
Break the WriteRTP function into smaller functions for each codec type.
2025-03-01 23:52:40 +02:00
Joe Turki
fd7fe3fbce Fix AV1 IVF writer using RTP depacketizer
1. Replaced the OBU reader with the AV1 depacketizer to actually handle
RTP input.
2. Now explicitly constructing OBUTemporalDelimiter to ensure proper
separation of frames.
2025-03-01 23:36:07 +02:00
Sean DuBois
70d06fd9f6 Fix ivfwriter with VP9
Use the correct values for timestamps
2025-02-12 22:26:31 -05:00
Kevin Wang
bea7ae3745 Add ivfwriter support for VP9
Adds the necessary wiring to get VP9 to work with `ivfwriter`.
Update the README of save-to-disk to inform users it supports
both VP8 and VP9.
    
ivfwriter currently assumes 30 fps but it seems that the other codecs
also assume 30 fps so that is not a net-new assumption.
2025-02-12 16:06:41 -05:00
Sean DuBois
1c45355b8c Fix H264Writer writing 0 length payloads
Before we would call Write even if no bytes were available.
2025-02-11 14:57:36 -05:00
Joe Turki
feeeebf251 Upgrade golangci-lint, more linters
Introduces new linters, upgrade golangci-lint to version (v1.63.4)
2025-01-18 07:16:06 -06:00
Xavier Drudis
cdacd1c3b0 Rewrite VP8 isKeyFrame check (#2999)
#### Description
[RFC 6386](https://www.rfc-editor.org/rfc/rfc6386#section-9.1) describes
the least significant bit of the first byte of the header as:
```
A 1-bit frame type (0 for key frames, 1 for interframes).
```

The change is functionally a no-op, but the naming implies the wrong
logic (you would assume `isKeyFrame == 1` means it is a key frame, but
the opposite is true).

#### Reference issue
Fixes #...
2025-01-11 21:32:28 -08:00
Xavier Drudis
1ee02999eb Defense against timebase with denominator 0 2025-01-02 15:33:18 -05:00
Xavier Drudis
40358b3d1e Defense against timebase with denominator 0 2025-01-02 15:33:18 -05:00
Xavier Drudis
d5e07a1bcf Restore relative timestamp 2025-01-02 15:33:18 -05:00
Xavier Drudis
04b46212a9 Nits 2025-01-02 15:33:18 -05:00
Xavier Drudis
31d8dbc720 Fix IVF timestamps 2025-01-02 15:33:18 -05:00
Xavier Drudis
8b3734e5d3 Revert "Adapt an existing test to provide coverage"
This reverts commit dbe26d34d8.
2025-01-02 15:33:18 -05:00
Xavier Drudis
0ae39fd72a Revert "IVF writer fix invalid timestamp into headers"
This reverts commit 4f40756d9c.
2025-01-02 15:33:18 -05:00
Sean DuBois
bb41f23a0f Don't use JitterBuffer in SampleBuilder
The performance of the SampleBuilder is significantly worse when using
the SampleBuilder. It would be good to evaluate improving the
performance of the JitterBuffer. However for the time being we are just
going to revert.

Resolve #2778
2024-10-10 21:18:56 -04:00
Sean DuBois
4541b73b1a Add Retransmission and FEC to TrackLocal
If the MediaEngine contains support for them a SSRC will be generated
appropriately

Co-authored-by: aggresss <aggresss@163.com>
Co-authored-by: Kevin Wang <kevmo314@gmail.com>

Resolves #1989
Resolves #1675
2024-10-03 20:44:49 -07:00
Atsushi Watanabe
c4d56d4759 SampleBuilder: add memory leak test
Test that the input RTP packets are unreferenced
after all samples are popped.
2024-08-07 00:22:20 -04:00
Radek Gruchalski
dbe26d34d8 Adapt an existing test to provide coverage 2024-08-05 11:05:46 -04:00
Radek Gruchalski
4f40756d9c IVF writer fix invalid timestamp into headers 2024-08-05 11:05:46 -04:00
Konstantin
fc3521e85c Track bytesReadSuccesfully in oggreader 2024-06-25 12:21:48 -04:00
hongkuang
bd25613af2 Fix typos across the project 2024-04-07 21:48:29 -04:00
Rob Elsner
c47f89065c SampleBuilder: Port to use jitter buffer 2024-03-25 21:42:30 -04:00
pengqiseven
94ac7794eb Fix gramatical errors in comments
Removes repetitive words
2024-03-16 21:15:04 -04:00
Sean DuBois
fda6c4f836 Fix linter errors
golangci-lint upgrade to v1.56.2 added more checks

Relates to pion/.goassets#201
2024-03-16 21:09:38 -04:00
Atsushi Watanabe
34f44c978e SampleBuilder: Remove WithPartitionHeadChecker
Deprecated by https://github.com/pion/webrtc/pull/1928

BREAKING CHANGE: samplebuilder.WithPartitionHeadChecker
                 option is removed.
2024-03-14 11:22:43 +09:00
Atsushi Watanabe
c43183890f SampleBuilder: Remove PopWithTimestamp
Use Sample.PacketTimestamp field instead.

Migration example:
- sample, timestamp := s.PopWithTimestamp()
+ sample := s.Pop()
+ timestamp := sample.PacketTimestamp

BREAKING CHANGE: SampleBuilder.PopWithTimestamp method is removed
2024-03-14 11:22:43 +09:00
Atsushi Watanabe
3f6d94a4fc SampleBuilder: Add option to return RTPHeaders
Replaces fa1f5d91 which returned only a head packet's header.
When the option WithRTPHeaders is set, SampleBuilder returns
RTP headers of the packets forming the sample as Sample.RTPHeaders.
2024-03-07 12:46:52 +09:00
Atsushi Watanabe
09a4f60c4a SampleBuilder: Add Flush method
Flush marks all valid samples in the buffer to be popped.
Useful for graceful shutdown without losing buffered data
as much as possible.
2024-02-28 10:32:32 -05:00
Atsushi Watanabe
fa1f5d913d SampleBuilder: Return header of sample head packet
To get RTP extension data associated with the sample.
2024-02-28 14:52:20 +09:00
renovate[bot]
486f54c970 Update module github.com/pion/rtp to v1.8.2
Generated by renovateBot
2023-09-25 15:03:38 +00:00
Tristan Matthews
14eb615879 Samplebuilder: Properly handle padding packets
Resolves #2323
2023-09-15 19:39:36 -04:00
Sean DuBois
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
streamer45
f0dc0db861 OggWriter: add packet segmentation 2023-08-21 00:20:32 -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
mr-shitij
789623a7f7 Update code to be more Go idiomatic
No functional changes
2022-10-31 23:51:17 -04:00
Pion
c1467e4871 Update CI configs to v0.7.2
Update lint scripts and CI configs.
2022-04-27 23:00:19 -04:00
Sean DuBois
315bbfa723 Add AV1 Support
Also include example

Resolves #1670
2022-04-12 10:20:00 -04:00
Leslie Wang
9346f0d133 Return actual error during h264 stream read
current h264reader will not return actual error, thus, as a user, I
don't know error is caused by EOF, or socket close, or other failures.
The fix will return the error to caller for debugging and
troubleshooting
2022-03-15 13:42:48 -04:00
Leslie Wang
659653a5a3 Pre-allocate buffer for H264Reader.read
Use one temp buffer per H264Reader instead of allocating every read
call.
2022-03-10 22:53:13 -05:00
Mathis Engelbart
1eb3d4ca8d Fix media WriteRTP with empty RTP packet
github.com/pion/rtp to v1.7.4 fixed the parsing of padding bytes as
media payload. This fix skips over RTP packets with an empty payload,
such as unmarshalled padding only packets.
2021-10-27 10:03:11 -04:00
Artur Shellunts
3bc0dacdfd Use Reader instead of ReadSeeker in OggReader
Seek is not used. Also it makes not possible to use
OggReader for network streams.
2021-10-22 04:04:49 -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
Pieere Pi
4a6f223846 Support Single NAL unit packetization
H264Writer before only supported payloads that were packetized with
STAP-A. Now we support STAP-A and NALs directly in the RTP Payloads.
2021-08-03 16:39:03 -04:00
Pieere Pi
d1d40c0aef Fix invalid read in H264Reader
If the first byte after the nalu start code is 0x01, there is a panic.
Reset reader.countOfConsecutiveZeroBytes after nal is found.
2021-08-03 16:39:03 -04:00
Sean DuBois
cffa6afc34 Rollback pion/rtp to v0
Resolves #1908
2021-08-02 18:05:45 -04:00