Replace T::type_data with Self::type_data for clippy::use_self

This commit is contained in:
Marijn Suijten 2021-04-29 22:06:41 +02:00
parent e52e4328b3
commit 980304ce36
27 changed files with 255 additions and 255 deletions

View file

@ -164,7 +164,7 @@ pub trait AudioDecoderImplExt: ObjectSubclass {
impl<T: AudioDecoderImpl> AudioDecoderImplExt for T { impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.open .open
@ -188,7 +188,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.close .close
@ -212,7 +212,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.start .start
@ -236,7 +236,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.stop .stop
@ -264,7 +264,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
@ -288,7 +288,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
adapter: &gst_base::Adapter, adapter: &gst_base::Adapter,
) -> Result<(u32, u32), gst::FlowError> { ) -> Result<(u32, u32), gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.parse .parse
@ -323,7 +323,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
buffer: Option<&gst::Buffer>, buffer: Option<&gst::Buffer>,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
@ -346,7 +346,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_ptr(); let mut buffer = buffer.into_ptr();
@ -367,7 +367,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_flush(&self, element: &Self::Type, hard: bool) { fn parent_flush(&self, element: &Self::Type, hard: bool) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.flush .flush
@ -383,7 +383,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -400,7 +400,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
@ -420,7 +420,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
@ -434,7 +434,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
@ -448,7 +448,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
@ -462,7 +462,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
@ -480,7 +480,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
@ -507,7 +507,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioDecoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation

View file

@ -150,7 +150,7 @@ pub trait AudioEncoderImplExt: ObjectSubclass {
impl<T: AudioEncoderImpl> AudioEncoderImplExt for T { impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.open .open
@ -174,7 +174,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.close .close
@ -198,7 +198,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.start .start
@ -222,7 +222,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.stop .stop
@ -250,7 +250,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
info: &AudioInfo, info: &AudioInfo,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
@ -274,7 +274,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
buffer: Option<&gst::Buffer>, buffer: Option<&gst::Buffer>,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
@ -297,7 +297,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_ptr(); let mut buffer = buffer.into_ptr();
@ -318,7 +318,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) { fn parent_flush(&self, element: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.flush .flush
@ -329,7 +329,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -346,7 +346,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
@ -366,7 +366,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
@ -380,7 +380,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
@ -394,7 +394,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
@ -408,7 +408,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
@ -426,7 +426,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
@ -453,7 +453,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioEncoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation

View file

@ -60,7 +60,7 @@ pub trait AudioSinkImplExt: ObjectSubclass {
impl<T: AudioSinkImpl> AudioSinkImplExt for T { impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_close(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_close(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
None => return Ok(()), None => return Ok(()),
@ -76,7 +76,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_delay(&self, sink: &Self::Type) -> u32 { fn parent_delay(&self, sink: &Self::Type) -> u32 {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
Some(f) => f, Some(f) => f,
@ -88,7 +88,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_open(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_open(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
Some(f) => f, Some(f) => f,
@ -108,7 +108,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
spec: &mut AudioRingBufferSpec, spec: &mut AudioRingBufferSpec,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
Some(f) => f, Some(f) => f,
@ -127,7 +127,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_unprepare(&self, sink: &Self::Type) -> Result<(), LoggableError> { fn parent_unprepare(&self, sink: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
Some(f) => f, Some(f) => f,
@ -148,7 +148,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_write(&self, sink: &Self::Type, buffer: &[u8]) -> Result<i32, LoggableError> { fn parent_write(&self, sink: &Self::Type, buffer: &[u8]) -> Result<i32, LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
let f = match (*parent_class).write { let f = match (*parent_class).write {
Some(f) => f, Some(f) => f,
@ -173,7 +173,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_reset(&self, sink: &Self::Type) { fn parent_reset(&self, sink: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
f(sink.unsafe_cast_ref::<AudioSink>().to_glib_none().0) f(sink.unsafe_cast_ref::<AudioSink>().to_glib_none().0)

View file

@ -70,7 +70,7 @@ pub trait AudioSrcImplExt: ObjectSubclass {
impl<T: AudioSrcImpl> AudioSrcImplExt for T { impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_close(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_close(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
None => return Ok(()), None => return Ok(()),
@ -86,7 +86,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_delay(&self, src: &Self::Type) -> u32 { fn parent_delay(&self, src: &Self::Type) -> u32 {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
Some(f) => f, Some(f) => f,
@ -98,7 +98,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_open(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_open(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
Some(f) => f, Some(f) => f,
@ -118,7 +118,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
spec: &mut AudioRingBufferSpec, spec: &mut AudioRingBufferSpec,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
Some(f) => f, Some(f) => f,
@ -137,7 +137,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_unprepare(&self, src: &Self::Type) -> Result<(), LoggableError> { fn parent_unprepare(&self, src: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
Some(f) => f, Some(f) => f,
@ -162,7 +162,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
buffer: &mut [u8], buffer: &mut [u8],
) -> Result<(u32, gst::ClockTime), LoggableError> { ) -> Result<(u32, gst::ClockTime), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
let f = match (*parent_class).read { let f = match (*parent_class).read {
Some(f) => f, Some(f) => f,
@ -189,7 +189,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_reset(&self, src: &Self::Type) { fn parent_reset(&self, src: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
f(src.unsafe_cast_ref::<AudioSrc>().to_glib_none().0) f(src.unsafe_cast_ref::<AudioSrc>().to_glib_none().0)

View file

@ -283,7 +283,7 @@ pub trait AggregatorImplExt: ObjectSubclass {
impl<T: AggregatorImpl> AggregatorImplExt for T { impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_flush(&self, aggregator: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_flush(&self, aggregator: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.flush .flush
@ -305,7 +305,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Option<gst::Buffer> { ) -> Option<gst::Buffer> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).clip { match (*parent_class).clip {
None => Some(buffer), None => Some(buffer),
@ -324,7 +324,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.finish_buffer .finish_buffer
@ -345,7 +345,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
buffer_list: gst::BufferList, buffer_list: gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.finish_buffer_list .finish_buffer_list
@ -365,7 +365,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
event: gst::Event, event: gst::Event,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
@ -387,7 +387,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
event: gst::Event, event: gst::Event,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event_pre_queue .sink_event_pre_queue
@ -408,7 +408,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
@ -430,7 +430,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query_pre_queue .sink_query_pre_queue
@ -445,7 +445,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_event(&self, aggregator: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, aggregator: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
@ -459,7 +459,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_src_query(&self, aggregator: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, aggregator: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
@ -478,7 +478,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
active: bool, active: bool,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
match (*parent_class).src_activate { match (*parent_class).src_activate {
None => Ok(()), None => Ok(()),
@ -501,7 +501,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
timeout: bool, timeout: bool,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.aggregate .aggregate
@ -516,7 +516,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_start(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.start .start
@ -540,7 +540,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, aggregator: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.stop .stop
@ -564,7 +564,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime { fn parent_next_time(&self, aggregator: &Self::Type) -> gst::ClockTime {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.get_next_time .get_next_time
@ -586,7 +586,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
caps: Option<&gst::Caps>, caps: Option<&gst::Caps>,
) -> Option<AggregatorPad> { ) -> Option<AggregatorPad> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.create_new_pad .create_new_pad
@ -606,7 +606,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<gst::Caps, gst::FlowError> { ) -> Result<gst::Caps, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
.update_src_caps .update_src_caps
@ -624,7 +624,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_fixate_src_caps(&self, aggregator: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate_src_caps(&self, aggregator: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -643,7 +643,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.negotiated_src_caps .negotiated_src_caps
@ -665,7 +665,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn parent_negotiate(&self, aggregator: &Self::Type) -> bool { fn parent_negotiate(&self, aggregator: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -687,7 +687,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
pad: &AggregatorPad, pad: &AggregatorPad,
) -> Option<gst::Sample> { ) -> Option<gst::Sample> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorClass;
(*parent_class) (*parent_class)
.peek_next_sample .peek_next_sample

View file

@ -49,7 +49,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
aggregator: &Aggregator, aggregator: &Aggregator,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class) (*parent_class)
.flush .flush
@ -74,7 +74,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAggregatorPadClass;
(*parent_class) (*parent_class)
.skip_buffer .skip_buffer

View file

@ -75,7 +75,7 @@ pub trait BaseParseImplExt: ObjectSubclass {
impl<T: BaseParseImpl> BaseParseImplExt for T { impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.start .start
@ -95,7 +95,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.stop .stop
@ -119,7 +119,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
(*parent_class) (*parent_class)
.set_sink_caps .set_sink_caps
@ -146,7 +146,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
frame: BaseParseFrame, frame: BaseParseFrame,
) -> Result<(gst::FlowSuccess, u32), gst::FlowError> { ) -> Result<(gst::FlowSuccess, u32), gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
let mut skipsize = 0; let mut skipsize = 0;
let res = (*parent_class).handle_frame.map(|f| { let res = (*parent_class).handle_frame.map(|f| {
@ -175,7 +175,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
dest_format: gst::Format, dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue> { ) -> Option<gst::GenericFormattedValue> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseParseClass;
let src_val = src_val.into(); let src_val = src_val.into();
let res = (*parent_class).convert.map(|f| { let res = (*parent_class).convert.map(|f| {

View file

@ -130,7 +130,7 @@ pub trait BaseSinkImplExt: ObjectSubclass {
impl<T: BaseSinkImpl> BaseSinkImplExt for T { impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.start .start
@ -150,7 +150,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.stop .stop
@ -174,7 +174,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.render .render
@ -195,7 +195,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.prepare .prepare
@ -216,7 +216,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
list: &gst::BufferList, list: &gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.render_list .render_list
@ -242,7 +242,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
list: &gst::BufferList, list: &gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.prepare_list .prepare_list
@ -264,7 +264,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.query .query
@ -280,7 +280,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.event .event
@ -296,7 +296,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option<gst::Caps> { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -317,7 +317,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
@ -337,7 +337,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
match (*parent_class).fixate { match (*parent_class).fixate {
@ -352,7 +352,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.unlock .unlock
@ -372,7 +372,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSinkClass;
(*parent_class) (*parent_class)
.unlock_stop .unlock_stop

View file

@ -172,7 +172,7 @@ pub trait BaseSrcImplExt: ObjectSubclass {
impl<T: BaseSrcImpl> BaseSrcImplExt for T { impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.start .start
@ -192,7 +192,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.stop .stop
@ -212,7 +212,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_is_seekable(&self, element: &Self::Type) -> bool { fn parent_is_seekable(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.is_seekable .is_seekable
@ -223,7 +223,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_size(&self, element: &Self::Type) -> Option<u64> { fn parent_size(&self, element: &Self::Type) -> Option<u64> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.get_size .get_size
@ -248,7 +248,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
buffer: &gst::BufferRef, buffer: &gst::BufferRef,
) -> (gst::ClockTime, gst::ClockTime) { ) -> (gst::ClockTime, gst::ClockTime) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.get_times .get_times
@ -278,7 +278,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
buffer: &mut gst::BufferRef, buffer: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.fill .fill
@ -302,7 +302,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
length: u32, length: u32,
) -> Result<gst::Buffer, gst::FlowError> { ) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.alloc .alloc
@ -333,7 +333,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
length: u32, length: u32,
) -> Result<CreateSuccess, gst::FlowError> { ) -> Result<CreateSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.create .create
@ -411,7 +411,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_do_seek(&self, element: &Self::Type, segment: &mut gst::Segment) -> bool { fn parent_do_seek(&self, element: &Self::Type, segment: &mut gst::Segment) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.do_seek .do_seek
@ -427,7 +427,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.query .query
@ -443,7 +443,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_event(&self, element: &Self::Type, event: &gst::Event) -> bool { fn parent_event(&self, element: &Self::Type, event: &gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.event .event
@ -459,7 +459,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option<gst::Caps> { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -476,7 +476,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -497,7 +497,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
@ -517,7 +517,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &Self::Type, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
match (*parent_class).fixate { match (*parent_class).fixate {
@ -532,7 +532,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.unlock .unlock
@ -552,7 +552,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class) (*parent_class)
.unlock_stop .unlock_stop

View file

@ -300,7 +300,7 @@ pub trait BaseTransformImplExt: ObjectSubclass {
impl<T: BaseTransformImpl> BaseTransformImplExt for T { impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.start .start
@ -324,7 +324,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.stop .stop
@ -354,7 +354,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
filter: Option<&gst::Caps>, filter: Option<&gst::Caps>,
) -> Option<gst::Caps> { ) -> Option<gst::Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_caps .transform_caps
@ -378,7 +378,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
othercaps: gst::Caps, othercaps: gst::Caps,
) -> gst::Caps { ) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
match (*parent_class).fixate_caps { match (*parent_class).fixate_caps {
Some(f) => from_glib_full(f( Some(f) => from_glib_full(f(
@ -399,7 +399,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
outcaps: &gst::Caps, outcaps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.set_caps .set_caps
@ -425,7 +425,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.accept_caps .accept_caps
@ -447,7 +447,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.query .query
@ -471,7 +471,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
othercaps: &gst::Caps, othercaps: &gst::Caps,
) -> Option<usize> { ) -> Option<usize> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_size .transform_size
@ -497,7 +497,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option<usize> { fn parent_unit_size(&self, element: &Self::Type, caps: &gst::Caps) -> Option<usize> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).get_unit_size.unwrap_or_else(|| { let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
if !element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if !element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
@ -528,7 +528,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.sink_event .sink_event
@ -544,7 +544,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.src_event .src_event
@ -564,7 +564,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
inbuf: &gst::BufferRef, inbuf: &gst::BufferRef,
) -> Result<PrepareOutputBufferSuccess, gst::FlowError> { ) -> Result<PrepareOutputBufferSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.prepare_output_buffer .prepare_output_buffer
@ -599,7 +599,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
outbuf: &mut gst::BufferRef, outbuf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform .transform
@ -630,7 +630,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
buf: &mut gst::BufferRef, buf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
@ -660,7 +660,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
buf: &gst::Buffer, buf: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if element.unsafe_cast_ref::<BaseTransform>().is_in_place() { if element.unsafe_cast_ref::<BaseTransform>().is_in_place() {
@ -693,7 +693,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
outbuf: &mut gst::BufferRef, outbuf: &mut gst::BufferRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).copy_metadata { if let Some(ref f) = (*parent_class).copy_metadata {
gst::result_from_gboolean!( gst::result_from_gboolean!(
@ -719,7 +719,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
inbuf: &'a gst::BufferRef, inbuf: &'a gst::BufferRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
(*parent_class) (*parent_class)
.transform_meta .transform_meta
@ -737,7 +737,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_before_transform(&self, element: &Self::Type, inbuf: &gst::BufferRef) { fn parent_before_transform(&self, element: &Self::Type, inbuf: &gst::BufferRef) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).before_transform { if let Some(ref f) = (*parent_class).before_transform {
f( f(
@ -755,7 +755,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
inbuf: gst::Buffer, inbuf: gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
.submit_input_buffer .submit_input_buffer
@ -775,7 +775,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
element: &Self::Type, element: &Self::Type,
) -> Result<GenerateOutputSuccess, gst::FlowError> { ) -> Result<GenerateOutputSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
.generate_output .generate_output

View file

@ -46,7 +46,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
buffer: &mut gst::BufferRef, buffer: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.fill .fill
@ -63,7 +63,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
fn parent_alloc(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> { fn parent_alloc(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.alloc .alloc
@ -86,7 +86,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
fn parent_create(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> { fn parent_create(&self, element: &Self::Type) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPushSrcClass;
(*parent_class) (*parent_class)
.create .create

View file

@ -50,7 +50,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
outcaps: &Caps, outcaps: &Caps,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass;
(*parent_class) (*parent_class)
@ -72,7 +72,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
fn parent_gl_start(&self, filter: &Self::Type) -> Result<(), LoggableError> { fn parent_gl_start(&self, filter: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass;
(*parent_class) (*parent_class)
@ -90,7 +90,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
fn parent_gl_stop(&self, filter: &Self::Type) { fn parent_gl_stop(&self, filter: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseFilterClass;
if let Some(f) = (*parent_class).gl_stop { if let Some(f) = (*parent_class).gl_stop {

View file

@ -40,7 +40,7 @@ pub trait GLBaseSrcImplExt: ObjectSubclass {
impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T { impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
fn parent_gl_start(&self, element: &Self::Type) -> Result<(), LoggableError> { fn parent_gl_start(&self, element: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass;
(*parent_class) (*parent_class)
@ -58,7 +58,7 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
fn parent_gl_stop(&self, element: &Self::Type) { fn parent_gl_stop(&self, element: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass;
if let Some(f) = (*parent_class).gl_stop { if let Some(f) = (*parent_class).gl_stop {
@ -73,7 +73,7 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
memory: &GLMemory, memory: &GLMemory,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass;
(*parent_class) (*parent_class)

View file

@ -108,7 +108,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
outcaps: &Caps, outcaps: &Caps,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass; let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass;
(*parent_class) (*parent_class)
@ -135,7 +135,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
output: &Buffer, output: &Buffer,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass; let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass;
(*parent_class) (*parent_class)
@ -162,7 +162,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
output: &GLMemory, output: &GLMemory,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass; let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass;
(*parent_class) (*parent_class)
@ -184,7 +184,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
fn parent_init_fbo(&self, filter: &Self::Type) -> Result<(), LoggableError> { fn parent_init_fbo(&self, filter: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass; let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass;
(*parent_class) (*parent_class)
@ -207,7 +207,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
filter_caps: Option<&Caps>, filter_caps: Option<&Caps>,
) -> Option<Caps> { ) -> Option<Caps> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass; let parent_class = data.as_ref().parent_class() as *mut GstGLFilterClass;
let f = (*parent_class) let f = (*parent_class)

View file

@ -347,7 +347,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
media: &crate::RTSPMedia, media: &crate::RTSPMedia,
) -> Option<gst_sdp::SDPMessage> { ) -> Option<gst_sdp::SDPMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.create_sdp .create_sdp
@ -368,7 +368,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class).configure_client_media.expect( let f = (*parent_class).configure_client_media.expect(
"No `configure_client_media` virtual method implementation in parent class", "No `configure_client_media` virtual method implementation in parent class",
@ -395,7 +395,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPResult { ) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.params_set .params_set
@ -414,7 +414,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPResult { ) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.params_get .params_get
@ -433,7 +433,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.make_path_from_uri .make_path_from_uri
@ -448,7 +448,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_closed(&self, client: &Self::Type) { fn parent_closed(&self, client: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).closed { if let Some(f) = (*parent_class).closed {
f(client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0); f(client.unsafe_cast_ref::<RTSPClient>().to_glib_none().0);
@ -458,7 +458,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_new_session(&self, client: &Self::Type, session: &crate::RTSPSession) { fn parent_new_session(&self, client: &Self::Type, session: &crate::RTSPSession) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).new_session { if let Some(f) = (*parent_class).new_session {
f( f(
@ -471,7 +471,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_options_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_options_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).options_request { if let Some(f) = (*parent_class).options_request {
f( f(
@ -484,7 +484,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_describe_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_describe_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).describe_request { if let Some(f) = (*parent_class).describe_request {
f( f(
@ -497,7 +497,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_setup_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_setup_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).setup_request { if let Some(f) = (*parent_class).setup_request {
f( f(
@ -510,7 +510,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_play_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_play_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).play_request { if let Some(f) = (*parent_class).play_request {
f( f(
@ -523,7 +523,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_pause_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_pause_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pause_request { if let Some(f) = (*parent_class).pause_request {
f( f(
@ -536,7 +536,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_teardown_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_teardown_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).teardown_request { if let Some(f) = (*parent_class).teardown_request {
f( f(
@ -549,7 +549,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_set_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_set_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).set_parameter_request { if let Some(f) = (*parent_class).set_parameter_request {
f( f(
@ -562,7 +562,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_parameter_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).get_parameter_request { if let Some(f) = (*parent_class).get_parameter_request {
f( f(
@ -575,7 +575,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_announce_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).announce_request { if let Some(f) = (*parent_class).announce_request {
f( f(
@ -588,7 +588,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_record_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_record_request(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).record_request { if let Some(f) = (*parent_class).record_request {
f( f(
@ -601,7 +601,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_handle_response(&self, client: &Self::Type, ctx: &crate::RTSPContext) { fn parent_handle_response(&self, client: &Self::Type, ctx: &crate::RTSPContext) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).handle_response { if let Some(f) = (*parent_class).handle_response {
f( f(
@ -623,7 +623,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
sdp: &gst_sdp::SDPMessageRef, sdp: &gst_sdp::SDPMessageRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
.handle_sdp .handle_sdp
@ -649,7 +649,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
arr: &[String], arr: &[String],
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).check_requirements { if let Some(f) = (*parent_class).check_requirements {
from_glib_full(f( from_glib_full(f(
@ -669,7 +669,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_options_request { if let Some(f) = (*parent_class).pre_options_request {
from_glib(f( from_glib(f(
@ -688,7 +688,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_describe_request { if let Some(f) = (*parent_class).pre_describe_request {
from_glib(f( from_glib(f(
@ -707,7 +707,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_setup_request { if let Some(f) = (*parent_class).pre_setup_request {
from_glib(f( from_glib(f(
@ -726,7 +726,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_play_request { if let Some(f) = (*parent_class).pre_play_request {
from_glib(f( from_glib(f(
@ -745,7 +745,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_pause_request { if let Some(f) = (*parent_class).pre_pause_request {
from_glib(f( from_glib(f(
@ -764,7 +764,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_teardown_request { if let Some(f) = (*parent_class).pre_teardown_request {
from_glib(f( from_glib(f(
@ -783,7 +783,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_set_parameter_request { if let Some(f) = (*parent_class).pre_set_parameter_request {
from_glib(f( from_glib(f(
@ -802,7 +802,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_get_parameter_request { if let Some(f) = (*parent_class).pre_get_parameter_request {
from_glib(f( from_glib(f(
@ -821,7 +821,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_announce_request { if let Some(f) = (*parent_class).pre_announce_request {
from_glib(f( from_glib(f(
@ -840,7 +840,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
ctx: &crate::RTSPContext, ctx: &crate::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_record_request { if let Some(f) = (*parent_class).pre_record_request {
from_glib(f( from_glib(f(

View file

@ -152,7 +152,7 @@ pub trait RTSPMediaImplExt: ObjectSubclass {
impl<T: RTSPMediaImpl> RTSPMediaImplExt for T { impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_handle_message(&self, media: &Self::Type, message: &gst::MessageRef) -> bool { fn parent_handle_message(&self, media: &Self::Type, message: &gst::MessageRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).handle_message { if let Some(f) = (*parent_class).handle_message {
from_glib(f( from_glib(f(
@ -171,7 +171,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
thread: &RTSPThread, thread: &RTSPThread,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepare { if let Some(f) = (*parent_class).prepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
@ -190,7 +190,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unprepare(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_unprepare(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepare { if let Some(f) = (*parent_class).unprepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
@ -206,7 +206,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_suspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_suspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).suspend { if let Some(f) = (*parent_class).suspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
@ -222,7 +222,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unsuspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_unsuspend(&self, media: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unsuspend { if let Some(f) = (*parent_class).unsuspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
@ -242,7 +242,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
unsafe { unsafe {
use std::mem; use std::mem;
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_position { if let Some(f) = (*parent_class).query_position {
let mut position = mem::MaybeUninit::uninit(); let mut position = mem::MaybeUninit::uninit();
@ -265,7 +265,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
unsafe { unsafe {
use std::mem; use std::mem;
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_stop { if let Some(f) = (*parent_class).query_stop {
let mut stop = mem::MaybeUninit::uninit(); let mut stop = mem::MaybeUninit::uninit();
@ -286,7 +286,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_create_rtpbin(&self, media: &Self::Type) -> Option<gst::Element> { fn parent_create_rtpbin(&self, media: &Self::Type) -> Option<gst::Element> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.create_rtpbin .create_rtpbin
@ -302,7 +302,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
rtpbin: &gst::Element, rtpbin: &gst::Element,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).setup_rtpbin { if let Some(f) = (*parent_class).setup_rtpbin {
let ptr = rtpbin.to_glib_none().0; let ptr = rtpbin.to_glib_none().0;
@ -337,7 +337,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
info: &SDPInfo, info: &SDPInfo,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.setup_sdp .setup_sdp
@ -357,7 +357,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_new_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) { fn parent_new_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_stream { if let Some(f) = (*parent_class).new_stream {
f( f(
@ -370,7 +370,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_removed_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) { fn parent_removed_stream(&self, media: &Self::Type, stream: &crate::RTSPStream) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).removed_stream { if let Some(f) = (*parent_class).removed_stream {
f( f(
@ -383,7 +383,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_prepared(&self, media: &Self::Type) { fn parent_prepared(&self, media: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepared { if let Some(f) = (*parent_class).prepared {
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0); f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
@ -393,7 +393,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_unprepared(&self, media: &Self::Type) { fn parent_unprepared(&self, media: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepared { if let Some(f) = (*parent_class).unprepared {
f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0); f(media.unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
@ -403,7 +403,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_target_state(&self, media: &Self::Type, state: gst::State) { fn parent_target_state(&self, media: &Self::Type, state: gst::State) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).target_state { if let Some(f) = (*parent_class).target_state {
f( f(
@ -416,7 +416,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_new_state(&self, media: &Self::Type, state: gst::State) { fn parent_new_state(&self, media: &Self::Type, state: gst::State) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_state { if let Some(f) = (*parent_class).new_state {
f( f(
@ -433,7 +433,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
sdp: &gst_sdp::SDPMessageRef, sdp: &gst_sdp::SDPMessageRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
.handle_sdp .handle_sdp

View file

@ -84,7 +84,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.gen_key .gen_key
@ -107,7 +107,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<gst::Element> { ) -> Option<gst::Element> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.create_element .create_element
@ -130,7 +130,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<crate::RTSPMedia> { ) -> Option<crate::RTSPMedia> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.construct .construct
@ -153,7 +153,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
media: &crate::RTSPMedia, media: &crate::RTSPMedia,
) -> Option<gst::Pipeline> { ) -> Option<gst::Pipeline> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
.create_pipeline .create_pipeline
@ -178,7 +178,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).configure { if let Some(f) = (*parent_class).configure {
f( f(
@ -194,7 +194,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_constructed(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_media_constructed(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_constructed { if let Some(f) = (*parent_class).media_constructed {
f( f(
@ -210,7 +210,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) { fn parent_media_configure(&self, factory: &Self::Type, media: &crate::RTSPMedia) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_configure { if let Some(f) = (*parent_class).media_configure {
f( f(

View file

@ -25,7 +25,7 @@ pub trait RTSPServerImplExt: ObjectSubclass {
impl<T: RTSPServerImpl> RTSPServerImplExt for T { impl<T: RTSPServerImpl> RTSPServerImplExt for T {
fn parent_create_client(&self, server: &Self::Type) -> Option<crate::RTSPClient> { fn parent_create_client(&self, server: &Self::Type) -> Option<crate::RTSPClient> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass;
let f = (*parent_class) let f = (*parent_class)
.create_client .create_client
@ -36,7 +36,7 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
fn parent_client_connected(&self, server: &Self::Type, client: &crate::RTSPClient) { fn parent_client_connected(&self, server: &Self::Type, client: &crate::RTSPClient) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass;
if let Some(f) = (*parent_class).client_connected { if let Some(f) = (*parent_class).client_connected {
f( f(

View file

@ -168,7 +168,7 @@ pub trait VideoDecoderImplExt: ObjectSubclass {
impl<T: VideoDecoderImpl> VideoDecoderImplExt for T { impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.open .open
@ -192,7 +192,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.close .close
@ -216,7 +216,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.start .start
@ -240,7 +240,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.stop .stop
@ -264,7 +264,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.finish .finish
@ -281,7 +281,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_drain(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_drain(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.drain .drain
@ -302,7 +302,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
state: &VideoCodecState<'static, Readable>, state: &VideoCodecState<'static, Readable>,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
@ -328,7 +328,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
at_eos: bool, at_eos: bool,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.parse .parse
@ -351,7 +351,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
frame: VideoCodecFrame, frame: VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
@ -368,7 +368,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) -> bool { fn parent_flush(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.flush .flush
@ -384,7 +384,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -401,7 +401,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
@ -421,7 +421,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
@ -435,7 +435,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
@ -449,7 +449,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
@ -463,7 +463,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
@ -481,7 +481,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
@ -508,7 +508,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoDecoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation

View file

@ -144,7 +144,7 @@ pub trait VideoEncoderImplExt: ObjectSubclass {
impl<T: VideoEncoderImpl> VideoEncoderImplExt for T { impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.open .open
@ -168,7 +168,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.close .close
@ -192,7 +192,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.start .start
@ -216,7 +216,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &Self::Type) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.stop .stop
@ -240,7 +240,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &Self::Type) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.finish .finish
@ -261,7 +261,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
state: &VideoCodecState<'static, Readable>, state: &VideoCodecState<'static, Readable>,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.set_format .set_format
@ -285,7 +285,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
frame: VideoCodecFrame, frame: VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.handle_frame .handle_frame
@ -302,7 +302,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_flush(&self, element: &Self::Type) -> bool { fn parent_flush(&self, element: &Self::Type) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.flush .flush
@ -318,7 +318,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &Self::Type) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.negotiate .negotiate
@ -335,7 +335,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_caps(&self, element: &Self::Type, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.getcaps .getcaps
@ -355,7 +355,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_event .sink_event
@ -369,7 +369,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.sink_query .sink_query
@ -383,7 +383,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool { fn parent_src_event(&self, element: &Self::Type, event: gst::Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_event .src_event
@ -397,7 +397,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
.src_query .src_query
@ -415,7 +415,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.propose_allocation .propose_allocation
@ -442,7 +442,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoEncoderClass;
(*parent_class) (*parent_class)
.decide_allocation .decide_allocation

View file

@ -32,7 +32,7 @@ impl<T: VideoSinkImpl> VideoSinkImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoSinkClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoSinkClass;
(*parent_class) (*parent_class)
.show_frame .show_frame

View file

@ -40,7 +40,7 @@ pub trait BinImplExt: ObjectSubclass {
impl<T: BinImpl> BinImplExt for T { impl<T: BinImpl> BinImplExt for T {
fn parent_add_element(&self, bin: &Self::Type, element: &Element) -> Result<(), LoggableError> { fn parent_add_element(&self, bin: &Self::Type, element: &Element) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass;
let f = (*parent_class).add_element.ok_or_else(|| { let f = (*parent_class).add_element.ok_or_else(|| {
loggable_error!( loggable_error!(
@ -65,7 +65,7 @@ impl<T: BinImpl> BinImplExt for T {
element: &Element, element: &Element,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass;
let f = (*parent_class).remove_element.ok_or_else(|| { let f = (*parent_class).remove_element.ok_or_else(|| {
loggable_error!( loggable_error!(
@ -86,7 +86,7 @@ impl<T: BinImpl> BinImplExt for T {
fn parent_handle_message(&self, bin: &Self::Type, message: Message) { fn parent_handle_message(&self, bin: &Self::Type, message: Message) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass;
if let Some(ref f) = (*parent_class).handle_message { if let Some(ref f) = (*parent_class).handle_message {
f( f(

View file

@ -87,7 +87,7 @@ impl<T: ClockImpl> ClockImplExt for T {
new_resolution: ClockTime, new_resolution: ClockTime,
) -> ClockTime { ) -> ClockTime {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
if let Some(func) = (*parent_class).change_resolution { if let Some(func) = (*parent_class).change_resolution {
@ -104,7 +104,7 @@ impl<T: ClockImpl> ClockImplExt for T {
fn parent_resolution(&self, clock: &Self::Type) -> ClockTime { fn parent_resolution(&self, clock: &Self::Type) -> ClockTime {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
from_glib( from_glib(
@ -118,7 +118,7 @@ impl<T: ClockImpl> ClockImplExt for T {
fn parent_internal_time(&self, clock: &Self::Type) -> ClockTime { fn parent_internal_time(&self, clock: &Self::Type) -> ClockTime {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
from_glib( from_glib(
@ -136,7 +136,7 @@ impl<T: ClockImpl> ClockImplExt for T {
id: &ClockId, id: &ClockId,
) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff) { ) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
let mut jitter = 0; let mut jitter = 0;
@ -165,7 +165,7 @@ impl<T: ClockImpl> ClockImplExt for T {
id: &ClockId, id: &ClockId,
) -> Result<ClockSuccess, ClockError> { ) -> Result<ClockSuccess, ClockError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
ClockReturn::from_glib( ClockReturn::from_glib(
(*parent_class) (*parent_class)
@ -184,7 +184,7 @@ impl<T: ClockImpl> ClockImplExt for T {
fn parent_unschedule(&self, clock: &Self::Type, id: &ClockId) { fn parent_unschedule(&self, clock: &Self::Type, id: &ClockId) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
if let Some(func) = (*parent_class).unschedule { if let Some(func) = (*parent_class).unschedule {
func( func(

View file

@ -49,7 +49,7 @@ impl<T: DeviceImpl> DeviceImplExt for T {
name: Option<&str>, name: Option<&str>,
) -> Result<Element, LoggableError> { ) -> Result<Element, LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass;
if let Some(f) = (*parent_class).create_element { if let Some(f) = (*parent_class).create_element {
let ptr = f( let ptr = f(
@ -79,7 +79,7 @@ impl<T: DeviceImpl> DeviceImplExt for T {
element: &Element, element: &Element,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass;
let f = (*parent_class).reconfigure_element.ok_or_else(|| { let f = (*parent_class).reconfigure_element.ok_or_else(|| {
loggable_error!( loggable_error!(

View file

@ -46,7 +46,7 @@ pub trait DeviceProviderImplExt: ObjectSubclass {
impl<T: DeviceProviderImpl> DeviceProviderImplExt for T { impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
fn parent_probe(&self, device_provider: &Self::Type) -> Vec<Device> { fn parent_probe(&self, device_provider: &Self::Type) -> Vec<Device> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).probe { if let Some(f) = (*parent_class).probe {
FromGlibPtrContainer::from_glib_full(f(device_provider FromGlibPtrContainer::from_glib_full(f(device_provider
@ -61,7 +61,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
fn parent_start(&self, device_provider: &Self::Type) -> Result<(), LoggableError> { fn parent_start(&self, device_provider: &Self::Type) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
let f = (*parent_class).start.ok_or_else(|| { let f = (*parent_class).start.ok_or_else(|| {
loggable_error!(crate::CAT_RUST, "Parent function `start` is not defined") loggable_error!(crate::CAT_RUST, "Parent function `start` is not defined")
@ -79,7 +79,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
fn parent_stop(&self, device_provider: &Self::Type) { fn parent_stop(&self, device_provider: &Self::Type) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).stop { if let Some(f) = (*parent_class).stop {
f(device_provider f(device_provider

View file

@ -164,7 +164,7 @@ impl<T: ElementImpl> ElementImplExt for T {
transition: StateChange, transition: StateChange,
) -> Result<StateChangeSuccess, StateChangeError> { ) -> Result<StateChangeSuccess, StateChangeError> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
let f = (*parent_class) let f = (*parent_class)
@ -186,7 +186,7 @@ impl<T: ElementImpl> ElementImplExt for T {
caps: Option<&crate::Caps>, caps: Option<&crate::Caps>,
) -> Option<crate::Pad> { ) -> Option<crate::Pad> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -205,7 +205,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_release_pad(&self, element: &Self::Type, pad: &crate::Pad) { fn parent_release_pad(&self, element: &Self::Type, pad: &crate::Pad) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -222,7 +222,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_send_event(&self, element: &Self::Type, event: Event) -> bool { fn parent_send_event(&self, element: &Self::Type, event: Event) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -239,7 +239,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_query(&self, element: &Self::Type, query: &mut QueryRef) -> bool { fn parent_query(&self, element: &Self::Type, query: &mut QueryRef) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -256,7 +256,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_set_context(&self, element: &Self::Type, context: &crate::Context) { fn parent_set_context(&self, element: &Self::Type, context: &crate::Context) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -273,7 +273,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_set_clock(&self, element: &Self::Type, clock: Option<&crate::Clock>) -> bool { fn parent_set_clock(&self, element: &Self::Type, clock: Option<&crate::Clock>) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -290,7 +290,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_provide_clock(&self, element: &Self::Type) -> Option<crate::Clock> { fn parent_provide_clock(&self, element: &Self::Type) -> Option<crate::Clock> {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
(*parent_class) (*parent_class)
@ -302,7 +302,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn parent_post_message(&self, element: &Self::Type, msg: crate::Message) -> bool { fn parent_post_message(&self, element: &Self::Type, msg: crate::Message) -> bool {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstElementClass;
if let Some(f) = (*parent_class).post_message { if let Some(f) = (*parent_class).post_message {

View file

@ -25,7 +25,7 @@ pub trait PadImplExt: ObjectSubclass {
impl<T: PadImpl> PadImplExt for T { impl<T: PadImpl> PadImplExt for T {
fn parent_linked(&self, pad: &Self::Type, peer: &Pad) { fn parent_linked(&self, pad: &Self::Type, peer: &Pad) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPadClass;
(*parent_class) (*parent_class)
@ -42,7 +42,7 @@ impl<T: PadImpl> PadImplExt for T {
fn parent_unlinked(&self, pad: &Self::Type, peer: &Pad) { fn parent_unlinked(&self, pad: &Self::Type, peer: &Pad) {
unsafe { unsafe {
let data = T::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstPadClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstPadClass;
(*parent_class) (*parent_class)