-
Notifications
You must be signed in to change notification settings - Fork 12
Strings to enums #25
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
base: main
Are you sure you want to change the base?
Strings to enums #25
Conversation
sdroege
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good to me
d9257ff to
5286f1a
Compare
5286f1a to
5d0d703
Compare
|
clippy should be clean if you rebase on top of latest main |
703493f to
a9c14b7
Compare
0790c2d to
017b97f
Compare
and write new methods to access the parsed SDP members as enums
02ea209 to
b7942a5
Compare
| /// Payload type, a numerical value between 0 and 127 | ||
| pub pt: u8, | ||
| /// Name of the encoding | ||
| // TODO: is it useful to have an enum for all known encoding? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially useful, just like for the registered payload types. But in this struct here, a string / u8 is the correct thing. You could have functions on the struct that try to handle pt / encoding with those enums though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/blob/44a632811e6718909409b5c229508072a1447e62/net/rtsp/src/rtspsrc/sdp.rs#L215 basically having guess_rtpmap_from_pt() and guess_rtpmap_from_encoding_name() here in some form seems useful.
@nirbheek Do you remember why your code allows rtpmap without clock-rate? The SDP RFC does not allow that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are payload types for which clock-rate is static, and tools like ffmpeg won't add the clock-rate in those cases. For example pt=10/11 (L16 2ch/1ch), see table in https://en.wikipedia.org/wiki/RTP_payload_formats#Audio_and_video_payload_types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. ffmpeg is wrong to not add it of course, specifying the clock rate in the SDP is not optional.
b7942a5 to
efef672
Compare
efef672 to
5fa4206
Compare
d7c780b to
cd27d00
Compare
I wonder why the other tests or my local build did not report this error |
Because you don't build with Rust 1.65 |
|
So is it a shortcoming of Rust 1.65? Why do we have a test with that specific version? |
|
Because that's the minimum version supported here |
cd27d00 to
69822f2
Compare
Fixes #1