Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds WithPacketHeadHandler to SampleBuilder #1967

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

digitalix
Copy link
Member

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
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.05% ⚠️

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%) ⬇️
wasm 70.23% <100.00%> (+0.07%) ⬆️

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%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der
Copy link
Member

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?

@digitalix
Copy link
Member Author

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.

@jech
Copy link
Member

jech commented Oct 30, 2021

I think it's pretty smart.

@Sean-Der
Copy link
Member

Sean-Der commented Aug 2, 2023

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.

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.
@Sean-Der Sean-Der merged commit 7c60bb9 into pion:master Aug 2, 2023
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants