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:
authorSebastian Dröge <sebastian@centricular.com>2020-11-22 19:44:28 +0300
committerSebastian Dröge <sebastian@centricular.com>2020-11-23 11:28:34 +0300
commitc3cd12d08bcb7518e295027bd44d94a7ebd8e5ba (patch)
tree135517c86b9c54f6e1f48f7a9078e601d75779e7 /tutorial/src
parent810f27886b88da51bf71b9141d17a62dd6970f47 (diff)
tutorial: Update to 2018 edition
Diffstat (limited to 'tutorial/src')
-rw-r--r--tutorial/src/identity/imp.rs3
-rw-r--r--tutorial/src/identity/mod.rs2
-rw-r--r--tutorial/src/lib.rs10
-rw-r--r--tutorial/src/progressbin/imp.rs3
-rw-r--r--tutorial/src/progressbin/mod.rs4
-rw-r--r--tutorial/src/rgb2gray/imp.rs3
-rw-r--r--tutorial/src/rgb2gray/mod.rs2
-rw-r--r--tutorial/src/sinesrc/imp.rs3
-rw-r--r--tutorial/src/sinesrc/mod.rs2
9 files changed, 14 insertions, 18 deletions
diff --git a/tutorial/src/identity/imp.rs b/tutorial/src/identity/imp.rs
index a02a18388..8bd8c65ea 100644
--- a/tutorial/src/identity/imp.rs
+++ b/tutorial/src/identity/imp.rs
@@ -10,6 +10,7 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_log, gst_trace};
use once_cell::sync::Lazy;
@@ -121,7 +122,7 @@ impl ObjectSubclass for Identity {
type Class = subclass::simple::ClassStruct<Self>;
// This macro provides some boilerplate.
- glib_object_subclass!();
+ glib::glib_object_subclass!();
// Called when a new instance is to be created. We need to return an instance
// of our struct here and also get the class struct passed in case it's needed
diff --git a/tutorial/src/identity/mod.rs b/tutorial/src/identity/mod.rs
index 027d52a52..c9b4c18d0 100644
--- a/tutorial/src/identity/mod.rs
+++ b/tutorial/src/identity/mod.rs
@@ -11,7 +11,7 @@ use glib::prelude::*;
mod imp;
// The public Rust wrapper type for our element
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Identity(ObjectSubclass<imp::Identity>) @extends gst::Element, gst::Object;
}
diff --git a/tutorial/src/lib.rs b/tutorial/src/lib.rs
index d42f75eb7..271b2878c 100644
--- a/tutorial/src/lib.rs
+++ b/tutorial/src/lib.rs
@@ -6,14 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#[macro_use]
-extern crate glib;
-#[macro_use]
-extern crate gstreamer as gst;
-extern crate gstreamer_audio as gst_audio;
-extern crate gstreamer_base as gst_base;
-extern crate gstreamer_video as gst_video;
-
mod identity;
mod progressbin;
mod rgb2gray;
@@ -34,7 +26,7 @@ fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
// Plugin name, plugin description, plugin entry point function, version number of this plugin,
// license of the plugin, source package name, binary package name, origin where it comes from
// and the date/time of release.
-gst_plugin_define!(
+gst::gst_plugin_define!(
rstutorial,
env!("CARGO_PKG_DESCRIPTION"),
plugin_init,
diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs
index 2546039e5..4488458c0 100644
--- a/tutorial/src/progressbin/imp.rs
+++ b/tutorial/src/progressbin/imp.rs
@@ -9,6 +9,7 @@
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
+use gst::gst_info;
use gst::prelude::*;
use gst::subclass::prelude::*;
use std::sync::Mutex;
@@ -63,7 +64,7 @@ impl ObjectSubclass for ProgressBin {
type Class = subclass::simple::ClassStruct<Self>;
// This macro provides some boilerplate.
- glib_object_subclass!();
+ glib::glib_object_subclass!();
// Called when a new instance is to be created. We need to return an instance
// of our struct here and also get the class struct passed in case it's needed
diff --git a/tutorial/src/progressbin/mod.rs b/tutorial/src/progressbin/mod.rs
index 4c1a41309..51551b64a 100644
--- a/tutorial/src/progressbin/mod.rs
+++ b/tutorial/src/progressbin/mod.rs
@@ -13,7 +13,7 @@ mod imp;
// This enum may be used to control what type of output the progressbin should produce.
// It also serves the secondary purpose of illustrating how to add enum-type properties
// to a plugin written in rust.
-#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, GEnum)]
+#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
#[repr(u32)]
#[genum(type_name = "GstProgressBinOutput")]
pub enum ProgressBinOutput {
@@ -30,7 +30,7 @@ pub enum ProgressBinOutput {
}
// The public Rust wrapper type for our element
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct ProgressBin(ObjectSubclass<imp::ProgressBin>) @extends gst::Bin, gst::Element, gst::Object;
}
diff --git a/tutorial/src/rgb2gray/imp.rs b/tutorial/src/rgb2gray/imp.rs
index 17c875907..17f2a61e9 100644
--- a/tutorial/src/rgb2gray/imp.rs
+++ b/tutorial/src/rgb2gray/imp.rs
@@ -10,6 +10,7 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_info, gst_loggable_error};
use gst_base::subclass::prelude::*;
use std::i32;
@@ -121,7 +122,7 @@ impl ObjectSubclass for Rgb2Gray {
type Class = subclass::simple::ClassStruct<Self>;
// This macro provides some boilerplate
- glib_object_subclass!();
+ glib::glib_object_subclass!();
// Called when a new instance is to be created. We need to return an instance
// of our struct here.
diff --git a/tutorial/src/rgb2gray/mod.rs b/tutorial/src/rgb2gray/mod.rs
index b85d708e4..0500f7d69 100644
--- a/tutorial/src/rgb2gray/mod.rs
+++ b/tutorial/src/rgb2gray/mod.rs
@@ -11,7 +11,7 @@ use glib::prelude::*;
mod imp;
// The public Rust wrapper type for our element
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct Rgb2Gray(ObjectSubclass<imp::Rgb2Gray>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
}
diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs
index c98e50ae0..3a6f79d78 100644
--- a/tutorial/src/sinesrc/imp.rs
+++ b/tutorial/src/sinesrc/imp.rs
@@ -10,6 +10,7 @@ use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
+use gst::{gst_debug, gst_element_error, gst_error, gst_info, gst_log, gst_loggable_error};
use gst_base::prelude::*;
use gst_base::subclass::prelude::*;
@@ -206,7 +207,7 @@ impl ObjectSubclass for SineSrc {
type Class = subclass::simple::ClassStruct<Self>;
// This macro provides some boilerplate.
- glib_object_subclass!();
+ glib::glib_object_subclass!();
// Called when a new instance is to be created. We need to return an instance
// of our struct here.
diff --git a/tutorial/src/sinesrc/mod.rs b/tutorial/src/sinesrc/mod.rs
index 7baf92280..4d9af02c8 100644
--- a/tutorial/src/sinesrc/mod.rs
+++ b/tutorial/src/sinesrc/mod.rs
@@ -11,7 +11,7 @@ use glib::prelude::*;
mod imp;
// The public Rust wrapper type for our element
-glib_wrapper! {
+glib::glib_wrapper! {
pub struct SineSrc(ObjectSubclass<imp::SineSrc>) @extends gst_base::BaseSrc, gst::Element, gst::Object;
}