Creating a Rust binding for MPEG-TS

Russel Winder russel at winder.org.uk
Tue May 8 08:43:43 UTC 2018


Sebastian,

On Tue, 2018-05-08 at 10:13 +0300, Sebastian Dröge wrote:
> Hi Russel,
> 
> On Mon, 2018-05-07 at 19:02 +0100, Russel Winder wrote:
> > Hi,
> > 
> > I am progressing trying to create a Rust binding for MPEG-TS, D has one so
> > Rust should as well. I seem to have a skeleton which is beginning to look
> > half-way reasonable. However, for some synbols I am getting a fail in gir.
> > For
> > example:
> > 
> > thread 'main' panicked at 'Missing memory management functions for
> > GstMpegts.DVBServiceListItem', src/codegen/record.rs:61:9
> 
> That's because it has no copy/free or ref/unref function. You'd need to
> manually bind this one, i.e. add it to the manual section in the toml
> file and write some code for it.

OK. So this is writing Rust code rather than writing stuff in the TOML file?

Not a problem, now I know the direction. Can you suggest the best current
working example to use as a paradigm to drive things here? (I am working in a
position of little knowledge, so good examples are crucial.)
 
> > Commenting out from the Gir_GstMpegts.toml file all the symbols that cause
> > this problem creates a reasonable set of files in gstreamer-mpegts/auto so
> > the
> > skeleton seems not broken.
> 
> You start by white-listing types one-by-one as needed and then make
> sure for each that something reasonable is generated. Don't start with
> everything at once as manual changes will be needed.

I went the other way and listed most types and then commented them out till
there was a correct generation. Now I can uncomment the ones that have this
problem and move them to manual and write the Rust code.

I am not sure what "whitelisting" means in this context.

> > Anyone any ideas why gir might be panicing at that point before I go
> > digging
> > starting from no knowledge?
> > 
> > Another problem fr some other symbols is:
> > 
> > WARN 2018-05-07T17:51:00Z: libgir::analysis::functions: Function
> > gst_mpegts_descriptor_parse_dvb_ca_identifier has unsupported outs
> > 
> > Again before I go digging from a position of zero knowledge does anyone
> > have
> > any hints or advice to help speed things up for me?
> 
> GArray out parameters are not supported yet by gir and would have to be
> added. Related https://github.com/gtk-rs/gir/issues/594
> 
> Features are only added to gir when someone actually needs them.
> 
> 
> In general, the gtk-rs gitter chat would be a better place to discuss
> issues with the gir code generator.

I vote for fixing this rather than hacking. I'll switch the using the GitHub
issue and the gtk-rs Gitter channel to take this further as it is not a
GStreamer issue per se.

-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180508/20e9980d/attachment.sig>


More information about the gstreamer-devel mailing list