GNOME Bugzilla – Bug 723910
Update gstreamer-rtsp-server bindings
Last modified: 2014-06-29 07:50:53 UTC
Created attachment 268504 [details] [review] missmatch api I have found an api bug in .vapi files. /home/sringel/build/gnome-dvb-deamon/gnome-dvb-daemon/src/rtsp/Server.c:487:2: Fehler: Zu wenige Argumente für Funktion »gst_rtsp_session_get_media«
The first issue your patch address (Gst.Iterator.find_custom) is a duplicate of #685231, which has a better solution proposed but is waiting on feedback. For the second issue (Gst.RTSPSession.get_media), it looks like the API changed recently (http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/commit/?id=5a833f503eb22a25b73646d9a82ecc3f0e9406f9) in a backwards-incompatible way, and we just have to update the binding. AFACT gst-rtsp-server wasn't supposed to be API-stable before 1.2, but unfortunately there are some other issues preventing us from updating the gstreamer bindings to 1.2.
I need this change for parting gnome_dvb_deamon.
We're working on it. Currently blocked on https://bugs.freedesktop.org/show_bug.cgi?id=74000
Created attachment 276325 [details] [review] missmatch api (In reply to comment #3) > We're working on it. Currently blocked on > https://bugs.freedesktop.org/show_bug.cgi?id=74000 We cannot wait til a future time point. That patch is needed for gnome-dvb-daemon. Look to https://bugzilla.gnome.org/show_bug.cgi?id=725230 .
Comment on attachment 276325 [details] [review] missmatch api This should be three patches (and three separate bugs): 1) Change the Gst.Iterator.find_custom binding. This is actually an issue with the annotations in gstreamer (that parameter should not be annotated with (closure)), but it could also be made better in Vala by using GLib.SearchFunc instead of GLib.CompareFunc. 2) Add gstreamer-mpegts bindings. I'm not keen about the idea of including bindings for gstreamer plugins in Vala, we'll have to talk about this, and maybe revisit (again) the idea of splitting the gstreamer bindings out. There are already 34 different gstreamer-*.vapi bindings in Vala. 3) Upgrade gstreamer-rtsp-server-1.0 bindings, which is what this bug is supposed to be about. I need to update the GIR used to generate this, too, so this patch doesn't actually do any good—I'll try to build gstreamer-rtsp-server soon so I can get this resolved.
Created attachment 277430 [details] gstreamer-mpegts library gir
Created attachment 277431 [details] gstreamer-rtsp-server gir
(In reply to comment #5) > (From update of attachment 276325 [details] [review]) > This should be three patches (and three separate bugs): > > 1) Change the Gst.Iterator.find_custom binding. This is actually an issue with > the annotations in gstreamer (that parameter should not be annotated with > (closure)), but it could also be made better in Vala by using GLib.SearchFunc > instead of GLib.CompareFunc. > I don't understand. The point is the 3rd paramerter. > 2) Add gstreamer-mpegts bindings. I'm not keen about the idea of including > bindings for gstreamer plugins in Vala, we'll have to talk about this, and > maybe revisit (again) the idea of splitting the gstreamer bindings out. There > are already 34 different gstreamer-*.vapi bindings in Vala. gstreamer-mpegts is not a plugin. Look into gstreamer documentation for more information. > > 3) Upgrade gstreamer-rtsp-server-1.0 bindings, which is what this bug is > supposed to be about. I need to update the GIR used to generate this, too, so > this patch doesn't actually do any good—I'll try to build gstreamer-rtsp-server > soon so I can get this resolved.
(In reply to comment #6) > Created an attachment (id=277430) [details] > gstreamer-mpegts library gir Please stop submitting gstreamer-mpegts stuff to this bug. You can open a new bug where we can talk about it. FWIW I don't need the GIR for it—gst-plugins-bad is in the default jhbuild moduleset. (In reply to comment #7) > Created an attachment (id=277431) [details] > gstreamer-rtsp-server gir Doesn't work: GstRtspServer-1.0.gir:385.7-385.17: warning: Virtual method `Gst.RTSPAuth.check' conflicts with method of the same name <virtual-method name="check"> ^^^^^^^^^^^ GstRtspServer-1.0.gir:2260.95-2260.95: error: The type name `Gst.NetTimeProvider' could not be found <type name="GstNet.NetTimeProvider" c:type="GstNetTimeProvider*"/> ^ Generation failed: 1 error(s), 1 warning(s) I have a copy of the latest GIR from a fresh checkout, same error. I'll look into it when I have some time. (In reply to comment #8) > I don't understand. The point is the 3rd paramerter. Please submit a separate bug, we can discuss the issue there. > gstreamer-mpegts is not a plugin. Look into gstreamer documentation for more > information. Please submit a separate bug, we can discuss the issue there.
(In reply to comment #9) > (In reply to comment #6) > > Created an attachment (id=277430) [details] [details] > > gstreamer-mpegts library gir > > Please stop submitting gstreamer-mpegts stuff to this bug. You can open a new > bug where we can talk about it. > > FWIW I don't need the GIR for it—gst-plugins-bad is in the default jhbuild > moduleset. > > (In reply to comment #7) > > Created an attachment (id=277431) [details] [details] > > gstreamer-rtsp-server gir > > Doesn't work: > > > GstRtspServer-1.0.gir:385.7-385.17: warning: Virtual method > `Gst.RTSPAuth.check' conflicts with method of the same name > <virtual-method name="check"> > ^^^^^^^^^^^ > GstRtspServer-1.0.gir:2260.95-2260.95: error: The type name > `Gst.NetTimeProvider' could not be found > <type name="GstNet.NetTimeProvider" c:type="GstNetTimeProvider*"/> > > ^ > Generation failed: 1 error(s), 1 warning(s) > > > I have a copy of the latest GIR from a fresh checkout, same error. I'll look > into it when I have some time. > Gstreamer-net you must add, I think. Check the GstNet-1.0.gir
> (In reply to comment #8) > > I don't understand. The point is the 3rd paramerter. > > Please submit a separate bug, we can discuss the issue there. > https://bugzilla.gnome.org/show_bug.cgi?id=730916 > > gstreamer-mpegts is not a plugin. Look into gstreamer documentation for more > > information. > > Please submit a separate bug, we can discuss the issue there. https://bugzilla.gnome.org/show_bug.cgi?id=730915
>diff --git a/vapi/gstreamer-rtsp-server-1.0.vapi b/vapi/gstreamer-rtsp-server-1.0.vapi >index f46a655..c1976ef 100644 >--- a/vapi/gstreamer-rtsp-server-1.0.vapi >+++ b/vapi/gstreamer-rtsp-server-1.0.vapi >@@ -124,7 +124,8 @@ namespace Gst { > [NoWrapper] > public virtual void configure (Gst.RTSPMedia media); > public virtual Gst.RTSPMedia? @construct (Gst.RTSP.Url url); >- public virtual unowned Gst.Element create_element (Gst.RTSP.Url url); >+ public virtual Gst.Element? create_element (Gst.RTSP.Url url); >+ protected virtual Gst.Element? create_pipeline (Gst.RTSPMedia media); create_pipeline are marked as introspectable="0" and it a virtual methode, so it goes not into *.vapi automatically.
Hello, needed answers!!
(In reply to comment #13) > Hello, needed answers!! I don't see a question anywhere.
(In reply to comment #14) > (In reply to comment #13) > > Hello, needed answers!! > > I don't see a question anywhere. look to comment #12 ,the question is can you import a virtual method which is marked as "introspectable="0" as protected method? gnome-dvb-daemon use a subclass of RTSPMediaFactory (is not forbidden) and override a virtual method which can not use directly outside the class.
Created attachment 277889 [details] [review] gstreamer-rtsp-server-1.0: update bindings (In reply to comment #15) > (In reply to comment #14) > > (In reply to comment #13) > > > Hello, needed answers!! > > > > I don't see a question anywhere. > > look to comment #12 ,the question is can you import a virtual method which is > marked as "introspectable="0" as protected method? gnome-dvb-daemon use a > subclass of RTSPMediaFactory (is not forbidden) and override a virtual method > which can not use directly outside the class. Ah, you didn't phrase it as a question. I thought you were just explaining why the change was needed, not asking how to do it. In metadata, you do something like RTSPMediaFactory.create_pipeline skip=false I'm attaching what I'm planning on pushing once the dependencies (#730952 and #730953) are fixed. Gst.RTSPServer.MediaFactory.create_pipeline is in there, so you can take a look at the metadata to see how I did it.
Just noticed the signal was protected in one of your versions. We don't currently have a way to mark a symbol as protected in metadata, you would have to create a GstRtspServer-1.0-custom.vala to do that. If one of the gstreamer people can confirm it should be protected I'll add support for a protected metadata annotation to the gir parser and make the switch.
(In reply to comment #17) > Just noticed the signal was protected in one of your versions. We don't > currently have a way to mark a symbol as protected in metadata, you would have > to create a GstRtspServer-1.0-custom.vala to do that. > > If one of the gstreamer people can confirm it should be protected I'll add > support for a protected metadata annotation to the gir parser and make the > switch. The create_pipeline is only for override in subclasses and not directly a member of the API. For me is that the point to say protected and not public.
Can someone please figure out what the minimum vapi necessary for the current dvb-daemon code is? If I just push attachment #277889 [details] it will break dvb-daemon, so I think a good solution would be to keep a small subset of the existing bindings in the Gst namespace and mark them as deprecated, then put the new bindings in Gst.RtspServer.
(In reply to comment #19) > Can someone please figure out what the minimum vapi necessary for the current > dvb-daemon code is? If I just push attachment #277889 [details] it will break > dvb-daemon, so I think a good solution would be to keep a small subset of the > existing bindings in the Gst namespace and mark them as deprecated, then put > the new bindings in Gst.RtspServer. The minimum version for the current dvb-daemon (0.2.10 and master) is GStreamer 0.10 . The branch Gst-1.0 required Gstreamer 1.3.1 .
That's not what I mean. I mean which symbols do you actually use? It should be possible to remove the vast majority of the vapi and keep dvb-daemon working.
(In reply to comment #21) > That's not what I mean. I mean which symbols do you actually use? It should > be possible to remove the vast majority of the vapi and keep dvb-daemon > working. symbols in gst-rtsp-server? class Gst.RtspServer -> all class Gst.RtspMediaFactory -> all class Gst.RrspMedia take_pipeline () signal unprepared class Gst.RTSPMountPoints remove_factory () add_factory () I hope I have all.
I just checked out gnome-dvb-daemon, and it doesn't seem to be using these bindings at all right now... Am I missing something? Where is the code which actually uses the existing bindings?
(In reply to comment #23) > I just checked out gnome-dvb-daemon, and it doesn't seem to be using these > bindings at all right now... Am I missing something? Where is the code which > actually uses the existing bindings? 1. check out gnome-dvb-daemon branch gst-1.0 2. patching it with patch https://bugzilla.gnome.org/show_bug.cgi?id=725230 3. add gstreamer-mpegts-1.0.vapi into vapi directory 4. configure etc.
I'm trying to figure out what, if anything, *currently* uses the gstreamer-rtsp-server-1.0 Vala bindings. In the old VAPI (the one currently distributed with Vala) everything was just in the Gst namespace, which doesn't match what the rest of the gstreamer bindings do. In order to match what the other bindings do I plan to put the stuff from GstRtspServer in the Gst.RtspServer namespace, which means that absolutely everything which was using the gstreamer-rtsp-server-1.0 vala bindings will stop working. In order to avoid that, I'm willing to keep copies of a few symbols where they are right now (marked with [Deprecated], of course), so I'm trying to figure out which symbols need that treatment. If there isn't anything currently using the gstreamer-rtsp-1.0 Vala bindings then I can just push the new bindings without regard for backwards compatibility.
in my opinion the best thing to do is push the changes from this patch, aftherwards we can modify the patch for the dvb-daemon, since that patch is not yet added to the gstreamer 1.0 branch of dvb-daemon, pls correct me if im wrong on this
(In reply to comment #25) > I'm trying to figure out what, if anything, *currently* uses the > gstreamer-rtsp-server-1.0 Vala bindings. > I created the original version of the gstreamer-rtsp-server bindings for 0.10, just to be able to use them in dvb-daemon. gstreamer 1.0 as well as the 1.0 version of gst-rtsp-server is still rather new, I would be surprised if a project other than gnome-dvb-daemon uses it. In fact, I checked all GNOME projects, and only gnome-dvb-daemon depends on gst-rtsp-server. In my opinion, to lower the burden of maintenance, what Evan suggest sounds reasonable. Adapting gnome-dvb-daemon to the changes is not much work.
commit 9e29b17e97e533da860d1081239a4e4b6fdf9ca4 Author: Evan Nemerson <evan@nemerson.com> Date: Mon Jun 2 10:18:26 2014 -0700 gstreamer-rtsp-server-1.0: update bindings The previous bindings only worked for an unstable pre-release version of gstreamer-rtsp-server-1.0. The new (stable) version is not backwards compatible, so neither can the Vala bindings be. Since we had to break backwards compatibilitiy, why not go big? I've taken the opportunity to move the bindings into the Gst.RTSPServer namespace to better match the other gstreamer bindings, as well as other assorted less-disruptive clean-ups. Fixes bug 723910.
(In reply to comment #29) > commit 9e29b17e97e533da860d1081239a4e4b6fdf9ca4 > Author: Evan Nemerson <evan@nemerson.com> > Date: Mon Jun 2 10:18:26 2014 -0700 > > gstreamer-rtsp-server-1.0: update bindings > > The previous bindings only worked for an unstable pre-release version > of gstreamer-rtsp-server-1.0. The new (stable) version is not > backwards compatible, so neither can the Vala bindings be. Since we > had to break backwards compatibilitiy, why not go big? I've taken the > opportunity to move the bindings into the Gst.RTSPServer namespace to > better match the other gstreamer bindings, as well as other assorted > less-disruptive clean-ups. > > Fixes bug 723910. Won't works. 1. The gstreamer-rtps-server-1.0.deps missed gstreamer-net-1.0 2. in MediaFactory the methods create_element and create_pipeline: missed "?" 3. in MediaFactory the method create_pipeline: return value is not Gst.Pipeline , but Gst.Element 4. in MediaFactory the method create_pipeline: it is no public src/rtsp/MediaFactory.vala:68.17-68.28: warning: `null' incompatible with return type `Gst.Element` return null; ^^^^^^^^^^^^ src/rtsp/MediaFactory.vala:71.30-71.32: warning: Gst is experimental src/rtsp/MediaFactory.vala:74.17-74.28: warning: `null' incompatible with return type `Gst.Element` return null; ^^^^^^^^^^^^ src/rtsp/MediaFactory.vala:81.17-81.28: warning: `null' incompatible with return type `Gst.Element` return null; ^^^^^^^^^^^^ src/rtsp/MediaFactory.vala:89.16-89.27: warning: `null' incompatible with return type `Gst.Element` return null; ^^^^^^^^^^^^ src/rtsp/MediaFactory.vala:96.9-96.54: error: overriding method `DVB.MediaFactory.create_pipeline' is incompatible with base method `Gst.RTSPServer.MediaFactory.create_pipeline': incompatible return type. protected override Gst.Element create_pipeline (Media media) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ src/rtsp/MediaFactory.vala:96.9-96.54: error: DVB.MediaFactory.create_pipeline: no suitable method found to override
in der gstreamer-rtsp-server.vapi missed include files. I have this error message: src/Manager.c: In Funktion »dvb_manager_on_device_removed_from_group«: src/Manager.c:3180:5: Fehler: unbekannter Typname: »GstRTSPMountPoints« GstRTSPMountPoints* points = NULL;
I have another problems -> namespace. it add *_SERVER_* and that is wrong!! src/rtsp/MediaFactory.c:490:45: Fehler: ungültiger Argumenttyp in »->« (haben »int«) GST_RTSP_SERVER_MEDIA_FACTORY_CLASS (klass)->create_element = dvb_media_factory_real_create_element; ^ src/rtsp/MediaFactory.c:491:45: Fehler: ungültiger Argumenttyp in »->« (haben »int«) GST_RTSP_SERVER_MEDIA_FACTORY_CLASS (klass)->create_pipeline = dvb_media_factory_real_create_pipeline; ^
> Won't works. > 1. The gstreamer-rtps-server-1.0.deps missed gstreamer-net-1.0 Okay, I'll push a fix for that in a minute. > 2. in MediaFactory the methods create_element and create_pipeline: missed "?" If that is true then the gst-rtsp-server is missing a (nullable) annotation on the return value. I don't mind supplying a patch (it's trivial), but I'd like someone from gstreamer to confirm since the documentation isn't at all clear on the matter. > 3. in MediaFactory the method create_pipeline: return value is not Gst.Pipeline, > but Gst.Element AFAICT that's not true. It's a GstPipeline* cast to a GstElement* for convenience in the C API, but for Vala (and other languages which use G-I) it should be a Pipeline. If one of the gst devs can confirm that it should really be a GstElement* I don't mind supplying a patch. > 4. in MediaFactory the method create_pipeline: it is no public Like I said before: (In reply to comment #17) > If one of the gstreamer people can confirm it should be protected I'll add > support for a protected metadata annotation to the gir parser and make the > switch. Not having a wrapper function does not automatically translate to "protected". Besides, G-I (and therefore its consumers) has no concept of protected, and AFAIK neither does gtk-doc. (In reply to comment #31) > in der gstreamer-rtsp-server.vapi missed include files. I have this error > message: > > src/Manager.c: In Funktion »dvb_manager_on_device_removed_from_group«: > src/Manager.c:3180:5: Fehler: unbekannter Typname: »GstRTSPMountPoints« > GstRTSPMountPoints* points = NULL; Bug #732411 (In reply to comment #32) > I have another problems -> namespace. it add *_SERVER_* and that is wrong!! > > src/rtsp/MediaFactory.c:490:45: Fehler: ungültiger Argumenttyp in »->« (haben > »int«) > GST_RTSP_SERVER_MEDIA_FACTORY_CLASS (klass)->create_element = > dvb_media_factory_real_create_element; > ^ > src/rtsp/MediaFactory.c:491:45: Fehler: ungültiger Argumenttyp in »->« (haben > »int«) > GST_RTSP_SERVER_MEDIA_FACTORY_CLASS (klass)->create_pipeline = > dvb_media_factory_real_create_pipeline; > ^ Bug #732413
commit 5a3526639e421313293f5980e5f5f5bbd7580386 Author: Evan Nemerson <evan@nemerson.com> Date: Sat Jun 28 23:56:17 2014 -0700 gstremaer-rtsp-server-1.0: add gstreamer-net-1.0 to deps
(In reply to comment #33) > > 4. in MediaFactory the method create_pipeline: it is no public > > Like I said before: > > (In reply to comment #17) > > If one of the gstreamer people can confirm it should be protected I'll add > > support for a protected metadata annotation to the gir parser and make the > > switch. > > Not having a wrapper function does not automatically translate to "protected". > Besides, G-I (and therefore its consumers) has no concept of protected, and > AFAIK neither does gtk-doc. The point is that if it public then it goes to an error (error: DVB.MediaFactory.create_pipeline: no suitable method found to override). And if I use protected I haven't an error.
(In reply to comment #35) > (In reply to comment #33) > > > 4. in MediaFactory the method create_pipeline: it is no public > > > > Like I said before: > > > > (In reply to comment #17) > > > If one of the gstreamer people can confirm it should be protected I'll add > > > support for a protected metadata annotation to the gir parser and make the > > > switch. > > > > Not having a wrapper function does not automatically translate to "protected". > > Besides, G-I (and therefore its consumers) has no concept of protected, and > > AFAIK neither does gtk-doc. > > The point is that if it public then it goes to an error (error: > DVB.MediaFactory.create_pipeline: > no suitable method found to override). And if I use protected I haven't an > error. The visibility of Gst.RTSPServer.MediaFactory.create_pipeline has to match DVB.MediaFactory.create_pipeline. They must either both be public or both be protected.
(In reply to comment #36) > (In reply to comment #35) > > (In reply to comment #33) > > > > 4. in MediaFactory the method create_pipeline: it is no public > > > > > > Like I said before: > > > > > > (In reply to comment #17) > > > > If one of the gstreamer people can confirm it should be protected I'll add > > > > support for a protected metadata annotation to the gir parser and make the > > > > switch. > > > > > > Not having a wrapper function does not automatically translate to "protected". > > > Besides, G-I (and therefore its consumers) has no concept of protected, and > > > AFAIK neither does gtk-doc. > > > > The point is that if it public then it goes to an error (error: > > DVB.MediaFactory.create_pipeline: > > no suitable method found to override). And if I use protected I haven't an > > error. > > The visibility of Gst.RTSPServer.MediaFactory.create_pipeline has to match > DVB.MediaFactory.create_pipeline. They must either both be public or both be > protected. I have tested it with both public and both protected, and the result is my last comment.
Works for me: public class Hmmmm : Gst.RTSPServer.MediaFactory { public override Gst.Pipeline create_pipeline (Gst.RTSPServer.Media media) { return (!) null; } } Maybe you have the old VAPI (with "protected") installed somewhere and vala is looking at that instead of the updated version (with "public"? You can pass --verbose to see which VAPIs valac is picking up.
(In reply to comment #38) > Works for me: > > public class Hmmmm : Gst.RTSPServer.MediaFactory { > public override Gst.Pipeline create_pipeline (Gst.RTSPServer.Media media) { > return (!) null; > } > } > > Maybe you have the old VAPI (with "protected") installed somewhere and vala is > looking at that instead of the updated version (with "public"? You can pass > --verbose to see which VAPIs valac is picking up. o.k. you right.