webrtc
webrtc copied to clipboard
Adds WithPacketHeadHandler to SampleBuilder
Description
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.
Codecov Report
Patch coverage: 100.00% and project coverage change: -0.05% :warning:
Comparison is base (
b40f599) 77.60% compared to head (37d9288) 77.56%.
Additional details and impacted files
@@ Coverage Diff @@
## master #1967 +/- ##
==========================================
- Coverage 77.60% 77.56% -0.05%
==========================================
Files 87 87
Lines 9365 9374 +9
==========================================
+ Hits 7268 7271 +3
- Misses 1667 1672 +5
- Partials 430 431 +1
| Flag | Coverage Δ | |
|---|---|---|
| go | 79.32% <100.00%> (-0.05%) |
:arrow_down: |
| wasm | 70.23% <100.00%> (+0.07%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files Changed | Coverage Δ | |
|---|---|---|
| pkg/media/samplebuilder/samplebuilder.go | 95.71% <100.00%> (+0.19%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @digitalix Sorry this took so long.
I see how this is useful! You are interested in the RTP Payload Header, but are just getting samples.
interface{} in+out feels wrong to me. What if we could find a way to expose Unmarshaled packet headers (but not payloads?) Like VP9Packet
@jech you have opinions on the SampleBuilder. What do you think of the problem?
Hey @digitalix Sorry this took so long.
I see how this is useful! You are interested in the RTP Payload Header, but are just getting samples.
interface{}in+out feels wrong to me. What if we could find a way to expose Unmarshaled packet headers (but not payloads?) Like VP9Packet@jech you have opinions on the SampleBuilder. What do you think of the problem?
You're right @Sean-Der with interface{} as in+out. Hmm... As in we could use rtp.Depacketizer but I'd prefer to create an alias for it e.g.MediaPacket.
For out we could split VP9Packet (and others) into VP9Packet and VP9PacketHeader that would be embedded within VP9Packet.
I think it's pretty smart.
Merging!
Sorry this took so long @digitalix. The usage of interface{} I think totally makes sense here.
Users are supplying this data anyway. I think it would be worse for us to force a shape.