-
Notifications
You must be signed in to change notification settings - Fork 219
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
rtp argument of RTPRawPacket complicates things #16
Comments
Originally, in RFC 3550, there was a port for the RTP packets and a different port for the RTCP packets, and the flag indicates on which port this packet was received. Now, RTP and RTCP packets can optionally be multiplexed, and to figure out if it's an RTP or RTCP packet one needs to check the second byte: if its value lies between 200 and 204, it's considered to be an RTCP packet, otherwise an RTP packet. Perhaps I should change that boolean to an enum which has 'RTP', 'RTCP' and 'Guess' options, where the first two cause the current behaviour and the third looks at that second byte? |
That would be perfect.
|
After some thought it seemed easier to just add a different constructor which omits that boolean parameter. I've added it in a branch rawpacketguess, does that work for you? |
I've just checked it, works perfectly. |
Ok great, thanks for testing. I've added it to master |
I use JRTPLIB to parse RTP / RTCP packages, and I was wondering if the
rtp
argument of theRTPRawPacket
contructor makes any sense. Normally, this is how I would go about parsing a packet:However, this code fails when
data
represents an RTCP packet: in order to parseraw_packet
as anRTPPacket
, I have to instantiate it withrtp=true
; but then the creation ofrtcp_packet
will fail by default. So effectively ifrtp_packet
could not be created, I need to create another raw packet, this time withrtp=false
, and call theRTCPCompoundPacket
constructor on that.Not only is the process more cumbersome that it should be, with parsing in mind, the parameter doesn't make much sense, because it forces me to make a blind guess about the contents of the packet.
The text was updated successfully, but these errors were encountered: