GNOME Bugzilla – Bug 711664
Expose the transports list in the rtsp-stream
Last modified: 2014-02-25 22:28:15 UTC
Created attachment 259243 [details] [review] Suggestion for patch to expose the transports list It is now possible to both add and remove transports from an rtsp-stream. But it is not possible to fetch the list. It would be useful to fetch the list to get connection information for a stream.
Review of attachment 259243 [details] [review]: ::: gst-rtsp-server/gst/rtsp-server/rtsp-stream.c @@ +2005,3 @@ + * @stream must be joined to a bin. + * + * Returns: A GstRTSPStreamTransport Returning a GList is never really nice... but in any case this is missing annotations for the element type: (element-type GstRTSPStreamTransport) and about ownership (should probably be const, and (transfer none)). However GstRTSPStream needs locking for access of this list, so you should return a copy and also copy the elements. That would make it (transfer full) then and not const. Otherwise this wouldn't be threadsafe at all.
I would like to see a filter function then that does a callback for each transport and that allows you to remove, ref or keep the transport in the lists.
Created attachment 259659 [details] [review] Second patch, changed to g_list_foreach and copy the object
Ok, something like second patch? Not sure about the refcounting when copying the object? Is g_slice_dup the right way?
(In reply to comment #4) > Ok, something like second patch? > Not sure about the refcounting when copying the object? > Is g_slice_dup the right way? It should be g_object_ref()
But then I will not create a copy of the object like Sebastian suggested?
(In reply to comment #6) > But then I will not create a copy of the object like Sebastian suggested? That's correct, you should increase the refcount.
Created attachment 259914 [details] [review] Third patch proposal
this is what I had in mind: commit a106950f7089a2a4b133d70dd79f2106e4c012bd Author: Wim Taymans <wim.taymans@gmail.com> Date: Mon Nov 18 11:18:15 2013 +0100 stream: add method to filter transports Add a method to safely iterate and collect the stream transports Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711664
Works great! Will you submit it?