Is your feature request related to a problem? Please describe.
There's currently no way to intercept, modify, or inject custom encoders, transform packets, or interoperate into the RTP/RTCP packet processing pipeline. This prevents implementing:
Enhanced monitoring (inspect packet-level metrics (jitter, packet loss patterns, RTT)) , Custom FEC (forward error correction) schemes , Research and experimentation (Cannot prototype new RTP extensions or RTCP feedback mechanisms)
Describe the solution you'd like
Expose RTP/RTCP send and receive hooks via a MediaStreamTrack or RtpTransceiver API. This should allow access to RtpReceiver and RtpSender transport streams .
Implement a pluggable interceptor framework similar to Pion's interceptor package, allowing developers to insert custom processing logic into the media pipeline:
Interceptor Interface:
interfaceInterceptor {
// Called for each outgoing RTP packetRTCRtpPacketinterceptRTP(RTCRtpPacketpacket, RTCRtpSendersender);
// Called for each incoming RTP packetRTCRtpPacketinterceptIncomingRTP(RTCRtpPacketpacket, RTCRtpReceiverreceiver);
// Called for outgoing RTCP packetsRTCRtcpPacketinterceptRTCP(RTCRtcpPacketpacket);
// Called for incoming RTCP packetsRTCRtcpPacketinterceptIncomingRTCP(RTCRtcpPacketpacket);
}Interceptor Chain Management:
interfaceInterceptorRegistry {
voidadd(Interceptorinterceptor);
voidremove(Interceptorinterceptor);
List<Interceptor> getInterceptors();
}
// UsagepeerConnection.getInterceptorRegistry().add(newCustomInterceptor());Built-in Interceptors: Provide commonly-needed interceptors:
Packet Access Objects: Expose packet structures:
classRTCRtpPacket {
RTCRtpHeaderheader;
byte[] payload;
List<RTCRtpHeaderExtension> extensions;
}
classRTCRtpHeader {
intpayloadType;
intsequenceNumber;
longtimestamp;
longssrc;
List<Long> csrcs;
}
Describe alternatives you've considered
Tried to implement own interface but due to local dev complications with webrtc code base and JNI complexity but ran into a wall trying to do this , hence this request .
Additional context
Interceptors are essential for building production-grade WebRTC applications that need observability and control
Pion WebRTC's interceptor framework: github.com/pion/interceptor
Key specifications:
Direct packet access enables advanced analytics, media transformation, and interoperability.
Is your feature request related to a problem? Please describe.
There's currently no way to intercept, modify, or inject custom encoders, transform packets, or interoperate into the RTP/RTCP packet processing pipeline. This prevents implementing:
Enhanced monitoring (inspect packet-level metrics (jitter, packet loss patterns, RTT)) , Custom FEC (forward error correction) schemes , Research and experimentation (Cannot prototype new RTP extensions or RTCP feedback mechanisms)
Describe the solution you'd like
Expose RTP/RTCP send and receive hooks via a MediaStreamTrack or RtpTransceiver API. This should allow access to RtpReceiver and RtpSender transport streams .
Implement a pluggable interceptor framework similar to Pion's interceptor package, allowing developers to insert custom processing logic into the media pipeline:
Interceptor Interface:
Interceptor Chain Management:
Built-in Interceptors: Provide commonly-needed interceptors:
Packet Access Objects: Expose packet structures:
Describe alternatives you've considered
Tried to implement own interface but due to local dev complications with webrtc code base and JNI complexity but ran into a wall trying to do this , hence this request .
Additional context
Interceptors are essential for building production-grade WebRTC applications that need observability and control
Pion WebRTC's interceptor framework: github.com/pion/interceptor
Key specifications:
Direct packet access enables advanced analytics, media transformation, and interoperability.