libdatachannel icon indicating copy to clipboard operation
libdatachannel copied to clipboard

Depacketizer for Track

Open paullouisageneau opened this issue 2 years ago • 10 comments

It would be useful to introduce a media handler to depacketize the incoming RTP stream, with a jitter buffer to reorder packets and pace reassembled frames.

paullouisageneau avatar Jul 12 '22 21:07 paullouisageneau

@paullouisageneau I am going to start working on this.

Do you have any suggestions/rough sketch of an API you would like? I can get a PR together this weekend.

thank you!

Sean-Der avatar Oct 20 '23 04:10 Sean-Der

Thanks! I've no very precise API in mind, I think something like a generic media handler implementing the jitter buffer part, an another one specialized per codec implementing the depacketization part would make sense.

paullouisageneau avatar Oct 21 '23 00:10 paullouisageneau

Hey @paullouisageneau I don't know the best way to do this. Can I get some guidance?

I don't see a way I can use RtcpReceivingSession because it is a MediaHandler.

Should I wrote something that allows a MediaHandler to be used as a MediaHandlerElement ?

Then I can contribute a JitterBuffer that is a MediaHandlerElement and chain them.

Sean-Der avatar Nov 01 '23 03:11 Sean-Der

@Sean-Der I've merged https://github.com/paullouisageneau/libdatachannel/pull/929 which refactors and drastically simplifies media handlers. It should solve this kind of issue, as now everything is a MediaHandlerand you can simply chain MediaHandler instances together. It keeps compatibility with user code as long as it doesn't implement a custom MediaHandler.

The methods are also simpler, taking a vector of messages that may be modified in-place by the handler.

paullouisageneau avatar Nov 01 '23 09:11 paullouisageneau

Hey @paullouisageneau I don't know the best way to do this. Can I get some guidance?

I don't see a way I can use RtcpReceivingSession because it is a MediaHandler.

Should I wrote something that allows a MediaHandler to be used as a MediaHandlerElement ?

Then I can contribute a JitterBuffer that is a MediaHandlerElement and chain them.

What is the current status of WHEP?@Sean-Der

flying1314 avatar Nov 29 '23 03:11 flying1314