mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
Use the correct pad type for the proxy/ghost pad default pad functions
This commit is contained in:
parent
62058ab1c3
commit
ffb5869dd1
4 changed files with 68 additions and 27 deletions
10
Gir_Gst.toml
10
Gir_Gst.toml
|
@ -550,6 +550,16 @@ status = "generate"
|
|||
name = "construct"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "activate_mode_default"
|
||||
# wrong instance type
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
name = "internal_activate_mode_default"
|
||||
# wrong instance type
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.ProxyPad"
|
||||
status = "generate"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
use Object;
|
||||
use Pad;
|
||||
use PadDirection;
|
||||
use PadMode;
|
||||
use PadTemplate;
|
||||
use ProxyPad;
|
||||
use ffi;
|
||||
|
@ -43,24 +42,6 @@ impl GhostPad {
|
|||
Pad::from_glib_none(ffi::gst_ghost_pad_new_no_target_from_template(name.0, templ.to_glib_none().0)).downcast_unchecked()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn activate_mode_default<'a, P: IsA<Pad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(pad: &P, parent: R, mode: PadMode, active: bool) -> bool {
|
||||
skip_assert_initialized!();
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_ghost_pad_activate_mode_default(pad.to_glib_none().0, parent.0, mode.to_glib(), active.to_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn internal_activate_mode_default<'a, P: IsA<Pad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(pad: &P, parent: R, mode: PadMode, active: bool) -> bool {
|
||||
skip_assert_initialized!();
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_ghost_pad_internal_activate_mode_default(pad.to_glib_none().0, parent.0, mode.to_glib(), active.to_glib()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for GhostPad {}
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
use Pad;
|
||||
use PadTemplate;
|
||||
use Object;
|
||||
use PadMode;
|
||||
use GhostPad;
|
||||
use ffi;
|
||||
use glib::object::Downcast;
|
||||
|
@ -41,4 +43,52 @@ impl GhostPad {
|
|||
)).map(|o| Downcast::downcast_unchecked(o))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn activate_mode_default<
|
||||
'a,
|
||||
P: IsA<GhostPad>,
|
||||
Q: IsA<Object> + 'a,
|
||||
R: Into<Option<&'a Q>>,
|
||||
>(
|
||||
pad: &P,
|
||||
parent: R,
|
||||
mode: PadMode,
|
||||
active: bool,
|
||||
) -> bool {
|
||||
skip_assert_initialized!();
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_ghost_pad_activate_mode_default(
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.0,
|
||||
mode.to_glib(),
|
||||
active.to_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn internal_activate_mode_default<
|
||||
'a,
|
||||
P: IsA<GhostPad>,
|
||||
Q: IsA<Object> + 'a,
|
||||
R: Into<Option<&'a Q>>,
|
||||
>(
|
||||
pad: &P,
|
||||
parent: R,
|
||||
mode: PadMode,
|
||||
active: bool,
|
||||
) -> bool {
|
||||
skip_assert_initialized!();
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_ghost_pad_internal_activate_mode_default(
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.0,
|
||||
mode.to_glib(),
|
||||
active.to_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ use glib::translate::{from_glib, from_glib_full, ToGlibPtr};
|
|||
use ffi;
|
||||
|
||||
impl ProxyPad {
|
||||
pub fn chain_default<'a, P: IsA<Pad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(
|
||||
pub fn chain_default<'a, P: IsA<ProxyPad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(
|
||||
pad: &P,
|
||||
parent: R,
|
||||
buffer: Buffer,
|
||||
|
@ -30,14 +30,14 @@ impl ProxyPad {
|
|||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_proxy_pad_chain_default(
|
||||
pad.to_glib_none().0,
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.0,
|
||||
buffer.into_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn chain_list_default<'a, P: IsA<Pad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(
|
||||
pub fn chain_list_default<'a, P: IsA<ProxyPad>, Q: IsA<Object> + 'a, R: Into<Option<&'a Q>>>(
|
||||
pad: &P,
|
||||
parent: R,
|
||||
list: BufferList,
|
||||
|
@ -47,14 +47,14 @@ impl ProxyPad {
|
|||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib(ffi::gst_proxy_pad_chain_list_default(
|
||||
pad.to_glib_none().0,
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.0,
|
||||
list.into_ptr(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getrange_default<P: IsA<Pad>, Q: IsA<Object>>(
|
||||
pub fn getrange_default<P: IsA<ProxyPad>, Q: IsA<Object>>(
|
||||
pad: &P,
|
||||
parent: &Q,
|
||||
offset: u64,
|
||||
|
@ -64,7 +64,7 @@ impl ProxyPad {
|
|||
unsafe {
|
||||
let mut buffer = ptr::null_mut();
|
||||
let ret = from_glib(ffi::gst_proxy_pad_getrange_default(
|
||||
pad.to_glib_none().0,
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.to_glib_none().0,
|
||||
offset,
|
||||
size,
|
||||
|
@ -80,7 +80,7 @@ impl ProxyPad {
|
|||
|
||||
pub fn iterate_internal_links_default<
|
||||
'a,
|
||||
P: IsA<Pad>,
|
||||
P: IsA<ProxyPad>,
|
||||
Q: IsA<Object> + 'a,
|
||||
R: Into<Option<&'a Q>>,
|
||||
>(
|
||||
|
@ -92,7 +92,7 @@ impl ProxyPad {
|
|||
let parent = parent.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_proxy_pad_iterate_internal_links_default(
|
||||
pad.to_glib_none().0,
|
||||
pad.to_glib_none().0 as *mut ffi::GstPad,
|
||||
parent.0,
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue