From 60fb3c02001d5e9b30e51b4e5c717c2361d3fd2e Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 29 Jul 2020 16:23:34 +0700 Subject: [PATCH 1/3] Add armhf github action --- .github/workflows/armhf.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/armhf.yml diff --git a/.github/workflows/armhf.yml b/.github/workflows/armhf.yml new file mode 100644 index 0000000..9df0098 --- /dev/null +++ b/.github/workflows/armhf.yml @@ -0,0 +1,51 @@ +name: Build ARMHF + +on: [push, pull_request] + +jobs: + armhfbuild: + name: build-armhf + runs-on: ubuntu-latest + container: node:current-buster-slim + steps: + - uses: actions/checkout@v2 + - name: Install basic tools + run: | + apt-get update + apt-get install --assume-yes --no-install-recommends sudo curl ca-certificates build-essential + - name: Add armhf as a foreign architecture + run: | + sudo dpkg --add-architecture armhf + - name: Install cross compile tools + run: | + sudo apt-get update + sudo apt-get install --assume-yes --no-install-recommends gcc-arm-linux-gnueabihf + - name: Install armhf gstreamer + run: | + sudo apt-get update + sudo apt-get install --assume-yes --no-install-recommends \ + libgstrtspserver-1.0-dev:armhf \ + libgstreamer1.0-dev:armhf \ + libgtk2.0-dev:armhf + - name: Install rustup armv7 + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: armv7-unknown-linux-gnueabihf + - name: Build armfh + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features --target=armv7-unknown-linux-gnueabihf + env: + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc + CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc + CXX_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-g++ + PKG_CONFIG_ALLOW_CROSS: 1 + PKG_CONFIG_PATH: /usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig/ + PKG_CONFIG_LIBDIR: /usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig/ + - uses: actions/upload-artifact@v2 + with: + name: release-armhf + path: "target/armv7-unknown-linux-gnueabihf/release/neolink*" From 8e2aa426a5fd412debfe592e247155de621fac09 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Sun, 2 Aug 2020 19:51:20 +0700 Subject: [PATCH 2/3] Typos and doc updates --- README.md | 4 +--- docs/unix_service.md | 24 +++++++++------------ docs/unix_setup.md | 50 +++++++++++++++++++++----------------------- 3 files changed, 35 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index c583af5..1915358 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,7 @@ Currently it has been tested on the following cameras: - B800/D800 - B400/D400 - E1 - -It *should* support the Lumus as well, but this has not yet been tested. -Please test if you have one, and [open an issue](https://github.com/thirtythreeforty/neolink/issues/new/choose) if you encounter problems: +- Lumus Neolink does not support other cameras such as the RLC-420, since they already [provide native RTSP](https://support.reolink.com/hc/en-us/articles/360007010473-How-to-Live-View-Reolink-Cameras-via-VLC-Media-Player). diff --git a/docs/unix_service.md b/docs/unix_service.md index 514cdd2..418b24a 100644 --- a/docs/unix_service.md +++ b/docs/unix_service.md @@ -7,21 +7,21 @@ buster/stetch or any other os that uses systemd. The general steps are: 1. Create an unprivileged user to run neolink -2. Setting up neolink somewhere the unprivileged user can run it +2. Set up neolink somewhere the unprivileged user can run it 3. Creating the service file ## Creating the unprivileged user For this I will use the username neolinker. Any unused name would be fine. -``` +```bash sudo adduser --system --no-create-home --shell /bin/false neolinker ``` Depending on your flavour of linux `adduser` may have also created a group of the same name. If it did not, you can create a group with: -``` +```bash sudo addgroup --system neolinker ``` @@ -31,7 +31,7 @@ For this we will put neolink in `/usr/local/bin` and the config in `/usr/local/e We will also secure the config file so that only neolinker (and root) can read it. We want to do this because it contains passwords. -``` +```bash sudo cp neolink /usr/local/bin/neolink sudo cp my_config.toml /usr/local/etc/neolink_config.toml sudo chmod 755 /usr/local/bin/neolink @@ -43,7 +43,7 @@ sudo chmod 600 /usr/local/etc/neolink_config.toml We will create a systemd service. This service will need to point to our files for using neolink and also instruct it to start with our unprivileged user. -Create a file here `/etc/systemd/system/neolink.service` with the following contents: +Create a file here `/etc/systemd/system/neolink.service` with the following contents (you will need admin privileges to write to this location): ``` [Install] @@ -69,34 +69,30 @@ You can now control the service with the usual commands To start it use: -``` +```bash systemctl start neolink ``` To stop it use: -``` +```bash systemctl stop neolink ``` To check it's running use: -``` - +```bash systemctl status neolink - ``` To make it run at startup from now on: -``` - +```bash systemctl enable neolink - ``` You can check it's log file with -``` +```bash journalctl -xeu neolink ``` diff --git a/docs/unix_setup.md b/docs/unix_setup.md index 2daf311..40886ef 100644 --- a/docs/unix_setup.md +++ b/docs/unix_setup.md @@ -7,6 +7,8 @@ There are many flavours of linux so the name of some packages may not exactly match. You are expected to be able to find the correct names yourselves. +The general steps we will follow in this guide are as follows: + 1. Install dependancies 2. Download neolink @@ -31,7 +33,7 @@ Glib2.0 is usually already installed on most modern unix flavours. But the others will likely need to be installed via your package manager. -Here are some examples for command packages that work on some distros +Here are some examples for commands of package managers - ubuntu, buster, stretch @@ -59,7 +61,7 @@ Here are some examples for command packages that work on some distros gst-rtsp-server ``` - If your on archlinux or manjaro and you need to install yay do this: + If your on archlinux or manjaro and you need to install `yay` do this: ```bash git clone https://aur.archlinux.org/yay.git @@ -72,11 +74,9 @@ Here are some examples for command packages that work on some distros You now need to get a copy of neolink. You can get that from this github [under the CI assets](https://github.com/thirtythreeforty/neolink/actions?query=branch%3Amaster+workflow%3ACI). -Currently only amd64 is officially released, but armv7 will soon -be available too. +Currently amd64 and armv7 are officially released. -If you are installing on a raspberry pi, you will need to compile -from source until the official armv7 builds are available. +If you are installing on a raspberry pi, you will need the armv7 build. You will get a zip file called `release-ubuntu-18.04.zip`, unzip it with @@ -102,7 +102,7 @@ Open up the file in your favourite text editor. For the most basic setup you need to change only the parts in `[[ cameras ]]`. Neolink can connect to any number of supported reolink cameras at once. Each -camera requires its own `[[ cameras ]]` block. Here is the example one: +camera requires its own `[[ cameras ]]` block. Here is an example one: ```toml [[cameras]] @@ -113,20 +113,19 @@ address = "192.168.1.187:9000" ``` Set the `name` to any value you want, this will be the name of the rtsp stream. -In this tutorial I will assume you leave as "driveway". +In this tutorial I will assume you leave it as "driveway". -The username and password are the ones that are used to connect to the camera -and are the same ones used in the official reolink app. +The username and passwords are the same ones used in the official reolink app. The address is the ip address of the camera. You should set and use a fixed ip for your camera. There are many ways to get a fixed ip address for your camera including changing the settings in the reolink app. -Or my personal favourite assigning I fixed DHCP address from your router. How -to do either of these things is beyond the scope of this tutorial. +Or by assigning a fixed DHCP address from your router. How to do either of +these things is beyond the scope of this tutorial. -- Note for E1 and Lumos +- Note for E1 and Lumus - If your camera is an `E1` or a `Lumos` you will need to add the `format` line + If your camera is an E1 or a Lumus you will need to add the `format` line to your `[[ cameras ]]` block like this: ```toml @@ -145,8 +144,8 @@ Set up as many `[[ cameras ]]` as you want and save the file as `my_config.toml` ## Running Neolink -We are now ready to run neolink. Open up and terminal and navigate the the -folder where you `neolink` and `my_config.toml` are. +We are now ready to run neolink. Open up and terminal and navigate to the +folder where `neolink` and `my_config.toml` are. Run neolink with: @@ -154,7 +153,7 @@ Run neolink with: ./neolink --config my_config.toml ``` -You should see a message such as: +You should see messages such as: ``` [DATE TIME INFO neolink] Neolink 0.3.0 (unknown commit) release @@ -175,16 +174,15 @@ If you do not have `ffmpeg` installed yet do it now through your package manager: ```bash -sudo apt intall ffmpeg +sudo apt install ffmpeg ``` You must leave neolink running at the same time you run ffprobe. Neolink is a translator and it cannot translate reolink -> rtsp if you close it. The easiest way to do this is to open two terminals. One with neolink running and the other -we will use for running ffprobe. - -In a neo terminal run: +for running ffprobe. +In a new terminal run: ```bash ffprobe rtsp://127.0.0.1:8554/driveway @@ -216,7 +214,7 @@ If the mainStream fails but the subStream succeeds you may need to add - Missing dependancies - If you get a message such as: + If when start neolink you get a message such as: ``` libgstrtspserver-1.0.so.0: cannot open shared object file: No such file or directory @@ -254,7 +252,7 @@ If the mainStream fails but the subStream succeeds you may need to add - Advanced debugging: Missing plugins - If while running advanced debugging you get the message: + If while running advanced debugging you get a message like this: ``` GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "h265parse"! @@ -266,20 +264,20 @@ If the mainStream fails but the subStream succeeds you may need to add - Advanced debugging: Incorrect video format - If while running the advanced debugging you get the message: + If while running advanced debugging you get a message like this: ``` h265parse gsth265parse.c:1110:gst_h265_parse_handle_frame: broken/invalid nal Type: 48 Invalid, Size: 1073 will be dropped ``` You have not set the format to `h264` in the `[[ cameras ]]` config while - using an E1 or Lumos. + using an E1 or Lumus camera. Change the `[[ cameras ]]` config to include `format = "h264"` and restart neolink (If you are using another camera and you need to use h264 please let us - know so we can update this guide) + know via an issue so we can update this guide) - Something else From 9cc3ca856fde881142fbcd2564201fce001c1a04 Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Fri, 31 Jul 2020 11:38:52 -0500 Subject: [PATCH 3/3] Update to gstreamer bindings v0.16 --- Cargo.lock | 248 +++++++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 10 +-- src/gst.rs | 2 +- 3 files changed, 199 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a3ec9b..8646343 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anyhow" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" + [[package]] name = "arrayvec" version = "0.5.1" @@ -146,6 +152,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" + [[package]] name = "env_logger" version = "0.7.1" @@ -173,6 +185,21 @@ dependencies = [ "synstructure", ] +[[package]] +name = "futures" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.5" @@ -180,6 +207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -238,9 +266,13 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" dependencies = [ + "futures-channel", "futures-core", + "futures-io", "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project", "pin-utils", "proc-macro-hack", @@ -250,11 +282,12 @@ dependencies = [ [[package]] name = "gio" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd10f9415cce39b53f8024bf39a21f84f8157afa52da53837b102e585a296a5" +checksum = "3c5492e80b45e6c56214894a9a0cbe1340ab5066eb44a2dbe151393b6d7942c0" dependencies = [ "bitflags", + "futures", "futures-channel", "futures-core", "futures-io", @@ -263,27 +296,28 @@ dependencies = [ "glib", "glib-sys", "gobject-sys", - "lazy_static", "libc", + "once_cell", + "thiserror", ] [[package]] name = "gio-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fad225242b9eae7ec8a063bb86974aca56885014672375e5775dc0ea3533911" +checksum = "35993626299fbcaa73c0a19be8fdd01c950f9f3d3ac9cb4fb5532b924ab1a5d7" dependencies = [ "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "glib" -version = "0.9.3" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fb573a09841b6386ddf15fd4bc6655b4f5b106ca962f57ecaecde32a0061c0" +checksum = "a5e0533f48640d86e8e2f3cee778a9f97588d4a0bec8be065ee51ea52346d6c1" dependencies = [ "bitflags", "futures-channel", @@ -291,38 +325,55 @@ dependencies = [ "futures-executor", "futures-task", "futures-util", + "glib-macros", "glib-sys", "gobject-sys", - "lazy_static", "libc", + "once_cell", +] + +[[package]] +name = "glib-macros" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41486a26d1366a8032b160b59065a59fb528530a46a49f627e7048fb8c064039" +dependencies = [ + "anyhow", + "heck", + "itertools", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "glib-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95856f3802f446c05feffa5e24859fe6a183a7cb849c8449afc35c86b1e316e2" +checksum = "b6cda4af5c2f4507b7a3535b798dca2135293f4bc3a17f399ce244ef15841c4c" dependencies = [ "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gobject-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d1a804f62034eccf370006ccaef3708a71c31d561fee88564abe71177553d9" +checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" dependencies = [ "glib-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer" -version = "0.15.7" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce8664a114cd6ec16bece783d5eee59496919915b1f6884400ba4a953274a163" +checksum = "ce4ce1ba28d3293b8cb8c3d33f50e6da2e5cfeefa59a0d10d922ab8015791609" dependencies = [ "bitflags", "cfg-if", @@ -333,18 +384,20 @@ dependencies = [ "glib-sys", "gobject-sys", "gstreamer-sys", - "lazy_static", "libc", "muldiv", "num-rational", + "once_cell", "paste", + "pretty-hex", + "thiserror", ] [[package]] name = "gstreamer-app" -version = "0.15.6" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789784e8d42f5add1e1e965cf9f7e2d09e21dd0756bae6148f971db9a761d6a9" +checksum = "b2e9ca4df66162132a8d0083c5c5a40dea29ac619acb02395dba09e26bc1c500" dependencies = [ "bitflags", "futures-core", @@ -356,28 +409,28 @@ dependencies = [ "gstreamer-app-sys", "gstreamer-base", "gstreamer-sys", - "lazy_static", "libc", + "once_cell", ] [[package]] name = "gstreamer-app-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf869ce152c23bca5d761ab62146b47f750d0b28d4d499731857532897d48167" +checksum = "55d739f1289f37352884d716df1c571d365fe3eacb8164bc1996e8070053c949" dependencies = [ "glib-sys", "gstreamer-base-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-base" -version = "0.15.4" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42552f75cc6c260b0be180d5c955f4cd74bd170289c622404c25f1210b521c12" +checksum = "872893487ce8876f18c63730402822804c5762869f631d8e3e6b18aafc8399f0" dependencies = [ "bitflags", "glib", @@ -391,22 +444,22 @@ dependencies = [ [[package]] name = "gstreamer-base-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba384f52174b3c586593fca32642680a9e67961fea9f4cd8419f678965023bed" +checksum = "c0fd5a77d39b47568fba01274dfcb28dc32382513c697009f80b89ef63fd32fd" dependencies = [ "glib-sys", "gobject-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-net" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac25e8d5593775b3a641a39410f9b25e460177982efd853f92d173419e91585a" +checksum = "caf6b7e17559f3afd74285d3007c9268bbd47ecb692dcb27944a2f54385aba73" dependencies = [ "gio", "glib", @@ -419,23 +472,23 @@ dependencies = [ [[package]] name = "gstreamer-net-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b454eef96c2fd27f8ea701024be277227ae1fe88042ffc60e7cc5c452a2660" +checksum = "ffc58fef62ae238322f24ca6589bf39f885888ab3c345b8ce15998f9a0f1b199" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-rtsp" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "971814f153a41e9f170b30ebcfba08f13a57a03e1bfb4ac26a872577ee8bdef4" +checksum = "17c0154054089449fa595da343660d37a9241cdb8a8794a982c7dfc4a82629f1" dependencies = [ "bitflags", "gio", @@ -453,9 +506,9 @@ dependencies = [ [[package]] name = "gstreamer-rtsp-server" -version = "0.15.5" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79512e2f481f1fd2523a3e16b94f055a17c6c68a86da3a4b868085e5ac47ec8" +checksum = "ab8e59ac0e59b7c503359d4c617d1ca447ce2d263397b80d96f66312fb75ffc4" dependencies = [ "bitflags", "gio", @@ -472,15 +525,15 @@ dependencies = [ "gstreamer-sdp", "gstreamer-sdp-sys", "gstreamer-sys", - "lazy_static", "libc", + "once_cell", ] [[package]] name = "gstreamer-rtsp-server-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e73413368846d1a5e475fa29dd710232d5479e02c402f3bab82bcd6b9f35df" +checksum = "d09f446a03f00fe0859ca41ca6ab0150392e261eab8151c1f0e1067356e34dce" dependencies = [ "gio-sys", "glib-sys", @@ -490,14 +543,14 @@ dependencies = [ "gstreamer-sdp-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-rtsp-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6bbda651f809e0a48500f9bde3c07d662ed688051a57501dcb5f9d7b2a5fd9" +checksum = "2e12559129061c3b4cc218ff997f42a7ba8a23f3c0db356e8f5a54e12fa7c3dd" dependencies = [ "gio-sys", "glib-sys", @@ -505,14 +558,14 @@ dependencies = [ "gstreamer-sdp-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-sdp" -version = "0.15.6" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547b3b0eb9e01e13ab5cc066c817e2ab758f83790145f80f62d3c8e43c2966af" +checksum = "6ebbe4fbea4f2c67982c667ba57b64b01d43bc3dc1dc4a8d3512cb33a2adc7c1" dependencies = [ "glib", "glib-sys", @@ -524,27 +577,27 @@ dependencies = [ [[package]] name = "gstreamer-sdp-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e88ac4f9f20323ef3409dddcea3bbf58364ff8eea10b14da5303bfcb23347a" +checksum = "289c7f258d3387ae91c6058555922d8cf0704fc2bc870d1a03190bc81b040655" dependencies = [ "glib-sys", "gobject-sys", "gstreamer-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] name = "gstreamer-sys" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d18da01b97d0ab5896acd5151e4c155acefd0e6c03c3dd24dd133ba054053db" +checksum = "1321f34d53bb5f60ab1aaf581e29b664b8d41601714ee1bb7dbea490b5b9ff60" dependencies = [ "glib-sys", "gobject-sys", "libc", - "pkg-config", + "system-deps", ] [[package]] @@ -614,6 +667,15 @@ dependencies = [ "unindent", ] +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.6" @@ -701,12 +763,14 @@ dependencies = [ "crossbeam", "env_logger", "err-derive", + "gio", "glib", "gstreamer", "gstreamer-app", "gstreamer-rtsp", "gstreamer-rtsp-server", "indoc", + "itertools", "lazy_static", "log", "md5", @@ -746,9 +810,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138" dependencies = [ "autocfg", "num-integer", @@ -827,6 +891,21 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +[[package]] +name = "pretty-hex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be91bcc43e73799dc46a6c194a55e7aae1d86cc867c860fd4a436019af21bd8c" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.3" @@ -1021,6 +1100,24 @@ dependencies = [ "syn", ] +[[package]] +name = "strum" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" + +[[package]] +name = "strum_macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "syn" version = "1.0.33" @@ -1055,6 +1152,21 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "system-deps" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" +dependencies = [ + "heck", + "pkg-config", + "strum", + "strum_macros", + "thiserror", + "toml", + "version-compare", +] + [[package]] name = "termcolor" version = "1.1.0" @@ -1073,6 +1185,26 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "thiserror" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.0.1" @@ -1186,6 +1318,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version-compare" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" + [[package]] name = "version_check" version = "0.9.2" diff --git a/Cargo.toml b/Cargo.toml index 6610062..c39da13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,11 +13,11 @@ crossbeam = "0.7" env_logger = "*" err-derive = "0.2" glib = "*" -gio = "0.8" -gstreamer = "0.15" -gstreamer-app = "0.15" -gstreamer-rtsp = "0.15" -gstreamer-rtsp-server = { version = "0.15", features = ["v1_12", "v1_14"]} +gio = "0.9" +gstreamer = "0.16" +gstreamer-app = "0.16" +gstreamer-rtsp = "0.16" +gstreamer-rtsp-server = { version = "0.16", features = ["v1_12", "v1_14"]} lazy_static = "1.4" log = { version = "0.4" } indoc = "0.3" diff --git a/src/gst.rs b/src/gst.rs index be0a0e7..0d8438a 100644 --- a/src/gst.rs +++ b/src/gst.rs @@ -165,7 +165,7 @@ impl RtspServer { // We seperate reading the file and changing to a PEM so that we get different error messages. let cert_contents = fs::read_to_string(cert_file).expect("TLS file not found"); let cert = - TlsCertificate::new_from_pem(&cert_contents).expect("Not a valid TLS certificate"); + TlsCertificate::from_pem(&cert_contents).expect("Not a valid TLS certificate"); auth.set_tls_certificate(Some(&cert)); auth.set_tls_authentication_mode(client_auth);