Method not available in RTSPMediaFactory

Adam Langley linux at irisdesign.co.nz
Fri Sep 18 23:22:34 PDT 2015


Hi,

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:

['get_uri', 'set_uri']

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.

On Fri, Sep 18, 2015 at 6:46 PM, Aborilov Pavel <aborilov at gmail.com> wrote:

> Hi!
>
> I use version 1.4.3.
>
> This is my full test example:
>
> from gi.repository import Gst, GObject, GstRtspServer
> Gst.init(None)
> rtsp_server = GstRtspServer.RTSPServer()
> rtsp_server.attach(None)
>
>
> class Factory(GstRtspServer.RTSPMediaFactoryURI):
>
>     def __init__(self):
>         super(Factory, self).__init__()
>         print [(x, type(y)) for x, y
>                in GstRtspServer.RTSPMediaFactory.__dict__.items()]
>
>     def do_create_element(self, url):
>         print "in do_create_element"
>
> factory = Factory()
> factory.set_uri('rtsp://good_camera_url')
> rtsp_server.get_mount_points().add_factory('/mount', factory)
> GObject.MainLoop().run()
>
> On start it printout:
> [('set_buffer_size', <type 'function'>), ('do_media_configure', <class
> 'gi.types.NativeVFunc'>), ('__module__', <type 'str'>), ('do_configure',
> <class 'gi.types.NativeVFunc'>), ('set_suspend_mode', <type
> 'function'>), ('do_media_constructed', <class 'gi.types.NativeVFunc'>),
> ('__info__', <type 'ObjectInfo'>), ('do_create_element', <class
> 'gi.types.NativeVFunc'>), ('priv', <type 'property'>), ('set_protocols',
> <type 'function'>), ('construct', <type 'function'>),
> ('get_suspend_mode', <type 'function'>), ('_gst_reserved', <type
> 'property'>), ('new', <type 'classmethod'>), ('__gtype__', <type
> 'gobject.GType'>), ('get_launch', <type 'function'>), ('__doc__', <type
> 'NoneType'>), ('set_launch', <type 'function'>), ('do_construct', <class
> 'gi.types.NativeVFunc'>), ('parent', <type 'property'>),
> ('is_eos_shutdown', <type 'function'>), ('get_permissions', <type
> 'function'>), ('get_address_pool', <type 'function'>),
> ('do_gen_key', <class 'gi.types.NativeVFunc'>),
> ('set_shared', <type 'function'>), ('create_element', <type 'function'>),
> ('is_shared', <type 'function'>), ('set_address_pool', <type 'function'>),
> ('get_protocols', <type 'function'>), ('get_buffer_size', <type
> 'function'>),
> ('get_profiles', <type 'function'>), ('set_permissions', <type
> 'function'>),
> ('set_profiles', <type 'function'>), ('set_eos_shutdown', <type
> 'function'>)]
>
> as you see it have create_element func, but you have to override
> do_create_element,
> that have type gi.types.NativeVFunc.
> and if I connect with rtsp client to rtsp://127.0.0.1:8554/mount
> it printout:
> in do_create_element
>
> On 09/17, Adam Langley wrote:
> > Hi Aborliv,
> >
> > I ran my same inspection code for the RTSPMediaFactoryURI, and got the
> > following results:
> > ['get_uri', 'set_uri']
> >
> > Interesting that none of the inherited methods show up.
> >
> > This is my inspection code:
> >
> > *print*([x *for* x,y *in*
> > GstRtspServer.RTSPMediaFactoryURI.__dict__.items() *if* type(y) ==
> > FunctionType])
> > I have also overridden do_create_element, and it just never gets called.
> > The constructor does however.... and the 'print' writes out a bunch of
> > methods declared in RTSPMediaFactory - so I know the class is correctly
> > derived...
> >
> > class MyFactory(GstRtspServer.RTSPMediaFactory):
> >     def __init__(self):
> >         super(MyFactory, self).__init__()
> >         print([x for x,y in
> GstRtspServer.RTSPMediaFactory.__dict__.items()
> > if type(y) == FunctionType])
> >     def do_create_element(self, url):
> >         # return element here... code deleted
> >
> > self.server = GstRtspServer.RTSPServer()
> > self.server.set_service('554')
> > f = MyFactory()
> > f.set_shared(True)
> > m = self.server.get_mount_points()
> > m.add_factory("/video", f)
> > self.server.attach(None)
> >
> > On Thu, Sep 17, 2015 at 5:36 PM, Aborilov Pavel <aborilov at gmail.com>
> wrote:
> >
> > > I use RTSPMediaFactoryURI from Python and I have to override method
> > > do_create_element, and it works.
> > >
> > > On 09/17, Adam Langley wrote:
> > > > I am using Gstreamer RTSPMediaFactory (libgstrtspserver 1.0) v
> 1.2.3-0.
> > > > From Python, I have derived from the MediaFactory, and overridden
> > > > create_element. Unfortunately, my create_element is never called, so
> the
> > > > RtspServer complains no launch line specified.
> > > >
> > > > I printed out all the methods declared in the super instance, and got
> > > this:
> > > >
> > > > ['set_buffer_size', 'set_suspend_mode', 'set_protocols', 'construct',
> > > > 'get_suspend_mode', 'get_launch', 'set_launch', 'is_eos_shutdown',
> > > > 'get_permissions', 'get_address_pool', 'set_shared', 'is_shared',
> > > > 'set_address_pool', 'get_protocols', 'get_buffer_size',
> > > 'set_permissions',
> > > > 'set_eos_shutdown']
> > > > No create_element!
> > > >
> > > > No wonder, my implementation is never being called... but why is
> there no
> > > > create_element function?
> > > >
> > >
> > > > _______________________________________________
> > > > gstreamer-devel mailing list
> > > > gstreamer-devel at lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > >
> > > _______________________________________________
> > > gstreamer-devel mailing list
> > > gstreamer-devel at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > >
> >
>
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150919/a3378644/attachment-0001.html>


More information about the gstreamer-devel mailing list