Skip to content

Conversation

@terran-vigil-simplisafe

The createSubscriberPCLocked does not pass Interceptors from e.connParams to the subscriber PeerConnection. Note that createPublisherPCLocked does do this.
This prevents interceptors (in our case, Pion WebRTC stats interceptor) from being applied to the subscriber, causing inbound-rtp statistics to be missing when GetStats() is called on the subscriber PeerConnection.

@anunaym14 anunaym14 requested a review from a team December 30, 2025 20:58
@anunaym14
Copy link
Member

LGTM, but I just want to double-check if this was done intentionally

@terran-vigil-simplisafe
Copy link
Author

LGTM, but I just want to double-check if this was done intentionally

Yes, it was intentional. It was the only way I could see to capture the metrics I needed.

@anunaym14
Copy link
Member

Yes, it was intentional. It was the only way I could see to capture the metrics I needed.

Sorry, I meant if leaving it out of subscriber peer connection in the first place was intentional or not

@terran-vigil-simplisafe
Copy link
Author

Ah, got it thanks :)

@boks1971
Copy link
Contributor

Interceptors are applied as either the default ones or user supplied -

server-sdk-go/transport.go

Lines 171 to 179 in 9ea8d56

if params.Interceptors != nil {
for _, c := range params.Interceptors {
i.Add(c)
}
} else {
err := t.registerDefaultInterceptors(params, i)
if err != nil {
return nil, err
}
.

There are important ones like NACK sender, RTCP reports which are registered as part of default.

The publisher PC case was a specific use case and it is used with no interceptors but API is more generic to have user supplied interceptors.

For stats, it might be better to add another option to specify if the stats interceptor should be registered and register it as part of default interceptor registration if enabled.

@terran-vigil-simplisafe
Copy link
Author

I've updated the PR to include support for an additional param 'IncludeDefaultInterceptors' that does what I think boks1971 suggested. It appears to work in my project when I use the new param.

RetransmitBufferSize uint16
Pacer pacer.Factory
Interceptors []interceptor.Factory
IncludeDefaultInterceptors bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall,

this formatting looks off, can you please check that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants