Gstreamer 方法在RTSPMediaFactory中不可用

Gstreamer 方法在RTSPMediaFactory中不可用,gstreamer,python-gstreamer,Gstreamer,Python Gstreamer,我使用的是Gstreamer RTSPMediaFactory(libgstrtspserver1.0)v1.2.3-0。 我从Python派生自MediaFactory,并重写了create\u元素。 不幸的是,我的create_元素从未被调用,因此RtspServer抱怨没有指定启动行 我打印了超级实例中声明的所有方法,得到了以下结果: [“设置缓冲区大小”、“设置挂起模式”、“设置协议”、“构造”, ‘获取挂起模式’、‘获取启动’、‘设置启动’、‘是eos关闭’, “获取权限”、“获取地址

我使用的是Gstreamer RTSPMediaFactory(
libgstrtspserver
1.0)v1.2.3-0。 我从Python派生自MediaFactory,并重写了
create\u元素
。 不幸的是,我的create_元素从未被调用,因此RtspServer抱怨
没有指定启动行

我打印了超级实例中声明的所有方法,得到了以下结果:

[“设置缓冲区大小”、“设置挂起模式”、“设置协议”、“构造”, ‘获取挂起模式’、‘获取启动’、‘设置启动’、‘是eos关闭’, “获取权限”、“获取地址池”、“设置共享”、“是否共享”, “设置地址池”、“获取协议”、“获取缓冲区大小”, “设置权限”、“设置eos\U关机”]

创建元素

难怪,我的实现从未被调用。。。但是为什么没有
create\u元素
函数呢?我该怎么办?

我使用1.4.3版

这是我的全部测试:

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://camera_url')
rtsp_server.get_mount_points().add_factory('/mount', factory)
GObject.MainLoop().run()
开始打印时:

[('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'>)]
in do_create_element

谢谢-这些代码在1.2.3-0中都不起作用。只有几个方法被报告为可重写的。