<div dir="ltr">Hi,<div><br></div><div>I'm running python-gst-1.0 (1.2.1-1.2), and even using your script, I don't get all the overrides being displayed. My output is:</div><div>
<p class=""><span class="">['get_uri', 'set_uri']</span></p></div><div><br></div><div>What could be going on on my system that I'm not getting any of the super-type methods that I should? I can't upgrade coz I'm running on a Pi. I spent 3 hours last night upgrading all my gstreamer packages and in the end it didn't work.</div>
</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 18, 2015 at 6:46 PM, Aborilov Pavel <span dir="ltr"><<a href="mailto:aborilov@gmail.com" target="_blank">aborilov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
I use version 1.4.3.<br>
<br>
This is my full test example:<br>
<br>
from gi.repository import Gst, GObject, GstRtspServer<br>
Gst.init(None)<br>
rtsp_server = GstRtspServer.RTSPServer()<br>
rtsp_server.attach(None)<br>
<br>
<br>
class Factory(GstRtspServer.RTSPMediaFactoryURI):<br>
<br>
def __init__(self):<br>
super(Factory, self).__init__()<br>
print [(x, type(y)) for x, y<br>
in GstRtspServer.RTSPMediaFactory.__dict__.items()]<br>
<br>
def do_create_element(self, url):<br>
print "in do_create_element"<br>
<br>
factory = Factory()<br>
factory.set_uri('rtsp://good_camera_url')<br>
rtsp_server.get_mount_points().add_factory('/mount', factory)<br>
GObject.MainLoop().run()<br>
<br>
On start it printout:<br>
[('set_buffer_size', <type 'function'>), ('do_media_configure', <class<br>
'gi.types.NativeVFunc'>), ('__module__', <type 'str'>), ('do_configure',<br>
<class 'gi.types.NativeVFunc'>), ('set_suspend_mode', <type<br>
'function'>), ('do_media_constructed', <class 'gi.types.NativeVFunc'>),<br>
('__info__', <type 'ObjectInfo'>), ('do_create_element', <class<br>
'gi.types.NativeVFunc'>), ('priv', <type 'property'>), ('set_protocols',<br>
<type 'function'>), ('construct', <type 'function'>),<br>
('get_suspend_mode', <type 'function'>), ('_gst_reserved', <type<br>
'property'>), ('new', <type 'classmethod'>), ('__gtype__', <type<br>
'gobject.GType'>), ('get_launch', <type 'function'>), ('__doc__', <type<br>
'NoneType'>), ('set_launch', <type 'function'>), ('do_construct', <class<br>
'gi.types.NativeVFunc'>), ('parent', <type 'property'>),<br>
('is_eos_shutdown', <type 'function'>), ('get_permissions', <type<br>
'function'>), ('get_address_pool', <type 'function'>),<br>
('do_gen_key', <class 'gi.types.NativeVFunc'>),<br>
('set_shared', <type 'function'>), ('create_element', <type 'function'>),<br>
('is_shared', <type 'function'>), ('set_address_pool', <type 'function'>),<br>
('get_protocols', <type 'function'>), ('get_buffer_size', <type 'function'>),<br>
('get_profiles', <type 'function'>), ('set_permissions', <type 'function'>),<br>
('set_profiles', <type 'function'>), ('set_eos_shutdown', <type 'function'>)]<br>
<br>
as you see it have create_element func, but you have to override do_create_element,<br>
that have type gi.types.NativeVFunc.<br>
and if I connect with rtsp client to rtsp://<a href="http://mandrillapp.com/track/click/30003446/127.0.0.1?p=eyJzIjoiaFJrRlAxQkljYVViX3YtNXc4LV9nTFhzNDdZIiwidiI6MSwicCI6IntcInVcIjozMDAwMzQ0NixcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvMTI3LjAuMC4xOjg1NTRcXFwvbW91bnRcIixcImlkXCI6XCI2NDUwMDQ0MmZiMWU0ZTQ2YWE2ZjViNDVhYjk0YTAyNVwiLFwidXJsX2lkc1wiOltcIjdkZWFkZDFhNjIzYmRjYzk1ZWZmYWM5NTg4ZGRhZjhhMTdkODU5MzFcIl19In0" rel="noreferrer" target="_blank">127.0.0.1:8554/mount</a><br>
it printout:<br>
in do_create_element<br>
<br>
On 09/17, Adam Langley wrote:<br>
> Hi Aborliv,<br>
><br>
> I ran my same inspection code for the RTSPMediaFactoryURI, and got the<br>
> following results:<br>
> ['get_uri', 'set_uri']<br>
><br>
> Interesting that none of the inherited methods show up.<br>
><br>
> This is my inspection code:<br>
><br>
> *print*([x *for* x,y *in*<br>
> GstRtspServer.RTSPMediaFactoryURI.__dict__.items() *if* type(y) ==<br>
> FunctionType])<br>
> I have also overridden do_create_element, and it just never gets called.<br>
> The constructor does however.... and the 'print' writes out a bunch of<br>
> methods declared in RTSPMediaFactory - so I know the class is correctly<br>
> derived...<br>
><br>
> class MyFactory(GstRtspServer.RTSPMediaFactory):<br>
> def __init__(self):<br>
> super(MyFactory, self).__init__()<br>
> print([x for x,y in GstRtspServer.RTSPMediaFactory.__dict__.items()<br>
> if type(y) == FunctionType])<br>
> def do_create_element(self, url):<br>
> # return element here... code deleted<br>
><br>
> self.server = GstRtspServer.RTSPServer()<br>
> self.server.set_service('554')<br>
> f = MyFactory()<br>
> f.set_shared(True)<br>
> m = self.server.get_mount_points()<br>
> m.add_factory("/video", f)<br>
> self.server.attach(None)<br>
><br>
> On Thu, Sep 17, 2015 at 5:36 PM, Aborilov Pavel <<a href="mailto:aborilov@gmail.com">aborilov@gmail.com</a>> wrote:<br>
><br>
> > I use RTSPMediaFactoryURI from Python and I have to override method<br>
> > do_create_element, and it works.<br>
> ><br>
> > On 09/17, Adam Langley wrote:<br>
> > > I am using Gstreamer RTSPMediaFactory (libgstrtspserver 1.0) v 1.2.3-0.<br>
> > > From Python, I have derived from the MediaFactory, and overridden<br>
> > > create_element. Unfortunately, my create_element is never called, so the<br>
> > > RtspServer complains no launch line specified.<br>
> > ><br>
> > > I printed out all the methods declared in the super instance, and got<br>
> > this:<br>
> > ><br>
> > > ['set_buffer_size', 'set_suspend_mode', 'set_protocols', 'construct',<br>
> > > 'get_suspend_mode', 'get_launch', 'set_launch', 'is_eos_shutdown',<br>
> > > 'get_permissions', 'get_address_pool', 'set_shared', 'is_shared',<br>
> > > 'set_address_pool', 'get_protocols', 'get_buffer_size',<br>
> > 'set_permissions',<br>
> > > 'set_eos_shutdown']<br>
> > > No create_element!<br>
> > ><br>
> > > No wonder, my implementation is never being called... but why is there no<br>
> > > create_element function?<br>
> > ><br>
> ><br>
> > > _______________________________________________<br>
> > > gstreamer-devel mailing list<br>
> > > <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> > > <a href="http://mandrillapp.com/track/click/30003446/lists.freedesktop.org?p=eyJzIjoiWDNaUDJTNUxSeXMtUkdIUzN5RXlWaEtUTGdnIiwidiI6MSwicCI6IntcInVcIjozMDAwMzQ0NixcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvbGlzdHMuZnJlZWRlc2t0b3Aub3JnXFxcL21haWxtYW5cXFwvbGlzdGluZm9cXFwvZ3N0cmVhbWVyLWRldmVsXCIsXCJpZFwiOlwiNjQ1MDA0NDJmYjFlNGU0NmFhNmY1YjQ1YWI5NGEwMjVcIixcInVybF9pZHNcIjpbXCJkZTNjNjdiOWJkNmZkMDdlNzJlZjIwYTBlZTAwYmM4NTY1MWUxYTAwXCJdfSJ9" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> ><br>
> > _______________________________________________<br>
> > gstreamer-devel mailing list<br>
> > <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> > <a href="http://mandrillapp.com/track/click/30003446/lists.freedesktop.org?p=eyJzIjoiWDNaUDJTNUxSeXMtUkdIUzN5RXlWaEtUTGdnIiwidiI6MSwicCI6IntcInVcIjozMDAwMzQ0NixcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvbGlzdHMuZnJlZWRlc2t0b3Aub3JnXFxcL21haWxtYW5cXFwvbGlzdGluZm9cXFwvZ3N0cmVhbWVyLWRldmVsXCIsXCJpZFwiOlwiNjQ1MDA0NDJmYjFlNGU0NmFhNmY1YjQ1YWI5NGEwMjVcIixcInVybF9pZHNcIjpbXCJkZTNjNjdiOWJkNmZkMDdlNzJlZjIwYTBlZTAwYmM4NTY1MWUxYTAwXCJdfSJ9" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> ><br>
><br>
<br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
> <a href="http://mandrillapp.com/track/click/30003446/lists.freedesktop.org?p=eyJzIjoiWDNaUDJTNUxSeXMtUkdIUzN5RXlWaEtUTGdnIiwidiI6MSwicCI6IntcInVcIjozMDAwMzQ0NixcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvbGlzdHMuZnJlZWRlc2t0b3Aub3JnXFxcL21haWxtYW5cXFwvbGlzdGluZm9cXFwvZ3N0cmVhbWVyLWRldmVsXCIsXCJpZFwiOlwiNjQ1MDA0NDJmYjFlNGU0NmFhNmY1YjQ1YWI5NGEwMjVcIixcInVybF9pZHNcIjpbXCJkZTNjNjdiOWJkNmZkMDdlNzJlZjIwYTBlZTAwYmM4NTY1MWUxYTAwXCJdfSJ9" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://mandrillapp.com/track/click/30003446/lists.freedesktop.org?p=eyJzIjoiWDNaUDJTNUxSeXMtUkdIUzN5RXlWaEtUTGdnIiwidiI6MSwicCI6IntcInVcIjozMDAwMzQ0NixcInZcIjoxLFwidXJsXCI6XCJodHRwOlxcXC9cXFwvbGlzdHMuZnJlZWRlc2t0b3Aub3JnXFxcL21haWxtYW5cXFwvbGlzdGluZm9cXFwvZ3N0cmVhbWVyLWRldmVsXCIsXCJpZFwiOlwiNjQ1MDA0NDJmYjFlNGU0NmFhNmY1YjQ1YWI5NGEwMjVcIixcInVybF9pZHNcIjpbXCJkZTNjNjdiOWJkNmZkMDdlNzJlZjIwYTBlZTAwYmM4NTY1MWUxYTAwXCJdfSJ9" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>
<img src="http://mandrillapp.com/track/open.php?u=30003446&id=64500442fb1e4e46aa6f5b45ab94a025" height="1" width="1">