Strings to enums#25
Conversation
d9257ff to
5286f1a
Compare
5286f1a to
5d0d703
Compare
|
clippy should be clean if you rebase on top of latest main |
703493f to
a9c14b7
Compare
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.
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.
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.
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.
Thanks. ffmpeg is wrong to not add it of course, specifying the clock rate in the SDP is not optional.
cac7add to
149ece4
Compare
149ece4 to
56ef12c
Compare
and write new methods to access the parsed SDP members as enums
56ef12c to
5650189
Compare
- move the enums and attribute structs to separate files - define different types of attributes errors and expose them as enum variants so they can be type matched by the application
- improve Display impl everywhere to use write!() intead of reallocation - use .eq_ignore_ascii_case to compare strings
5650189 to
7f532fc
Compare
7f532fc to
2a3f190
Compare
Fixes #1