After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711664 - Expose the transports list in the rtsp-stream
Expose the transports list in the rtsp-stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal enhancement
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-08 10:21 UTC by Christian Nilsson
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Suggestion for patch to expose the transports list (1.35 KB, patch)
2013-11-08 10:21 UTC, Christian Nilsson
needs-work Details | Review
Second patch, changed to g_list_foreach and copy the object (1.96 KB, patch)
2013-11-12 13:33 UTC, Christian Nilsson
none Details | Review
Third patch proposal (2.17 KB, patch)
2013-11-15 15:12 UTC, Christian Nilsson
none Details | Review

Description Christian Nilsson 2013-11-08 10:21:27 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.
Comment 1 Sebastian Dröge (slomo) 2013-11-11 17:52:46 UTC
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.
Comment 2 Wim Taymans 2013-11-12 11:15:14 UTC
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.
Comment 3 Christian Nilsson 2013-11-12 13:33:30 UTC
Created attachment 259659 [details] [review]
Second patch, changed to g_list_foreach and copy the object
Comment 4 Christian Nilsson 2013-11-12 13:33:57 UTC
Ok, something like second patch?
Not sure about the refcounting when copying the object?
Is g_slice_dup the right way?
Comment 5 Wim Taymans 2013-11-15 14:50:13 UTC
(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()
Comment 6 Christian Nilsson 2013-11-15 14:57:37 UTC
But then I will not create a copy of the object like Sebastian suggested?
Comment 7 Wim Taymans 2013-11-15 15:00:44 UTC
(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.
Comment 8 Christian Nilsson 2013-11-15 15:12:57 UTC
Created attachment 259914 [details] [review]
Third patch proposal
Comment 9 Wim Taymans 2013-11-18 10:20:11 UTC
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
Comment 10 Christian Nilsson 2013-11-19 08:51:33 UTC
Works great! Will you submit it?