Re: [Mlt-devel] Frei0r & Ladspa Filters
Brought to you by:
ddennedy,
lilo_booter
From: Dan D. <da...@de...> - 2009-09-18 20:39:30
|
On Fri, Sep 18, 2009 at 12:25 PM, Jonathan Thomas <jon...@gm...> wrote: > Dan, sorry to bother you again, but I have been unable to successfully get > properties out of the mlt.repository object. I took a look at the mlt > source code, and really tried to figure this out. I'm not sure if this is a > problem with swig or mlt or the way I'm using it. =) > > When I call the r.metadata method, I always get back a mlt.Properties > object, no matter what I pass to the metadata function. Looking at your > source code, it should return a NULL if it can't find any properties. > Howerver, I always get back a <mlt.Properties; proxy of <Swig Object>>. > When I call any method on this returned object, it seg faults. > > For example: >>> import mlt >>> f = mlt.Factory() >>> r = f.init() >>> props = r.metadata(mlt.filter_type, "sepia") >>> props.count() > Segmentation fault Not all services have metadata. Most of them do not, in fact. This is something I added within the past year and half or so, and it takes time to develop it out, especially when not getting much help. Fortunately, everything Marco Gittler works on is documented, and that includes frei0r and oldfilm modules. If you want to try to make Filters generic and automatically expand with MLT, then you will need to help me flesh out this metadata. However, I am not even certain that you want to do this. There are filters that really need a custom UI, and some filters you do not want users to add since they are kind of internal, utilitarian - like the new imageconvert filter. > However, this also returns a mlt.properties object... and then breaks when I > access any methods: > >>> props = r.metadata(mlt.filter_type, "asdf1234") >>> props.count() >>> p = r.metadata(mlt.filter_type, 'frei0r.water') >>> p.dump() schema_version=0.1 title=Water version=3.0 identifier=frei0r.water description=water drops on a video surface creator=Jaromil type=filter ...but dump() does not recurse into the nested parameters list. >>> p.get_data('paramaters') <Swig Object of type 'void *' at 0x69a20> >>> mlt.Properties(p.get_data('parameters')).count() segfault ...even though parameters is a nested properties that exists. So, there are some problems here with the usability of swig bindings. We need a way to get a None result for services with no metadat, and way to cast to a Properties object. I will work a bit on the bindings. There was another request a while to add some new members to the C++ binding. -- +-DRD-+ |