Creating a Rust binding for MPEG-TS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a Rust binding for MPEG-TS

Russel Winder
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

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.

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?

--
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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Creating a Rust binding for MPEG-TS

Sebastian Dröge-3
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.

> 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.

> 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.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Creating a Rust binding for MPEG-TS

Russel Winder
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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Creating a Rust binding for MPEG-TS

Sebastian Dröge-3
On Tue, 2018-05-08 at 09:43 +0100, Russel Winder wrote:

> 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.)
Yes. This is probably closest to the SDP things in gstreamer-sdp. Check
the manually implemented code there. The src/*.rs files

> > > 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.
In many cases things that fail to autogenerate can also be fixed via
the toml file, or by fixing/adding features to the gir code generator,
or fixing the .gir introspection files.

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

Only types that you list are actually generated.

> > > 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.
Yes that would be better

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment