webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Adds WithPacketHeadHandler to SampleBuilder

Open digitalix opened this issue 4 years ago • 4 comments

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.

digitalix avatar Sep 22 '21 14:09 digitalix

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:

... and 3 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 22 '21 14:09 codecov[bot]

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?

Sean-Der avatar Oct 30 '21 00:10 Sean-Der

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.

digitalix avatar Oct 30 '21 01:10 digitalix

I think it's pretty smart.

jech avatar Oct 30 '21 14:10 jech

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.

Sean-Der avatar Aug 02 '23 17:08 Sean-Der