gstreamer-controller: Update manual code to 2018 edition

This commit is contained in:
Sebastian Dröge 2020-11-21 20:50:21 +02:00
parent 34074ff0af
commit 508fd2cde1
3 changed files with 20 additions and 30 deletions

View file

@ -11,16 +11,14 @@ homepage = "https://gstreamer.freedesktop.org"
documentation = "https://gstreamer.pages.freedesktop.org/gstreamer-rs/gstreamer_controller/"
keywords = ["gstreamer", "multimedia", "audio", "video", "gnome"]
build = "build.rs"
edition = "2018"
[dependencies]
bitflags = "1.0"
once_cell = "1.0"
glib-sys = { git = "https://github.com/gtk-rs/gtk-rs" }
gobject-sys = { git = "https://github.com/gtk-rs/gtk-rs" }
gstreamer-sys = { path = "../gstreamer/sys", features = ["v1_8"] }
gstreamer-controller-sys = { path = "../gstreamer-controller/sys", features = ["v1_8"] }
ffi = { package = "gstreamer-controller-sys", path = "../gstreamer-controller/sys", features = ["v1_8"] }
glib = { git = "https://github.com/gtk-rs/gtk-rs" }
gstreamer = { path = "../gstreamer" }
gst = { package = "gstreamer", path = "../gstreamer" }
[build-dependencies.rustdoc-stripper]
version = "0.1"
@ -28,14 +26,14 @@ optional = true
[features]
default = []
v1_10 = ["gstreamer/v1_10", "gstreamer-controller-sys/v1_10"]
v1_12 = ["gstreamer/v1_12", "gstreamer-controller-sys/v1_12", "v1_10"]
v1_14 = ["gstreamer/v1_14", "gstreamer-controller-sys/v1_14", "v1_12"]
v1_16 = ["gstreamer/v1_16", "gstreamer-controller-sys/v1_16", "v1_14"]
v1_18 = ["gstreamer/v1_18", "gstreamer-controller-sys/v1_18", "v1_16"]
v1_10 = ["gst/v1_10", "ffi/v1_10"]
v1_12 = ["gst/v1_12", "ffi/v1_12", "v1_10"]
v1_14 = ["gst/v1_14", "ffi/v1_14", "v1_12"]
v1_16 = ["gst/v1_16", "ffi/v1_16", "v1_14"]
v1_18 = ["gst/v1_18", "ffi/v1_18", "v1_16"]
embed-lgpl-docs = ["rustdoc-stripper"]
purge-lgpl-docs = ["rustdoc-stripper"]
dox = ["v1_18", "gstreamer-controller-sys/dox", "glib/dox", "gstreamer/dox"]
dox = ["v1_18", "ffi/dox", "glib/dox", "gst/dox"]
[package.metadata.docs.rs]
dox = ["v1_18", "gstreamer-controller-sys/dox", "glib/dox", "gstreamer/dox"]
dox = ["v1_18", "ffi/dox", "glib/dox", "gst/dox"]

View file

@ -1,14 +1,13 @@
use glib::translate::*;
use gst_controller_sys;
glib_wrapper! {
glib::glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ControlPoint(Boxed<gst_controller_sys::GstControlPoint>);
pub struct ControlPoint(Boxed<ffi::GstControlPoint>);
match fn {
copy => |ptr| gst_controller_sys::gst_control_point_copy(mut_override(ptr)),
free => |ptr| gst_controller_sys::gst_control_point_free(ptr),
get_type => || gst_controller_sys::gst_control_point_get_type(),
copy => |ptr| ffi::gst_control_point_copy(mut_override(ptr)),
free => |ptr| ffi::gst_control_point_free(ptr),
get_type => || ffi::gst_control_point_get_type(),
}
}

View file

@ -1,17 +1,10 @@
#![cfg_attr(feature = "dox", feature(doc_cfg))]
#[macro_use]
extern crate glib;
extern crate glib_sys;
extern crate gobject_sys;
extern crate gstreamer as gst;
extern crate gstreamer_sys as gst_sys;
extern crate gstreamer_controller_sys as gst_controller_sys;
pub use ffi;
macro_rules! assert_initialized_main_thread {
() => {
if unsafe { ::gst_sys::gst_is_initialized() } != ::glib_sys::GTRUE {
if unsafe { gst::ffi::gst_is_initialized() } != glib::ffi::GTRUE {
panic!("GStreamer has not been initialized. Call `gst::init` first.");
}
};
@ -26,9 +19,9 @@ macro_rules! skip_assert_initialized {
#[allow(clippy::match_same_arms)]
mod auto;
mod control_point;
pub use auto::*;
use control_point::*;
pub use crate::auto::*;
use crate::control_point::*;
pub mod prelude {
pub use auto::traits::*;
pub use crate::auto::traits::*;
}