[vlc-devel] [RFC Patch v2 1/2] libvlc: Add Rust API for writing modules in rust
Steve Lhomme
robux4 at ycbcr.xyz
Mon Sep 14 13:26:05 CEST 2020
On 2020-09-14 13:13, Kartik Ohri wrote:
> On Mon, Sep 14, 2020 at 11:38 AM Steve Lhomme <robux4 at ycbcr.xyz
> <mailto:robux4 at ycbcr.xyz>> wrote:
>
> On 2020-09-11 21:33, Kartik Ohri wrote:
> > The API is written in two layers. vlccore-sys
> > crate contains one to one bindings of libvlc
> > functions. vlccore-rs crate wraps vlccore-sys and
> > exposes a Rust idiomatic API for writing modules
> > in rust. As of now, the API exposes only a subset
> > of the vlc_stream API. More functionality can be
> > added to Rust API as required in the future.
> > ---
> > .gitignore | 2 +-
> > configure.ac <http://configure.ac> | 13 ++++
> > src/vlccore-rs/Cargo.toml | 10 +++
> > src/vlccore-rs/src/lib.rs <http://lib.rs> | 1 +
> > src/vlccore-rs/src/stream.rs <http://stream.rs> | 120
> ++++++++++++++++++++++++++++++++++
> > src/vlccore-sys/Cargo.toml | 10 +++
> > src/vlccore-sys/src/lib.rs <http://lib.rs> | 2 +
> > src/vlccore-sys/src/stream.rs <http://stream.rs> | 24 +++++++
> > 8 files changed, 181 insertions(+), 1 deletion(-)
> > create mode 100644 src/vlccore-rs/Cargo.toml
> > create mode 100644 src/vlccore-rs/src/lib.rs <http://lib.rs>
> > create mode 100644 src/vlccore-rs/src/stream.rs <http://stream.rs>
> > create mode 100644 src/vlccore-sys/Cargo.toml
> > create mode 100644 src/vlccore-sys/src/lib.rs <http://lib.rs>
> > create mode 100644 src/vlccore-sys/src/stream.rs <http://stream.rs>
> >
> > diff --git a/.gitignore b/.gitignore
> > index fc368212c8..6c049a80b1 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -46,7 +46,7 @@ wxvlc
> > vlc_install_dir/*
> > plugins.dat
> > patches/*
> > -
> > +**/Cargo.lock
> > include/vlc/libvlc_version.h
> >
> > # Ignore build dirs
> > diff --git a/configure.ac <http://configure.ac> b/configure.ac
> <http://configure.ac>
> > index 99e4669942..53d56a725c 100644
> > --- a/configure.ac <http://configure.ac>
> > +++ b/configure.ac <http://configure.ac>
> > @@ -1896,6 +1896,19 @@ AS_IF([test "${enable_sout}" != "no"], [
> > ])
> > AM_CONDITIONAL([ENABLE_SOUT], [test "${enable_sout}" != "no"])
> >
> > +dnl Rust Modules
> > +AC_ARG_ENABLE([rust],
> > + AS_HELP_STRING([--enable-rust], [enable building Rust
> modules (default disabled)]))
> > +AS_IF([test "${enable_rust}" = "yes"],
> > + [AC_DEFINE(ENABLE_RUST, 1, [Define to 1 for building rust
> modules.])])
> > +AM_CONDITIONAL([BUILD_RUST], [test "${enable_rust}" = "yes"])
>
> You should only set to true this if cargo is available.
>
> > +if test "${enable_rust}" = "yes"
> > +then
> > + AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
> > + AS_IF([test "x$CARGO" = "xno"],
> > + AC_MSG_ERROR([cargo not found. cargo is required to
> build rust modules]))
> > +fi
>
>
> Ah! Yes. I have made the changes below and tested them locally. Does
> this address the issue ?
Yes, this looks correct.
> ===================================================================
> --- configure.ac <http://configure.ac> (revision
> 329abd5c6c5a8ac45765b2fca9883dae7155207e)
> +++ configure.ac <http://configure.ac> (date 1600072942614)
> @@ -1899,15 +1899,13 @@
> dnl Rust Modules
> AC_ARG_ENABLE([rust],
> AS_HELP_STRING([--enable-rust], [enable building Rust modules
> (default disabled)]))
> -AS_IF([test "${enable_rust}" = "yes"],
> - [AC_DEFINE(ENABLE_RUST, 1, [Define to 1 for building rust
> modules.])])
> -AM_CONDITIONAL([BUILD_RUST], [test "${enable_rust}" = "yes"])
> if test "${enable_rust}" = "yes"
> then
> AC_CHECK_PROG(CARGO, [cargo], [yes], [no])
> AS_IF([test "x$CARGO" = "xno"],
> AC_MSG_ERROR([cargo not found. cargo is required to build
> rust modules]))
> fi
> +AM_CONDITIONAL([BUILD_RUST], [test "x$CARGO" = "xyes"])
>
> dnl Lua modules
> AC_ARG_ENABLE([lua],
>
> ____________________________________
>
> ___________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list