GNOME Bugzilla – Bug 783307
rtspsrc: uniquify stream ids
Last modified: 2017-06-16 15:31:24 UTC
Following up on https://bugzilla.gnome.org/show_bug.cgi?id=783261, this is an alternate proposal for providing unique and stable stream ids for a given rtsp source.
Created attachment 352976 [details] [review] rtspsrc: uniquify stream ids
Review of attachment 352976 [details] [review]: That should work indeed. (please answer the question still :) ::: gst/rtsp/gstrtspsrc.c @@ +1509,3 @@ + gchar *stream_id = g_strdup_printf ("%s%d%d%s%d", media->media, media->port, + media->num_ports, media->proto, stream->default_pt); + gchar *res = g_compute_checksum_for_string (G_CHECKSUM_MD5, stream_id, -1); Why do you make a checksum of it?
Review of attachment 352976 [details] [review]: ::: gst/rtsp/gstrtspsrc.c @@ +1509,3 @@ + gchar *stream_id = g_strdup_printf ("%s%d%d%s%d", media->media, media->port, + media->num_ports, media->proto, stream->default_pt); + gchar *res = g_compute_checksum_for_string (G_CHECKSUM_MD5, stream_id, -1); Because some of these elements may contain forward slashes (proto in particular)
Attachment 352976 [details] pushed as f6283b0 - rtspsrc: uniquify stream ids
Review of attachment 352976 [details] [review]: ::: gst/rtsp/gstrtspsrc.c @@ +1509,3 @@ + gchar *stream_id = g_strdup_printf ("%s%d%d%s%d", media->media, media->port, + media->num_ports, media->proto, stream->default_pt); + gchar *res = g_compute_checksum_for_string (G_CHECKSUM_MD5, stream_id, -1); That's not really a reason, please don't use a checksum here as it makes debugging harder. There's nothing disallowing usage of / in stream IDs, but feel free to just replace / with some other character if it annoys you too much.
Mathieu?
OK I'll change that, I don't really see how it would make debugging any harder though ?
If you see some random hash in the stream-id, you have no idea where that actually comes from. Otherwise you can reconstruct which RTSP stream you actually have there easily.
Created attachment 353849 [details] [review] rtspsrc: do not checksum the stream id
Review of attachment 353849 [details] [review]: Go?
Looks good to me
Comment on attachment 353849 [details] [review] rtspsrc: do not checksum the stream id Attachment 353849 [details] pushed as 0da5679 - rtspsrc: do not checksum the stream id