Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorahamedsajeer.15 <ahamedsajeer.15@cse.mrt.ac.lk>2019-06-03 13:53:58 +0300
committerSebastian Dröge <slomo@coaxion.net>2019-06-03 14:11:29 +0300
commitdc45b7f8acfd496ea1aff10b80fcb1736b1d791e (patch)
tree58aff805ebbaeeb101cb5e0b0fa582d368a062c0
parent0f15b58453844b1e29d5e8ece906c26d58fce86d (diff)
Add build.rs that provides a version number, release date and other details
-rw-r--r--Cargo.toml1
-rw-r--r--gst-plugin-audiofx/Cargo.toml4
-rw-r--r--gst-plugin-audiofx/build.rs5
-rw-r--r--gst-plugin-audiofx/src/lib.rs12
-rw-r--r--gst-plugin-cdg/Cargo.toml4
-rw-r--r--gst-plugin-cdg/build.rs5
-rw-r--r--gst-plugin-cdg/src/lib.rs12
-rw-r--r--gst-plugin-closedcaption/Cargo.toml5
-rw-r--r--gst-plugin-closedcaption/build.rs5
-rw-r--r--gst-plugin-closedcaption/src/lib.rs12
-rw-r--r--gst-plugin-file/Cargo.toml6
-rw-r--r--gst-plugin-file/build.rs5
-rw-r--r--gst-plugin-file/src/lib.rs12
-rw-r--r--gst-plugin-flv/Cargo.toml4
-rw-r--r--gst-plugin-flv/build.rs5
-rw-r--r--gst-plugin-flv/src/lib.rs12
-rw-r--r--gst-plugin-http/Cargo.toml4
-rw-r--r--gst-plugin-http/build.rs5
-rw-r--r--gst-plugin-http/src/lib.rs12
-rw-r--r--gst-plugin-rav1e/Cargo.toml4
-rw-r--r--gst-plugin-rav1e/build.rs5
-rw-r--r--gst-plugin-rav1e/src/lib.rs12
-rw-r--r--gst-plugin-s3/Cargo.toml4
-rw-r--r--gst-plugin-s3/build.rs5
-rw-r--r--gst-plugin-s3/src/lib.rs12
-rw-r--r--gst-plugin-sodium/Cargo.toml5
-rw-r--r--gst-plugin-sodium/build.rs5
-rw-r--r--gst-plugin-sodium/src/lib.rs14
-rw-r--r--gst-plugin-threadshare/Cargo.toml7
-rw-r--r--gst-plugin-threadshare/build.rs5
-rw-r--r--gst-plugin-threadshare/src/lib.rs12
-rw-r--r--gst-plugin-togglerecord/Cargo.toml5
-rw-r--r--gst-plugin-togglerecord/build.rs5
-rw-r--r--gst-plugin-togglerecord/src/lib.rs12
-rw-r--r--gst-plugin-tutorial/Cargo.toml4
-rw-r--r--gst-plugin-tutorial/build.rs5
-rw-r--r--gst-plugin-tutorial/src/lib.rs12
-rw-r--r--gst-plugin-version-helper/Cargo.toml9
-rw-r--r--gst-plugin-version-helper/src/lib.rs34
39 files changed, 230 insertions, 76 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 54d02a3a9..eb2e15ad3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ members = [
"gst-plugin-threadshare",
"gst-plugin-tutorial",
"gst-plugin-closedcaption",
+ "gst-plugin-version-helper",
"gst-plugin-sodium",
"gst-plugin-cdg",
"gst-plugin-rav1e",
diff --git a/gst-plugin-audiofx/Cargo.toml b/gst-plugin-audiofx/Cargo.toml
index db3cfd685..cdd47b701 100644
--- a/gst-plugin-audiofx/Cargo.toml
+++ b/gst-plugin-audiofx/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
+description = "Rust AudioFx Plugin"
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib" }
@@ -17,3 +18,6 @@ num-traits = "0.2"
name = "gstrsaudiofx"
crate-type = ["cdylib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-audiofx/build.rs b/gst-plugin-audiofx/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-audiofx/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-audiofx/src/lib.rs b/gst-plugin-audiofx/src/lib.rs
index 56122740f..b2ba3319c 100644
--- a/gst-plugin-audiofx/src/lib.rs
+++ b/gst-plugin-audiofx/src/lib.rs
@@ -25,12 +25,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rsaudiofx,
- "Rust AudioFx Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rsaudiofx",
- "rsaudiofx",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2016-12-08"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-cdg/Cargo.toml b/gst-plugin-cdg/Cargo.toml
index 0af74cb30..6329b9999 100644
--- a/gst-plugin-cdg/Cargo.toml
+++ b/gst-plugin-cdg/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Guillaume Desmottes <guillaume.desmottes@collabora.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs"
license = "MIT/Apache-2.0"
+description = "CDG Plugin"
edition = "2018"
[dependencies]
@@ -21,3 +22,6 @@ muldiv = "0.2"
name = "gstcdg"
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-cdg/build.rs b/gst-plugin-cdg/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-cdg/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-cdg/src/lib.rs b/gst-plugin-cdg/src/lib.rs
index 249700078..7e33cd5bf 100644
--- a/gst-plugin-cdg/src/lib.rs
+++ b/gst-plugin-cdg/src/lib.rs
@@ -21,12 +21,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
cdg,
- "CDG Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "cdg",
- "cdg",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs",
- "2019-05-01"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-closedcaption/Cargo.toml b/gst-plugin-closedcaption/Cargo.toml
index 88b61e4ed..a4f6c5fa8 100644
--- a/gst-plugin-closedcaption/Cargo.toml
+++ b/gst-plugin-closedcaption/Cargo.toml
@@ -4,6 +4,8 @@ version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>", "Jordan Petridis <jordan@centricular.com>"]
license = "LGPL-2.1+"
edition = "2018"
+description = "Rust Closed Caption Plugin"
+repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib", features = ["subclassing"] }
@@ -40,3 +42,6 @@ package="gstreamer-check"
name = "gstrsclosedcaption"
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-closedcaption/build.rs b/gst-plugin-closedcaption/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-closedcaption/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-closedcaption/src/lib.rs b/gst-plugin-closedcaption/src/lib.rs
index 35272b481..ff38aec56 100644
--- a/gst-plugin-closedcaption/src/lib.rs
+++ b/gst-plugin-closedcaption/src/lib.rs
@@ -52,12 +52,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rsclosedcaption,
- "Rust Closed Caption Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "0.1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"LGPL",
- "rsclosedcaption",
- "rsclosedcaption",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2018-12-17"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-file/Cargo.toml b/gst-plugin-file/Cargo.toml
index 1a49fa0be..423ff6dee 100644
--- a/gst-plugin-file/Cargo.toml
+++ b/gst-plugin-file/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
+description = "Rust File Plugin"
[dependencies]
url = "1.1"
@@ -14,4 +15,7 @@ gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
[lib]
name = "gstrsfile"
crate-type = ["cdylib"]
-path = "src/lib.rs" \ No newline at end of file
+path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-file/build.rs b/gst-plugin-file/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-file/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-file/src/lib.rs b/gst-plugin-file/src/lib.rs
index 38aab8f52..8d3c9762c 100644
--- a/gst-plugin-file/src/lib.rs
+++ b/gst-plugin-file/src/lib.rs
@@ -27,12 +27,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rsfile,
- "Rust File Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rsfile",
- "rsfile",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2016-12-08"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-flv/Cargo.toml b/gst-plugin-flv/Cargo.toml
index e7cd0cff4..bf8b114ff 100644
--- a/gst-plugin-flv/Cargo.toml
+++ b/gst-plugin-flv/Cargo.toml
@@ -5,6 +5,7 @@ authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
edition = "2018"
+description = "Rust FLV Plugin"
[dependencies]
url = "1.1"
@@ -23,3 +24,6 @@ smallvec = "0.6"
name = "gstrsflv"
crate-type = ["cdylib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-flv/build.rs b/gst-plugin-flv/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-flv/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-flv/src/lib.rs b/gst-plugin-flv/src/lib.rs
index 34882bf70..7cab1829b 100644
--- a/gst-plugin-flv/src/lib.rs
+++ b/gst-plugin-flv/src/lib.rs
@@ -26,12 +26,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rsflv,
- "Rust FLV Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rsflv",
- "rsflv",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2016-12-08"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-http/Cargo.toml b/gst-plugin-http/Cargo.toml
index 6e41e6796..4bc82ffe6 100644
--- a/gst-plugin-http/Cargo.toml
+++ b/gst-plugin-http/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
+description = "Rust HTTP Plugin"
[dependencies]
url = "1.1"
@@ -17,3 +18,6 @@ gstreamer-base = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"
name = "gstrshttp"
crate-type = ["cdylib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-http/build.rs b/gst-plugin-http/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-http/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-http/src/lib.rs b/gst-plugin-http/src/lib.rs
index e5d173612..4f7eb0558 100644
--- a/gst-plugin-http/src/lib.rs
+++ b/gst-plugin-http/src/lib.rs
@@ -25,12 +25,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rshttp,
- "Rust HTTP Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rshttp",
- "rshttp",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2016-12-08"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-rav1e/Cargo.toml b/gst-plugin-rav1e/Cargo.toml
index e9a971d1a..310b64534 100644
--- a/gst-plugin-rav1e/Cargo.toml
+++ b/gst-plugin-rav1e/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs"
license = "MIT/Apache-2.0"
+description = "rav1e AV1 Encoder Plugin"
edition = "2018"
[dependencies]
@@ -17,3 +18,6 @@ rav1e = { git = "https://github.com/xiph/rav1e.git", default-features=false }
name = "gstrav1e"
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-rav1e/build.rs b/gst-plugin-rav1e/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-rav1e/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-rav1e/src/lib.rs b/gst-plugin-rav1e/src/lib.rs
index 86a676819..96a4f232d 100644
--- a/gst-plugin-rav1e/src/lib.rs
+++ b/gst-plugin-rav1e/src/lib.rs
@@ -21,12 +21,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
rav1e,
- "rav1e AV1 Encoder Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rav1e",
- "rav1e",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs",
- "2019-05-25"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-s3/Cargo.toml b/gst-plugin-s3/Cargo.toml
index cf9d41301..92c99049a 100644
--- a/gst-plugin-s3/Cargo.toml
+++ b/gst-plugin-s3/Cargo.toml
@@ -4,6 +4,7 @@ version = "0.5.0"
authors = ["Arun Raghavan <arun@arunraghavan.net>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs"
license = "MIT/Apache-2.0"
+description = "Amazon S3 Plugin"
edition = "2018"
[dependencies]
@@ -21,3 +22,6 @@ tokio = "0.1"
name = "gsts3"
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-s3/build.rs b/gst-plugin-s3/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-s3/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-s3/src/lib.rs b/gst-plugin-s3/src/lib.rs
index 6d637f555..0bf0f74de 100644
--- a/gst-plugin-s3/src/lib.rs
+++ b/gst-plugin-s3/src/lib.rs
@@ -23,12 +23,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
s3,
- "Amazon S3 Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "s3",
- "s3",
- "https://github.com/ford-prefect/gst-plugin-s3",
- "2017-04-17"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-sodium/Cargo.toml b/gst-plugin-sodium/Cargo.toml
index 003d5b5e4..29fddff63 100644
--- a/gst-plugin-sodium/Cargo.toml
+++ b/gst-plugin-sodium/Cargo.toml
@@ -2,6 +2,8 @@
name = "gst-plugin-sodium"
version = "0.1.0"
authors = ["Jordan Petridis <jordan@centricular.com>"]
+repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs"
+description = "libsodium-based file encryption and decryption"
edition = "2018"
[dependencies]
@@ -49,3 +51,6 @@ required-features = ["serde", "serde_json", "clap"]
name = "decrypt-example"
path = "examples/decrypt_example.rs"
required-features = ["serde", "serde_json", "clap"]
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-sodium/build.rs b/gst-plugin-sodium/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-sodium/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-sodium/src/lib.rs b/gst-plugin-sodium/src/lib.rs
index 43b05c6e8..01094556c 100644
--- a/gst-plugin-sodium/src/lib.rs
+++ b/gst-plugin-sodium/src/lib.rs
@@ -1,5 +1,3 @@
-// lib.rs
-//
// Copyright 2019 Jordan Petridis <jordan@centricular.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -75,12 +73,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
sodium,
- "libsodium-based file encryption and decryption",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "sodium",
- "sodium",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2019-03-18"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-threadshare/Cargo.toml b/gst-plugin-threadshare/Cargo.toml
index d9158e517..077531b93 100644
--- a/gst-plugin-threadshare/Cargo.toml
+++ b/gst-plugin-threadshare/Cargo.toml
@@ -1,8 +1,10 @@
[package]
name = "gst-plugin-threadshare"
-version = "0.1.0"
+version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "LGPL-2.1+"
+description = "Threadshare Plugin"
+repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
[dependencies]
libc = "0.2"
@@ -47,3 +49,6 @@ path = "examples/udpsrc_benchmark_sender.rs"
[[example]]
name = "tcpclientsrc-benchmark-sender"
path = "examples/tcpclientsrc_benchmark_sender.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-threadshare/build.rs b/gst-plugin-threadshare/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-threadshare/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-threadshare/src/lib.rs b/gst-plugin-threadshare/src/lib.rs
index cf9fe17c2..f6564cc85 100644
--- a/gst-plugin-threadshare/src/lib.rs
+++ b/gst-plugin-threadshare/src/lib.rs
@@ -73,14 +73,14 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
threadshare,
- "Threadshare Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "0.1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"LGPL",
- "threadshare",
- "threadshare",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2018-03-01"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
pub fn set_element_flags<T: glib::IsA<gst::Object> + glib::IsA<gst::Element>>(
diff --git a/gst-plugin-togglerecord/Cargo.toml b/gst-plugin-togglerecord/Cargo.toml
index 039bca823..640fdad66 100644
--- a/gst-plugin-togglerecord/Cargo.toml
+++ b/gst-plugin-togglerecord/Cargo.toml
@@ -3,6 +3,8 @@ name = "gst-plugin-togglerecord"
version = "0.5.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
license = "LGPL-2.1+"
+description = "Toggle Record Plugin"
+repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib", features = ["subclassing"] }
@@ -24,3 +26,6 @@ path = "src/lib.rs"
name = "gtk-recording"
path = "examples/gtk_recording.rs"
required-features = ["gtk", "gio"]
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-togglerecord/build.rs b/gst-plugin-togglerecord/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-togglerecord/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-togglerecord/src/lib.rs b/gst-plugin-togglerecord/src/lib.rs
index e6719deae..140a239a9 100644
--- a/gst-plugin-togglerecord/src/lib.rs
+++ b/gst-plugin-togglerecord/src/lib.rs
@@ -33,12 +33,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
gst_plugin_define!(
togglerecord,
- "Toggle Record Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "0.1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"LGPL",
- "togglerecord",
- "togglerecord",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2017-12-04"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-tutorial/Cargo.toml b/gst-plugin-tutorial/Cargo.toml
index a21e16ccf..cc31e5553 100644
--- a/gst-plugin-tutorial/Cargo.toml
+++ b/gst-plugin-tutorial/Cargo.toml
@@ -5,6 +5,7 @@ authors = ["Sebastian Dröge <sebastian@centricular.com>"]
repository = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs"
license = "MIT/Apache-2.0"
edition = "2018"
+description = "Rust Tutorial Plugin"
[dependencies]
glib = { git = "https://github.com/gtk-rs/glib", features = ["subclassing"] }
@@ -19,3 +20,6 @@ num-traits = "0.2"
name = "gstrstutorial"
crate-type = ["cdylib"]
path = "src/lib.rs"
+
+[build-dependencies]
+gst-plugin-version-helper = { path="../gst-plugin-version-helper" }
diff --git a/gst-plugin-tutorial/build.rs b/gst-plugin-tutorial/build.rs
new file mode 100644
index 000000000..0d1ddb61d
--- /dev/null
+++ b/gst-plugin-tutorial/build.rs
@@ -0,0 +1,5 @@
+extern crate gst_plugin_version_helper;
+
+fn main() {
+ gst_plugin_version_helper::get_info()
+}
diff --git a/gst-plugin-tutorial/src/lib.rs b/gst-plugin-tutorial/src/lib.rs
index 0dee71798..6fdf73c0f 100644
--- a/gst-plugin-tutorial/src/lib.rs
+++ b/gst-plugin-tutorial/src/lib.rs
@@ -39,12 +39,12 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
// and the date/time of release.
gst_plugin_define!(
rstutorial,
- "Rust Tutorial Plugin",
+ env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
- "1.0",
+ concat!(env!("CARGO_PKG_VERSION"), "-", env!("COMMIT_ID")),
"MIT/X11",
- "rstutorial",
- "rstutorial",
- "https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs",
- "2017-12-30"
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_NAME"),
+ env!("CARGO_PKG_REPOSITORY"),
+ env!("BUILD_REL_DATE")
);
diff --git a/gst-plugin-version-helper/Cargo.toml b/gst-plugin-version-helper/Cargo.toml
new file mode 100644
index 000000000..1848ddce1
--- /dev/null
+++ b/gst-plugin-version-helper/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "gst-plugin-version-helper"
+version = "0.1.0"
+authors = ["Sajeer Ahamed <ahamedsajeer.15.15@cse.mrt.ac.lk>"]
+edition = "2018"
+
+[dependencies]
+git2 = "0.8.0"
+chrono = "0.4.6"
diff --git a/gst-plugin-version-helper/src/lib.rs b/gst-plugin-version-helper/src/lib.rs
new file mode 100644
index 000000000..1d37fa960
--- /dev/null
+++ b/gst-plugin-version-helper/src/lib.rs
@@ -0,0 +1,34 @@
+use chrono::TimeZone;
+use git2::{Commit, ObjectType, Repository};
+use std::path;
+
+pub fn get_info() -> () {
+ let mut commit_id = "UNKNOWN".to_string();
+ let mut commit_date = chrono::Utc::now().format("%Y-%m-%d").to_string();
+
+ let mut repo_dir = path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
+ repo_dir.pop();
+
+ let repo = Repository::open(&repo_dir);
+
+ if let Ok(repo) = repo {
+ let commit = find_last_commit(&repo).expect("Couldn't find last commit");
+ commit_id = oid_to_short_sha(commit.id());
+ let timestamp = commit.time().seconds();
+ let dt = chrono::Utc.timestamp(timestamp, 0);
+ commit_date = dt.format("%Y-%m-%d").to_string()
+ }
+
+ println!("cargo:rustc-env=COMMIT_ID={}", commit_id);
+ println!("cargo:rustc-env=BUILD_REL_DATE={}", commit_date);
+}
+
+fn find_last_commit(repo: &Repository) -> Result<Commit, git2::Error> {
+ let obj = repo.head()?.resolve()?.peel(ObjectType::Commit)?;
+ obj.into_commit()
+ .map_err(|_| git2::Error::from_str("Couldn't find commit"))
+}
+
+fn oid_to_short_sha(oid: git2::Oid) -> String {
+ oid.to_string()[..8].to_string()
+}