forked from mirrors/gstreamer-rs
Change some const raw pointers to mutable
We cast them to a mutable pointer of another type right afterwards anyway.
This commit is contained in:
parent
931c485150
commit
58ccf666a6
10 changed files with 13 additions and 13 deletions
|
@ -384,7 +384,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstAggregatorClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorClass);
|
||||||
klass.flush = Some(aggregator_flush::<T>);
|
klass.flush = Some(aggregator_flush::<T>);
|
||||||
klass.clip = Some(aggregator_clip::<T>);
|
klass.clip = Some(aggregator_clip::<T>);
|
||||||
klass.finish_buffer = Some(aggregator_finish_buffer::<T>);
|
klass.finish_buffer = Some(aggregator_finish_buffer::<T>);
|
||||||
|
|
|
@ -87,7 +87,7 @@ unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for Aggrega
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<gst::PadClass as IsSubclassable<T>>::override_vfuncs(self);
|
<gst::PadClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstAggregatorPadClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstAggregatorPadClass);
|
||||||
klass.flush = Some(aggregator_pad_flush::<T>);
|
klass.flush = Some(aggregator_pad_flush::<T>);
|
||||||
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
|
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstBaseSinkClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSinkClass);
|
||||||
klass.start = Some(base_sink_start::<T>);
|
klass.start = Some(base_sink_start::<T>);
|
||||||
klass.stop = Some(base_sink_stop::<T>);
|
klass.stop = Some(base_sink_stop::<T>);
|
||||||
klass.render = Some(base_sink_render::<T>);
|
klass.render = Some(base_sink_render::<T>);
|
||||||
|
|
|
@ -215,7 +215,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstBaseSrcClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseSrcClass);
|
||||||
klass.start = Some(base_src_start::<T>);
|
klass.start = Some(base_src_start::<T>);
|
||||||
klass.stop = Some(base_src_stop::<T>);
|
klass.stop = Some(base_src_stop::<T>);
|
||||||
klass.is_seekable = Some(base_src_is_seekable::<T>);
|
klass.is_seekable = Some(base_src_is_seekable::<T>);
|
||||||
|
|
|
@ -282,7 +282,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
<gst::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstBaseTransformClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
|
||||||
klass.start = Some(base_transform_start::<T>);
|
klass.start = Some(base_transform_start::<T>);
|
||||||
klass.stop = Some(base_transform_stop::<T>);
|
klass.stop = Some(base_transform_stop::<T>);
|
||||||
klass.transform_caps = Some(base_transform_transform_caps::<T>);
|
klass.transform_caps = Some(base_transform_transform_caps::<T>);
|
||||||
|
@ -309,7 +309,7 @@ pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static {
|
||||||
<T as ObjectSubclass>::Instance: PanicPoison,
|
<T as ObjectSubclass>::Instance: PanicPoison,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstBaseTransformClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstBaseTransformClass);
|
||||||
|
|
||||||
klass.passthrough_on_same_caps = passthrough_on_same_caps.to_glib();
|
klass.passthrough_on_same_caps = passthrough_on_same_caps.to_glib();
|
||||||
klass.transform_ip_on_passthrough = transform_ip_on_passthrough.to_glib();
|
klass.transform_ip_on_passthrough = transform_ip_on_passthrough.to_glib();
|
||||||
|
|
|
@ -72,7 +72,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
<::ElementClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstBinClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstBinClass);
|
||||||
klass.add_element = Some(bin_add_element::<T>);
|
klass.add_element = Some(bin_add_element::<T>);
|
||||||
klass.remove_element = Some(bin_remove_element::<T>);
|
klass.remove_element = Some(bin_remove_element::<T>);
|
||||||
klass.handle_message = Some(bin_handle_message::<T>);
|
klass.handle_message = Some(bin_handle_message::<T>);
|
||||||
|
|
|
@ -185,7 +185,7 @@ pub unsafe trait ElementClassSubclassExt: Sized + 'static {
|
||||||
fn add_pad_template(&mut self, pad_template: PadTemplate) {
|
fn add_pad_template(&mut self, pad_template: PadTemplate) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_element_class_add_pad_template(
|
ffi::gst_element_class_add_pad_template(
|
||||||
self as *const Self as *mut ffi::GstElementClass,
|
self as *mut Self as *mut ffi::GstElementClass,
|
||||||
pad_template.to_glib_none().0,
|
pad_template.to_glib_none().0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ pub unsafe trait ElementClassSubclassExt: Sized + 'static {
|
||||||
) {
|
) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_element_class_set_metadata(
|
ffi::gst_element_class_set_metadata(
|
||||||
self as *const Self as *mut ffi::GstElementClass,
|
self as *mut Self as *mut ffi::GstElementClass,
|
||||||
long_name.to_glib_none().0,
|
long_name.to_glib_none().0,
|
||||||
classification.to_glib_none().0,
|
classification.to_glib_none().0,
|
||||||
description.to_glib_none().0,
|
description.to_glib_none().0,
|
||||||
|
@ -220,7 +220,7 @@ where
|
||||||
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
|
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstElementClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstElementClass);
|
||||||
klass.change_state = Some(element_change_state::<T>);
|
klass.change_state = Some(element_change_state::<T>);
|
||||||
klass.request_new_pad = Some(element_request_new_pad::<T>);
|
klass.request_new_pad = Some(element_request_new_pad::<T>);
|
||||||
klass.release_pad = Some(element_release_pad::<T>);
|
klass.release_pad = Some(element_release_pad::<T>);
|
||||||
|
|
|
@ -19,7 +19,7 @@ unsafe impl<T: ObjectSubclass + GhostPadImpl> IsSubclassable<T> for GhostPadClas
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<::PadClass as IsSubclassable<T>>::override_vfuncs(self);
|
<::PadClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let _klass = &mut *(self as *const Self as *mut ffi::GstGhostPadClass);
|
let _klass = &mut *(self as *mut Self as *mut ffi::GstGhostPadClass);
|
||||||
// Nothing to do here
|
// Nothing to do here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ unsafe impl<T: ObjectSubclass + PadImpl> IsSubclassable<T> for PadClass {
|
||||||
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
|
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let klass = &mut *(self as *const Self as *mut ffi::GstPadClass);
|
let klass = &mut *(self as *mut Self as *mut ffi::GstPadClass);
|
||||||
klass.linked = Some(pad_linked::<T>);
|
klass.linked = Some(pad_linked::<T>);
|
||||||
klass.unlinked = Some(pad_unlinked::<T>);
|
klass.unlinked = Some(pad_unlinked::<T>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ where
|
||||||
fn override_vfuncs(&mut self) {
|
fn override_vfuncs(&mut self) {
|
||||||
<::BinClass as IsSubclassable<T>>::override_vfuncs(self);
|
<::BinClass as IsSubclassable<T>>::override_vfuncs(self);
|
||||||
unsafe {
|
unsafe {
|
||||||
let _klass = &mut *(self as *const Self as *mut ffi::GstPipelineClass);
|
let _klass = &mut *(self as *mut Self as *mut ffi::GstPipelineClass);
|
||||||
// Nothing to do here
|
// Nothing to do here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue