gstreamer: Add support for subclassing gst::SystemClock

This commit is contained in:
Sebastian Dröge 2019-09-25 17:19:51 +03:00
parent bacf4998ce
commit 6abb0d3506
2 changed files with 28 additions and 0 deletions

View file

@ -32,6 +32,7 @@ pub mod device;
pub mod device_provider; pub mod device_provider;
pub mod clock; pub mod clock;
pub mod system_clock;
pub mod preset; pub mod preset;
pub mod tag_setter; pub mod tag_setter;
@ -50,6 +51,7 @@ pub mod prelude {
pub use super::pad::{PadImpl, PadImplExt}; pub use super::pad::{PadImpl, PadImplExt};
pub use super::pipeline::PipelineImpl; pub use super::pipeline::PipelineImpl;
pub use super::preset::PresetImpl; pub use super::preset::PresetImpl;
pub use super::system_clock::SystemClockImpl;
pub use super::tag_setter::TagSetterImpl; pub use super::tag_setter::TagSetterImpl;
pub use super::uri_handler::URIHandlerImpl; pub use super::uri_handler::URIHandlerImpl;
pub use super::PanicPoison; pub use super::PanicPoison;

View file

@ -0,0 +1,26 @@
// Copyright (C) 2019 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use gst_sys;
use super::prelude::*;
use glib::subclass::prelude::*;
use SystemClockClass;
pub trait SystemClockImpl: ClockImpl + Send + Sync + 'static {}
unsafe impl<T: ObjectSubclass + SystemClockImpl> IsSubclassable<T> for SystemClockClass {
fn override_vfuncs(&mut self) {
<::ClockClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe {
let _klass = &mut *(self as *mut Self as *mut gst_sys::GstSystemClockClass);
// Nothing to do here
}
}
}