Свойство самоанализа gobject недоступно в python

У меня возникли проблемы с самоанализом Python и пользовательским элементом Gstreamer... Я не могу получить доступ к свойствам элемента. Вот соответствующий код в моем элементе gstreamer:

// Properties declared on the class object
static void gst_videoautogain_class_init(VipreautogainClass* pKlass)
{
  // ... more stuff
  g_object_class_install_property(G_OBJECT_CLASS(pKlass), PROP_LOW_STRETCH,
                                   g_param_spec_float("low_stretch",
                                                      "Low stretch percentile",
                                                      "The percentile corresponding to the lowest output value.",
                                                      0., 1., 0.02,
                                                      G_PARAM_READWRITE));
  g_object_class_install_property(G_OBJECT_CLASS(pKlass), PROP_HIGH_STRETCH,
                                   g_param_spec_float("high_stretch",
                                                      "High stretch percentile",
                                                      "The percentile corresponding to the highest output value.",
                                                      0., 1., 0.98,
                                                      G_PARAM_READWRITE));
}

Свойства отображаются в gst-inspect-1.0. Вот пример попытки доступа к свойствам в Python:

import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject
Gst.init([])
p = Gst.parse_launch("videotestsrc ! videoautogain low-stretch=0.05 name=gain ! fakesink")
g = p.get_by_name('gain')
g.props.low_stretch            # 'GProps' object has no attribute 'low_stretch'
g.get_property('low-stretch')  # Unknown property: 'low-stretch'

0 ответов

Другие вопросы по тегам