manual code: fix-getters-def doc aliases

This commit is contained in:
François Laignel 2021-05-02 11:41:18 +02:00
parent 01b6d342a4
commit 49583597ed
94 changed files with 511 additions and 0 deletions

View file

@ -45,6 +45,7 @@ mod custom_meta {
}
// Retrieve the stored label.
#[doc(alias = "get_label")]
pub fn label(&self) -> &str {
self.0.label.as_str()
}

View file

@ -44,6 +44,7 @@ fn make_element(
}
}
#[doc(alias = "get_static_pad")]
fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.static_pad(pad_name) {
Some(pad) => Ok(pad),
@ -54,6 +55,7 @@ fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad
}
}
#[doc(alias = "get_request_pad")]
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.request_pad_simple(pad_name) {
Some(pad) => Ok(pad),

View file

@ -40,6 +40,7 @@ fn make_element(
}
}
#[doc(alias = "get_static_pad")]
fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.static_pad(pad_name) {
Some(pad) => Ok(pad),
@ -50,6 +51,7 @@ fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad
}
}
#[doc(alias = "get_request_pad")]
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.request_pad_simple(pad_name) {
Some(pad) => Ok(pad),

View file

@ -20,6 +20,7 @@ mod runloop {
}
}
#[doc(alias = "get_main")]
pub fn main() -> CFRunLoop {
unsafe {
let r = CFRunLoopGetMain();

View file

@ -286,6 +286,7 @@ impl AppSrc {
}
}
#[doc(alias = "get_latency")]
pub fn latency(&self) -> (gst::ClockTime, gst::ClockTime) {
unsafe {
let mut min = mem::MaybeUninit::uninit();

View file

@ -118,6 +118,7 @@ impl AudioChannelPosition {
}
}
#[doc(alias = "get_fallback_mask")]
pub fn fallback_mask(channels: u32) -> u64 {
assert_initialized_main_thread!();
@ -249,6 +250,7 @@ pub fn reorder_channels(
}
}
#[doc(alias = "get_channel_reorder_map")]
pub fn channel_reorder_map(
from: &[AudioChannelPosition],
to: &[AudioChannelPosition],

View file

@ -78,6 +78,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.dither-method", &v);
}
#[doc(alias = "get_dither_method")]
pub fn dither_method(&self) -> crate::AudioDitherMethod {
self.0
.get_optional("GstAudioConverter.dither-method")
@ -89,6 +90,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.noise-shaping-method", &v);
}
#[doc(alias = "get_noise_shaping_method")]
pub fn noise_shaping_method(&self) -> crate::AudioNoiseShapingMethod {
self.0
.get_optional("GstAudioConverter.noise-shaping-method")
@ -100,6 +102,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.quantization", &v);
}
#[doc(alias = "get_quantization")]
pub fn quantization(&self) -> u32 {
self.0
.get_optional("GstAudioConverter.quantization")
@ -115,6 +118,7 @@ impl AudioConverterConfig {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_resampler_method")]
pub fn resampler_method(&self) -> crate::AudioResamplerMethod {
self.0
.get_optional("GstAudioConverter.resampler-method")
@ -141,6 +145,7 @@ impl AudioConverterConfig {
self.0.set("GstAudioConverter.mix-matrix", &array);
}
#[doc(alias = "get_mix_matrix")]
pub fn mix_matrix(&self) -> Vec<Vec<f32>> {
self.0
.get_optional::<gst::Array>("GstAudioConverter.mix-matrix")

View file

@ -43,6 +43,7 @@ pub trait AudioDecoderExtManual: 'static {
fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>;
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[allow(clippy::too_many_arguments)]

View file

@ -17,8 +17,10 @@ pub trait AudioEncoderExtManual: 'static {
fn set_output_format(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>;
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[doc(alias = "get_latency")]
fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
}

View file

@ -42,10 +42,12 @@ impl AudioClippingMeta {
}
}
#[doc(alias = "get_start")]
pub fn start(&self) -> gst::GenericFormattedValue {
unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.start as i64) }
}
#[doc(alias = "get_end")]
pub fn end(&self) -> gst::GenericFormattedValue {
unsafe { gst::GenericFormattedValue::new(from_glib(self.0.format), self.0.end as i64) }
}
@ -169,14 +171,17 @@ impl AudioMeta {
}
}
#[doc(alias = "get_info")]
pub fn info(&self) -> crate::AudioInfo {
unsafe { from_glib_none(&self.0.info as *const _ as *mut ffi::GstAudioInfo) }
}
#[doc(alias = "get_samples")]
pub fn samples(&self) -> usize {
self.0.samples
}
#[doc(alias = "get_offsets")]
pub fn offsets(&self) -> &[usize] {
if self.0.offsets.is_null() || self.0.info.channels < 1 {
return &[];

View file

@ -13,6 +13,7 @@ use std::fmt;
pub struct AudioRingBufferSpec(pub(crate) GstAudioRingBufferSpec);
impl AudioRingBufferSpec {
#[doc(alias = "get_type")]
pub fn type_(&self) -> AudioRingBufferFormatType {
unsafe { AudioRingBufferFormatType::from_glib(self.0.type_) }
}
@ -21,14 +22,17 @@ impl AudioRingBufferSpec {
self.0.type_ = value.into_glib();
}
#[doc(alias = "get_caps")]
pub fn caps(&self) -> Caps {
unsafe { Caps::from_glib_none(self.0.caps) }
}
#[doc(alias = "get_audio_info")]
pub fn audio_info(&self) -> AudioInfo {
unsafe { AudioInfo::from_glib_none(mut_override(&self.0.info)) }
}
#[doc(alias = "get_latency_time")]
pub fn latency_time(&self) -> u64 {
self.0.latency_time
}
@ -37,6 +41,7 @@ impl AudioRingBufferSpec {
self.0.latency_time = value;
}
#[doc(alias = "get_buffer_time")]
pub fn buffer_time(&self) -> u64 {
self.0.buffer_time
}
@ -45,6 +50,7 @@ impl AudioRingBufferSpec {
self.0.buffer_time = value;
}
#[doc(alias = "get_segsize")]
pub fn segsize(&self) -> i32 {
self.0.segsize
}
@ -53,6 +59,7 @@ impl AudioRingBufferSpec {
self.0.segsize = value;
}
#[doc(alias = "get_segtotal")]
pub fn segtotal(&self) -> i32 {
self.0.segtotal
}
@ -61,6 +68,7 @@ impl AudioRingBufferSpec {
self.0.segtotal = value;
}
#[doc(alias = "get_seglatency")]
pub fn seglatency(&self) -> i32 {
self.0.seglatency
}

View file

@ -60,6 +60,7 @@ impl Adapter {
}
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -70,6 +71,7 @@ impl Adapter {
}
}
#[doc(alias = "get_buffer_fast")]
pub fn buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -83,6 +85,7 @@ impl Adapter {
}
}
#[doc(alias = "get_buffer_list")]
pub fn buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -96,6 +99,7 @@ impl Adapter {
}
}
#[doc(alias = "get_list")]
pub fn list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -292,18 +296,22 @@ impl UniqueAdapter {
self.0.flush(flush);
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
self.0.buffer(nbytes)
}
#[doc(alias = "get_buffer_fast")]
pub fn buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
self.0.buffer_fast(nbytes)
}
#[doc(alias = "get_buffer_list")]
pub fn buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
self.0.buffer_list(nbytes)
}
#[doc(alias = "get_list")]
pub fn list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
self.0.list(nbytes)
}

View file

@ -19,6 +19,7 @@ use std::mem::transmute;
use std::ptr;
pub trait AggregatorExtManual: 'static {
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_buffer(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError>;
@ -32,6 +33,7 @@ pub trait AggregatorExtManual: 'static {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_property_min_upstream_latency")]
fn min_upstream_latency(&self) -> gst::ClockTime;
#[cfg(any(feature = "v1_16", feature = "dox"))]

View file

@ -5,6 +5,7 @@ use glib::prelude::*;
use glib::translate::*;
pub trait AggregatorPadExtManual: 'static {
#[doc(alias = "get_segment")]
fn segment(&self) -> gst::Segment;
}

View file

@ -9,7 +9,9 @@ use std::convert::TryFrom;
use std::mem;
pub trait BaseParseExtManual: 'static {
#[doc(alias = "get_sink_pad")]
fn sink_pad(&self) -> gst::Pad;
#[doc(alias = "get_src_pad")]
fn src_pad(&self) -> gst::Pad;
fn set_duration<V: Into<gst::GenericFormattedValue>>(&self, duration: V, interval: u32);

View file

@ -84,6 +84,7 @@ impl<'a> BaseParseFrame<'a> {
Self(ptr::NonNull::new_unchecked(frame), PhantomData)
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> Option<&gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).buffer;
@ -95,6 +96,7 @@ impl<'a> BaseParseFrame<'a> {
}
}
#[doc(alias = "get_buffer_mut")]
pub fn buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).buffer;
@ -111,6 +113,7 @@ impl<'a> BaseParseFrame<'a> {
}
}
#[doc(alias = "get_output_buffer")]
pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).out_buffer;
@ -122,6 +125,7 @@ impl<'a> BaseParseFrame<'a> {
}
}
#[doc(alias = "get_output_buffer_mut")]
pub fn output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).out_buffer;
@ -156,6 +160,7 @@ impl<'a> BaseParseFrame<'a> {
}
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> BaseParseFrameFlags {
let flags = unsafe { (*self.to_glib_none().0).flags };
BaseParseFrameFlags::from_bits_truncate(flags)
@ -169,10 +174,12 @@ impl<'a> BaseParseFrame<'a> {
unsafe { (*self.to_glib_none().0).flags &= !flags.bits() }
}
#[doc(alias = "get_offset")]
pub fn offset(&self) -> u64 {
unsafe { (*self.to_glib_none().0).offset }
}
#[doc(alias = "get_overhead")]
pub fn overhead(&self) -> Overhead {
unsafe { from_glib((*self.to_glib_none().0).overhead) }
}

View file

@ -6,6 +6,7 @@ use glib::translate::*;
use std::mem;
pub trait BaseSinkExtManual: 'static {
#[doc(alias = "get_segment")]
fn segment(&self) -> gst::Segment;
fn wait(

View file

@ -8,8 +8,10 @@ use std::ptr;
use crate::BaseSrc;
pub trait BaseSrcExtManual: 'static {
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[doc(alias = "get_segment")]
fn segment(&self) -> gst::Segment;
fn start_complete(&self, ret: Result<gst::FlowSuccess, gst::FlowError>);

View file

@ -7,8 +7,10 @@ use std::mem;
use std::ptr;
pub trait BaseTransformExtManual: 'static {
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[doc(alias = "get_segment")]
fn segment(&self) -> gst::Segment;
}

View file

@ -34,6 +34,7 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl {
self.parent_size(element)
}
#[doc(alias = "get_times")]
fn times(
&self,
element: &Self::Type,

View file

@ -291,6 +291,7 @@ pub trait BaseTransformImplExt: ObjectSubclass {
Self: ObjectSubclass,
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>;
#[doc(alias = "get_queued_buffer")]
fn queued_buffer(&self) -> Option<gst::Buffer>
where
Self: ObjectSubclass,

View file

@ -220,10 +220,12 @@ impl Harness {
// unsafe { TODO: call ffi::gst_harness_get_allocator() }
//}
#[doc(alias = "get_last_pushed_timestamp")]
pub fn last_pushed_timestamp(&self) -> gst::ClockTime {
unsafe { from_glib(ffi::gst_harness_get_last_pushed_timestamp(self.0.as_ptr())) }
}
#[doc(alias = "get_testclock")]
pub fn testclock(&self) -> Option<TestClock> {
unsafe { from_glib_full(ffi::gst_harness_get_testclock(self.0.as_ptr())) }
}
@ -627,6 +629,7 @@ impl Harness {
// unsafe { TODO: call ffi::gst_harness_stress_thread_stop() }
//}
#[doc(alias = "get_element")]
pub fn element(&self) -> Option<gst::Element> {
unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
@ -645,6 +648,7 @@ impl Harness {
}
}
#[doc(alias = "get_sinkpad")]
pub fn sinkpad(&self) -> Option<gst::Pad> {
unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
@ -663,6 +667,7 @@ impl Harness {
}
}
#[doc(alias = "get_srcpad")]
pub fn srcpad(&self) -> Option<gst::Pad> {
unsafe {
// Work around https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/31
@ -681,6 +686,7 @@ impl Harness {
}
}
#[doc(alias = "get_sink_harness")]
pub fn sink_harness(&self) -> Option<Ref> {
unsafe {
let sink_harness = (*self.0.as_ptr()).sink_harness;
@ -695,6 +701,7 @@ impl Harness {
}
}
#[doc(alias = "get_src_harness")]
pub fn src_harness(&self) -> Option<Ref> {
unsafe {
let src_harness = (*self.0.as_ptr()).src_harness;
@ -709,6 +716,7 @@ impl Harness {
}
}
#[doc(alias = "get_mut_sink_harness")]
pub fn sink_harness_mut(&mut self) -> Option<RefMut> {
unsafe {
let sink_harness = (*self.0.as_ptr()).sink_harness;
@ -723,6 +731,7 @@ impl Harness {
}
}
#[doc(alias = "get_mut_src_harness")]
pub fn src_harness_mut(&mut self) -> Option<RefMut> {
unsafe {
let src_harness = (*self.0.as_ptr()).src_harness;

View file

@ -6,6 +6,7 @@ use glib::translate::*;
use std::ptr;
pub trait TimelineElementExtManual: 'static {
#[doc(alias = "get_child_property")]
fn child_property(&self, name: &str) -> Option<glib::Value>;
fn set_child_property(
&self,

View file

@ -22,6 +22,7 @@ impl GLDisplayEGL {
.ok_or_else(|| glib::bool_error!("Failed to create new EGL GL display"))
}
#[doc(alias = "get_from_native")]
pub unsafe fn from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer {
ffi::gst_gl_display_egl_get_from_native(display_type.into_glib(), display)
}

View file

@ -7,6 +7,7 @@ use gst::ContextRef;
use std::ptr;
pub trait ContextGLExt {
#[doc(alias = "get_gl_display")]
fn gl_display(&self) -> Option<GLDisplay>;
fn set_gl_display<T: IsA<GLDisplay>>(&self, display: &T);
}

View file

@ -23,11 +23,13 @@ impl GLContext {
))
}
#[doc(alias = "get_current_gl_context")]
pub fn current_gl_context(context_type: GLPlatform) -> uintptr_t {
skip_assert_initialized!();
unsafe { ffi::gst_gl_context_get_current_gl_context(context_type.into_glib()) as uintptr_t }
}
#[doc(alias = "get_proc_address_with_platform")]
pub fn proc_address_with_platform(
context_type: GLPlatform,
gl_api: GLAPI,
@ -45,8 +47,10 @@ impl GLContext {
}
pub trait GLContextExtManual: 'static {
#[doc(alias = "get_gl_context")]
fn gl_context(&self) -> uintptr_t;
#[doc(alias = "get_proc_address")]
fn proc_address(&self, name: &str) -> uintptr_t;
}

View file

@ -28,6 +28,7 @@ impl GLSyncMeta {
}
}
#[doc(alias = "get_context")]
pub fn context(&self) -> GLContext {
unsafe { from_glib_none(self.0.context) }
}

View file

@ -17,6 +17,7 @@ pub trait VideoFrameGLExt {
info: &'b gst_video::VideoInfo,
) -> Result<gst_video::VideoFrameRef<&'a gst::BufferRef>, glib::error::BoolError>;
#[doc(alias = "get_texture_id")]
fn texture_id(&self, idx: u32) -> Option<u32>;
}

View file

@ -26,6 +26,7 @@ impl NetAddressMeta {
}
}
#[doc(alias = "get_addr")]
pub fn addr(&self) -> gio::SocketAddress {
unsafe { from_glib_none(self.0.addr) }
}

View file

@ -22,6 +22,7 @@ impl Discoverer {
}
}
#[doc(alias = "get_property_timeout")]
pub fn property_timeout(&self) -> gst::ClockTime {
let mut value = Value::from(&0u64);
unsafe {

View file

@ -5,6 +5,7 @@ use crate::DiscovererVideoInfo;
use glib::translate::*;
impl DiscovererVideoInfo {
#[doc(alias = "get_framerate")]
pub fn framerate(&self) -> gst::Fraction {
unsafe {
gst::Fraction::new(
@ -14,6 +15,7 @@ impl DiscovererVideoInfo {
}
}
#[doc(alias = "get_par")]
pub fn par(&self) -> gst::Fraction {
unsafe {
gst::Fraction::new(

View file

@ -103,6 +103,7 @@ trait EncodingProfileHasRestrictionSetter {
}
pub trait EncodingProfileHasRestrictionGetter {
#[doc(alias = "get_restriction")]
fn restriction(&self) -> Option<gst::Caps>;
}

View file

@ -35,11 +35,13 @@ impl AsMut<gst::StructureRef> for PlayerConfig {
}
impl PlayerConfig {
#[doc(alias = "get_position_update_interval")]
pub fn position_update_interval(&self) -> u32 {
assert_initialized_main_thread!();
unsafe { ffi::gst_player_config_get_position_update_interval(self.0.to_glib_none().0) }
}
#[doc(alias = "get_seek_accurate")]
pub fn is_seek_accurate(&self) -> bool {
assert_initialized_main_thread!();
unsafe {
@ -49,6 +51,7 @@ impl PlayerConfig {
}
}
#[doc(alias = "get_user_agent")]
pub fn user_agent(&self) -> Option<String> {
assert_initialized_main_thread!();
unsafe {

View file

@ -29,6 +29,7 @@ impl Player {
}
}
#[doc(alias = "get_config")]
pub fn config(&self) -> crate::PlayerConfig {
unsafe { from_glib_full(ffi::gst_player_get_config(self.to_glib_none().0)) }
}

View file

@ -5,6 +5,7 @@ use glib::translate::*;
use std::mem;
impl PlayerVideoInfo {
#[doc(alias = "get_framerate")]
pub fn framerate(&self) -> gst::Fraction {
unsafe {
let mut fps_n = mem::MaybeUninit::uninit();
@ -18,6 +19,7 @@ impl PlayerVideoInfo {
}
}
#[doc(alias = "get_pixel_aspect_ratio")]
pub fn pixel_aspect_ratio(&self) -> gst::Fraction {
unsafe {
let mut par_n = mem::MaybeUninit::uninit();

View file

@ -40,6 +40,7 @@ impl PlayerVideoOverlayVideoRenderer {
}
}
#[doc(alias = "get_window_handle")]
pub unsafe fn window_handle(&self) -> uintptr_t {
ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0)
as uintptr_t

View file

@ -174,26 +174,31 @@ impl<'a> RTPBuffer<'a, Writable> {
}
impl<'a, T> RTPBuffer<'a, T> {
#[doc(alias = "get_seq")]
pub fn seq(&self) -> u16 {
unsafe { ffi::gst_rtp_buffer_get_seq(glib::translate::mut_override(&self.rtp_buffer)) }
}
#[doc(alias = "get_payload_type")]
pub fn payload_type(&self) -> u8 {
unsafe {
ffi::gst_rtp_buffer_get_payload_type(glib::translate::mut_override(&self.rtp_buffer))
}
}
#[doc(alias = "get_ssrc")]
pub fn ssrc(&self) -> u32 {
unsafe { ffi::gst_rtp_buffer_get_ssrc(glib::translate::mut_override(&self.rtp_buffer)) }
}
#[doc(alias = "get_timestamp")]
pub fn timestamp(&self) -> u32 {
unsafe {
ffi::gst_rtp_buffer_get_timestamp(glib::translate::mut_override(&self.rtp_buffer))
}
}
#[doc(alias = "get_csrc")]
pub fn csrc(&self, idx: u8) -> Option<u32> {
if idx < self.csrc_count() {
unsafe {
@ -207,12 +212,14 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_csrc_count")]
pub fn csrc_count(&self) -> u8 {
unsafe {
ffi::gst_rtp_buffer_get_csrc_count(glib::translate::mut_override(&self.rtp_buffer))
}
}
#[doc(alias = "get_marker")]
pub fn is_marker(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtp_buffer_get_marker(
@ -221,6 +228,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_payload_size")]
pub fn payload_size(&self) -> u32 {
unsafe {
ffi::gst_rtp_buffer_get_payload_len(glib::translate::mut_override(&self.rtp_buffer))
@ -228,6 +236,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_payload")]
pub fn payload(&self) -> Result<&[u8], glib::error::BoolError> {
let size = self.payload_size();
if size == 0 {
@ -244,6 +253,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_extension")]
pub fn is_extension(&self) -> bool {
unsafe {
from_glib(ffi::gst_rtp_buffer_get_extension(
@ -252,6 +262,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_extension_bytes")]
pub fn extension_bytes(&self) -> Option<(u16, glib::Bytes)> {
unsafe {
let mut bits: u16 = 0;
@ -265,6 +276,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_extension_onebyte_header")]
pub fn extension_onebyte_header(&self, id: u8, nth: u32) -> Option<&[u8]> {
unsafe {
let mut data = ptr::null_mut();
@ -286,6 +298,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
#[doc(alias = "get_extension_twobytes_header")]
pub fn extension_twobytes_header(&self, id: u8, nth: u32) -> Option<(u8, &[u8])> {
unsafe {
let mut data = ptr::null_mut();

View file

@ -33,6 +33,7 @@ impl RTSPToken {
}
impl RTSPTokenRef {
#[doc(alias = "get_string")]
pub fn string(&self, field: &str) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_rtsp_token_get_string(
@ -42,6 +43,7 @@ impl RTSPTokenRef {
}
}
#[doc(alias = "get_structure")]
pub fn structure(&self) -> Option<gst::Structure> {
unsafe { from_glib_none(ffi::gst_rtsp_token_get_structure(self.as_mut_ptr())) }
}
@ -55,6 +57,7 @@ impl RTSPTokenRef {
}
}
#[doc(alias = "get_mut_structure")]
pub fn structure_mut(&mut self) -> Option<&mut gst::StructureRef> {
unsafe {
let structure = ffi::gst_rtsp_token_writable_structure(self.as_mut_ptr());

View file

@ -207,6 +207,7 @@ impl SDPMediaRef {
unsafe { ffi::gst_sdp_media_formats_len(&self.0) }
}
#[doc(alias = "get_attribute")]
pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> {
if idx >= self.attributes_len() {
return None;
@ -222,6 +223,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_attribute_val")]
pub fn attribute_val(&self, key: &str) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_media_get_attribute_val(&self.0, key.to_glib_none().0);
@ -233,6 +235,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_attribute_val_n")]
pub fn attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_media_get_attribute_val_n(&self.0, key.to_glib_none().0, nth);
@ -244,6 +247,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_bandwidth")]
pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
if idx >= self.bandwidths_len() {
return None;
@ -259,10 +263,12 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_caps_from_media")]
pub fn caps_from_media(&self, pt: i32) -> Option<gst::Caps> {
unsafe { from_glib_full(ffi::gst_sdp_media_get_caps_from_media(&self.0, pt)) }
}
#[doc(alias = "get_connection")]
pub fn connection(&self, idx: u32) -> Option<&SDPConnection> {
if idx >= self.connections_len() {
return None;
@ -278,6 +284,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_format")]
pub fn format(&self, idx: u32) -> Option<&str> {
if idx >= self.formats_len() {
return None;
@ -293,6 +300,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_information")]
pub fn information(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_media_get_information(&self.0);
@ -304,6 +312,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_key")]
pub fn key(&self) -> Option<&SDPKey> {
unsafe {
let ptr = ffi::gst_sdp_media_get_key(&self.0);
@ -315,6 +324,7 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_media")]
pub fn media(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_media_get_media(&self.0);
@ -326,14 +336,17 @@ impl SDPMediaRef {
}
}
#[doc(alias = "get_num_ports")]
pub fn num_ports(&self) -> u32 {
unsafe { ffi::gst_sdp_media_get_num_ports(&self.0) }
}
#[doc(alias = "get_port")]
pub fn port(&self) -> u32 {
unsafe { ffi::gst_sdp_media_get_port(&self.0) }
}
#[doc(alias = "get_proto")]
pub fn proto(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_media_get_proto(&self.0);

View file

@ -246,6 +246,7 @@ impl SDPMessageRef {
unsafe { ffi::gst_sdp_message_emails_len(&self.0) }
}
#[doc(alias = "get_attribute")]
pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> {
if idx >= self.attributes_len() {
return None;
@ -261,6 +262,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_attribute_val")]
pub fn attribute_val(&self, key: &str) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_attribute_val(&self.0, key.to_glib_none().0);
@ -272,6 +274,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_attribute_val_n")]
pub fn attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_attribute_val_n(&self.0, key.to_glib_none().0, nth);
@ -283,6 +286,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_bandwidth")]
pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
if idx >= self.bandwidths_len() {
return None;
@ -298,6 +302,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_connection")]
pub fn connection(&self) -> Option<&SDPConnection> {
unsafe {
let ptr = ffi::gst_sdp_message_get_connection(&self.0);
@ -309,6 +314,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_email")]
pub fn email(&self, idx: u32) -> Option<&str> {
if idx >= self.emails_len() {
return None;
@ -324,6 +330,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_information")]
pub fn information(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_information(&self.0);
@ -335,6 +342,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_key")]
pub fn key(&self) -> Option<&SDPKey> {
unsafe {
let ptr = ffi::gst_sdp_message_get_key(&self.0);
@ -346,6 +354,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_media")]
pub fn media(&self, idx: u32) -> Option<&SDPMediaRef> {
if idx >= self.medias_len() {
return None;
@ -361,6 +370,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_media_mut")]
pub fn media_mut(&mut self, idx: u32) -> Option<&mut SDPMediaRef> {
if idx >= self.medias_len() {
return None;
@ -376,6 +386,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_origin")]
pub fn origin(&self) -> Option<&SDPOrigin> {
unsafe {
let ptr = ffi::gst_sdp_message_get_origin(&self.0);
@ -387,6 +398,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_phone")]
pub fn phone(&self, idx: u32) -> Option<&str> {
if idx >= self.phones_len() {
return None;
@ -402,6 +414,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_session_name")]
pub fn session_name(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_session_name(&self.0);
@ -413,6 +426,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_time")]
pub fn time(&self, idx: u32) -> Option<&SDPTime> {
if idx >= self.times_len() {
return None;
@ -428,6 +442,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_uri")]
pub fn uri(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_uri(&self.0);
@ -439,6 +454,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_version")]
pub fn version(&self) -> Option<&str> {
unsafe {
let ptr = ffi::gst_sdp_message_get_version(&self.0);
@ -450,6 +466,7 @@ impl SDPMessageRef {
}
}
#[doc(alias = "get_zone")]
pub fn zone(&self, idx: u32) -> Option<&SDPZone> {
if idx >= self.zones_len() {
return None;

View file

@ -1,6 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file.
pub trait HasStreamLock {
#[doc(alias = "get_stream_lock")]
fn stream_lock(&self) -> *mut glib::ffi::GRecMutex;
#[doc(alias = "get_element_as_ptr")]
fn element_as_ptr(&self) -> *const gst::ffi::GstElement;
}

View file

@ -34,18 +34,23 @@ pub static BUFFER_POOL_OPTION_VIDEO_META: Lazy<&'static str> = Lazy::new(|| unsa
pub struct VideoAlignment(pub(crate) ffi::GstVideoAlignment);
impl VideoAlignment {
#[doc(alias = "get_padding_top")]
pub fn padding_top(&self) -> u32 {
self.0.padding_top
}
#[doc(alias = "get_padding_bottom")]
pub fn padding_bottom(&self) -> u32 {
self.0.padding_bottom
}
#[doc(alias = "get_padding_left")]
pub fn padding_left(&self) -> u32 {
self.0.padding_left
}
#[doc(alias = "get_padding_right")]
pub fn padding_right(&self) -> u32 {
self.0.padding_right
}
#[doc(alias = "get_stride_align")]
pub fn stride_align(&self) -> &[u32; ffi::GST_VIDEO_MAX_PLANES as usize] {
&self.0.stride_align
}
@ -93,6 +98,7 @@ impl<'a> ToGlibPtr<'a, *const ffi::GstVideoAlignment> for VideoAlignment {
}
pub trait VideoBufferPoolConfig {
#[doc(alias = "get_video_alignment")]
fn video_alignment(&self) -> Option<VideoAlignment>;
fn set_video_alignment(&mut self, align: &VideoAlignment);

View file

@ -61,6 +61,7 @@ impl<'a> VideoCodecFrame<'a> {
Self { frame, element }
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> VideoCodecFrameFlags {
let flags = unsafe { (*self.to_glib_none().0).flags };
VideoCodecFrameFlags::from_bits_truncate(flags)
@ -74,18 +75,22 @@ impl<'a> VideoCodecFrame<'a> {
unsafe { (*self.to_glib_none().0).flags &= !flags.bits() }
}
#[doc(alias = "get_system_frame_number")]
pub fn system_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).system_frame_number }
}
#[doc(alias = "get_decode_frame_number")]
pub fn decode_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).decode_frame_number }
}
#[doc(alias = "get_presentation_frame_number")]
pub fn presentation_frame_number(&self) -> u32 {
unsafe { (*self.to_glib_none().0).presentation_frame_number }
}
#[doc(alias = "get_dts")]
pub fn dts(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).dts) }
}
@ -96,6 +101,7 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_pts")]
pub fn pts(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).pts) }
}
@ -106,6 +112,7 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_duration")]
pub fn duration(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).duration) }
}
@ -116,10 +123,12 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_distance_from_sync")]
pub fn distance_from_sync(&self) -> i32 {
unsafe { (*self.to_glib_none().0).distance_from_sync }
}
#[doc(alias = "get_input_buffer")]
pub fn input_buffer(&self) -> Option<&gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).input_buffer;
@ -131,6 +140,7 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_output_buffer")]
pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).output_buffer;
@ -142,6 +152,7 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_output_buffer_mut")]
pub fn output_buffer_mut(&mut self) -> Option<&mut gst::BufferRef> {
unsafe {
let ptr = (*self.to_glib_none().0).output_buffer;
@ -176,6 +187,7 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_deadline")]
pub fn deadline(&self) -> gst::ClockTime {
unsafe { from_glib((*self.to_glib_none().0).deadline) }
}

View file

@ -9,7 +9,9 @@ use std::ptr;
use crate::video_info::VideoInfo;
pub trait VideoCodecStateContext<'a> {
#[doc(alias = "get_element")]
fn element(&self) -> Option<&'a dyn HasStreamLock>;
#[doc(alias = "get_element_as_ptr")]
fn element_as_ptr(&self) -> *const gst::ffi::GstElement;
}
@ -87,6 +89,7 @@ impl<'a> VideoCodecState<'a, InNegotiation<'a>> {
}
impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
#[doc(alias = "get_info")]
pub fn info(&self) -> VideoInfo {
unsafe {
let ptr = &((*self.as_mut_ptr()).info) as *const _ as usize as *mut _;
@ -94,6 +97,7 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
}
}
#[doc(alias = "get_caps")]
pub fn caps(&self) -> Option<&gst::CapsRef> {
unsafe {
let ptr = (*self.as_mut_ptr()).caps;
@ -106,6 +110,7 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
}
}
#[doc(alias = "get_codec_data")]
pub fn codec_data(&self) -> Option<&gst::BufferRef> {
unsafe {
let ptr = (*self.as_mut_ptr()).codec_data;
@ -118,6 +123,7 @@ impl<'a, T: VideoCodecStateContext<'a>> VideoCodecState<'a, T> {
}
}
#[doc(alias = "get_allocation_caps")]
pub fn allocation_caps(&self) -> Option<&gst::CapsRef> {
unsafe {
let ptr = (*self.as_mut_ptr()).allocation_caps;

View file

@ -5,6 +5,7 @@ use std::mem;
use glib::translate::IntoGlib;
impl crate::VideoColorMatrix {
#[doc(alias = "get_kr_kb")]
pub fn kr_kb(&self) -> Result<(f64, f64), glib::BoolError> {
assert_initialized_main_thread!();
unsafe {

View file

@ -49,6 +49,7 @@ impl VideoConverter {
}
}
#[doc(alias = "get_config")]
pub fn config(&self) -> VideoConverterConfig {
unsafe {
VideoConverterConfig(
@ -160,6 +161,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.resampler-method", &v);
}
#[doc(alias = "get_resampler_method")]
pub fn resampler_method(&self) -> crate::VideoResamplerMethod {
self.0
.get_optional("GstVideoConverter.resampler-method")
@ -171,6 +173,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.chroma-resampler-method", &v);
}
#[doc(alias = "get_chroma_resampler_method")]
pub fn chroma_resampler_method(&self) -> crate::VideoResamplerMethod {
self.0
.get_optional("GstVideoConverter.chroma-resampler-method")
@ -182,6 +185,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.resampler-taps", &v);
}
#[doc(alias = "get_resampler_taps")]
pub fn resampler_taps(&self) -> u32 {
self.0
.get_optional("GstVideoConverter.resampler-taps")
@ -193,6 +197,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dither-method", &v);
}
#[doc(alias = "get_dither_method")]
pub fn dither_method(&self) -> crate::VideoDitherMethod {
self.0
.get_optional("GstVideoConverter.dither-method")
@ -204,6 +209,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dither-quantization", &v);
}
#[doc(alias = "get_dither_quantization")]
pub fn dither_quantization(&self) -> u32 {
self.0
.get_optional("GstVideoConverter.dither-quantization")
@ -215,6 +221,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.src-x", &v);
}
#[doc(alias = "get_src_x")]
pub fn src_x(&self) -> i32 {
self.0
.get_optional("GstVideoConverter.src-x")
@ -226,6 +233,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.src-y", &v);
}
#[doc(alias = "get_src_y")]
pub fn src_y(&self) -> i32 {
self.0
.get_optional("GstVideoConverter.src-y")
@ -241,6 +249,7 @@ impl VideoConverterConfig {
}
}
#[doc(alias = "get_src_width")]
pub fn src_width(&self) -> Option<i32> {
self.0
.get_optional("GstVideoConverter.src-width")
@ -255,6 +264,7 @@ impl VideoConverterConfig {
}
}
#[doc(alias = "get_src_height")]
pub fn src_height(&self) -> Option<i32> {
self.0
.get_optional("GstVideoConverter.src-height")
@ -265,6 +275,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dest-x", &v);
}
#[doc(alias = "get_dest_x")]
pub fn dest_x(&self) -> i32 {
self.0
.get_optional("GstVideoConverter.dest-x")
@ -276,6 +287,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.dest-y", &v);
}
#[doc(alias = "get_dest_y")]
pub fn dest_y(&self) -> i32 {
self.0
.get_optional("GstVideoConverter.dest-y")
@ -291,6 +303,7 @@ impl VideoConverterConfig {
}
}
#[doc(alias = "get_dest_width")]
pub fn dest_width(&self) -> Option<i32> {
self.0
.get_optional("GstVideoConverter.dest-width")
@ -305,6 +318,7 @@ impl VideoConverterConfig {
}
}
#[doc(alias = "get_dest_height")]
pub fn dest_height(&self) -> Option<i32> {
self.0
.get_optional("GstVideoConverter.dest-height")
@ -315,6 +329,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.fill-border", &v);
}
#[doc(alias = "get_fill_border")]
pub fn fills_border(&self) -> bool {
self.0
.get_optional("GstVideoConverter.fill-border")
@ -326,6 +341,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.alpha-value", &v);
}
#[doc(alias = "get_alpha_value")]
pub fn alpha_value(&self) -> f64 {
self.0
.get_optional("GstVideoConverter.alpha-value")
@ -337,6 +353,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.alpha-mode", &v);
}
#[doc(alias = "get_alpha_mode")]
pub fn alpha_mode(&self) -> crate::VideoAlphaMode {
self.0
.get_optional("GstVideoConverter.alpha-mode")
@ -348,6 +365,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.border-argb", &v);
}
#[doc(alias = "get_border_argb")]
pub fn border_argb(&self) -> u32 {
self.0
.get_optional("GstVideoConverter.border-argb")
@ -359,6 +377,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.chroma-mode", &v);
}
#[doc(alias = "get_chroma_mode")]
pub fn chroma_mode(&self) -> crate::VideoChromaMode {
self.0
.get_optional("GstVideoConverter.chroma-mode")
@ -370,6 +389,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.matrix-mode", &v);
}
#[doc(alias = "get_matrix_mode")]
pub fn matrix_mode(&self) -> crate::VideoMatrixMode {
self.0
.get_optional("GstVideoConverter.matrix-mode")
@ -381,6 +401,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.gamma-mode", &v);
}
#[doc(alias = "get_gamma_mode")]
pub fn gamma_mode(&self) -> crate::VideoGammaMode {
self.0
.get_optional("GstVideoConverter.gamma-mode")
@ -392,6 +413,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.primaries-mode", &v);
}
#[doc(alias = "get_primaries_mode")]
pub fn primaries_mode(&self) -> crate::VideoPrimariesMode {
self.0
.get_optional("GstVideoConverter.primaries-mode")
@ -403,6 +425,7 @@ impl VideoConverterConfig {
self.0.set("GstVideoConverter.threads", &v);
}
#[doc(alias = "get_threads")]
pub fn threads(&self) -> u32 {
self.0
.get_optional("GstVideoConverter.threads")

View file

@ -36,10 +36,14 @@ pub trait VideoDecoderExtManual: 'static {
params: Option<&gst::BufferPoolAcquireParams>,
) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "get_frame")]
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
#[doc(alias = "get_frames")]
fn frames(&self) -> Vec<VideoCodecFrame>;
#[doc(alias = "get_oldest_frame")]
fn oldest_frame(&self) -> Option<VideoCodecFrame>;
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>;
@ -47,9 +51,11 @@ pub trait VideoDecoderExtManual: 'static {
fn release_frame(&self, frame: VideoCodecFrame);
fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "get_latency")]
fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
#[doc(alias = "get_output_state")]
fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>;
fn set_output_state(
&self,

View file

@ -18,10 +18,14 @@ pub trait VideoEncoderExtManual: 'static {
size: usize,
) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "get_frame")]
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
#[doc(alias = "get_frames")]
fn frames(&self) -> Vec<VideoCodecFrame>;
#[doc(alias = "get_oldest_frame")]
fn oldest_frame(&self) -> Option<VideoCodecFrame>;
#[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
fn finish_frame(
@ -33,9 +37,11 @@ pub trait VideoEncoderExtManual: 'static {
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "get_latency")]
fn latency(&self) -> (gst::ClockTime, gst::ClockTime);
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
#[doc(alias = "get_output_state")]
fn output_state(&self) -> Option<VideoCodecState<'static, Readable>>;
fn set_output_state(
&self,

View file

@ -801,6 +801,7 @@ impl<T> Drop for VideoFrameRef<T> {
}
pub trait VideoBufferExt {
#[doc(alias = "get_video_flags")]
fn video_flags(&self) -> crate::VideoBufferFlags;
fn set_video_flags(&mut self, flags: crate::VideoBufferFlags);
fn unset_video_flags(&mut self, flags: crate::VideoBufferFlags);

View file

@ -110,40 +110,49 @@ impl VideoMeta {
}
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> crate::VideoFrameFlags {
unsafe { from_glib(self.0.flags) }
}
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::VideoFormat {
unsafe { from_glib(self.0.format) }
}
#[doc(alias = "get_id")]
pub fn id(&self) -> i32 {
self.0.id
}
#[doc(alias = "get_width")]
pub fn width(&self) -> u32 {
self.0.width
}
#[doc(alias = "get_height")]
pub fn height(&self) -> u32 {
self.0.height
}
#[doc(alias = "get_n_planes")]
pub fn n_planes(&self) -> u32 {
self.0.n_planes
}
#[doc(alias = "get_offset")]
pub fn offset(&self) -> &[usize] {
&self.0.offset[0..(self.0.n_planes as usize)]
}
#[doc(alias = "get_stride")]
pub fn stride(&self) -> &[i32] {
&self.0.stride[0..(self.0.n_planes as usize)]
}
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "get_alignment")]
pub fn alignment(&self) -> crate::VideoAlignment {
crate::VideoAlignment::new(
self.0.alignment.padding_top,
@ -156,6 +165,7 @@ impl VideoMeta {
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "get_plane_size")]
pub fn plane_size(&self) -> Result<[usize; crate::VIDEO_MAX_PLANES], glib::BoolError> {
let mut plane_size = [0; crate::VIDEO_MAX_PLANES];
@ -174,6 +184,7 @@ impl VideoMeta {
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "get_plane_height")]
pub fn plane_height(&self) -> Result<[u32; crate::VIDEO_MAX_PLANES], glib::BoolError> {
let mut plane_height = [0; crate::VIDEO_MAX_PLANES];
@ -259,6 +270,7 @@ impl VideoCropMeta {
}
}
#[doc(alias = "get_rect")]
pub fn rect(&self) -> (u32, u32, u32, u32) {
(self.0.x, self.0.y, self.0.width, self.0.height)
}
@ -314,23 +326,28 @@ impl VideoRegionOfInterestMeta {
}
}
#[doc(alias = "get_rect")]
pub fn rect(&self) -> (u32, u32, u32, u32) {
(self.0.x, self.0.y, self.0.w, self.0.h)
}
#[doc(alias = "get_id")]
pub fn id(&self) -> i32 {
self.0.id
}
#[doc(alias = "get_parent_id")]
pub fn parent_id(&self) -> i32 {
self.0.parent_id
}
#[doc(alias = "get_roi_type")]
pub fn roi_type<'a>(&self) -> &'a str {
unsafe { glib::Quark::from_glib(self.0.roi_type).to_string() }
}
#[cfg(feature = "v1_14")]
#[doc(alias = "get_params")]
pub fn params(&self) -> ParamsIter {
ParamsIter {
_meta: self,
@ -339,6 +356,7 @@ impl VideoRegionOfInterestMeta {
}
#[cfg(feature = "v1_14")]
#[doc(alias = "get_param")]
pub fn param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> {
self.params().find(|s| s.name() == name)
}
@ -447,6 +465,7 @@ impl VideoAffineTransformationMeta {
}
}
#[doc(alias = "get_matrix")]
pub fn matrix(&self) -> &[f32; 16] {
&self.0.matrix
}
@ -500,10 +519,12 @@ impl VideoOverlayCompositionMeta {
}
}
#[doc(alias = "get_overlay")]
pub fn overlay(&self) -> &crate::VideoOverlayCompositionRef {
unsafe { crate::VideoOverlayCompositionRef::from_ptr(self.0.overlay) }
}
#[doc(alias = "get_overlay_owned")]
pub fn overlay_owned(&self) -> crate::VideoOverlayComposition {
unsafe { from_glib_none(self.overlay().as_ptr()) }
}
@ -568,10 +589,12 @@ impl VideoCaptionMeta {
}
}
#[doc(alias = "get_caption_type")]
pub fn caption_type(&self) -> crate::VideoCaptionType {
unsafe { from_glib(self.0.caption_type) }
}
#[doc(alias = "get_data")]
pub fn data(&self) -> &[u8] {
unsafe {
use std::slice;
@ -637,14 +660,17 @@ impl VideoAFDMeta {
}
}
#[doc(alias = "get_field")]
pub fn field(&self) -> u8 {
self.0.field
}
#[doc(alias = "get_spec")]
pub fn spec(&self) -> crate::VideoAFDSpec {
unsafe { from_glib(self.0.spec) }
}
#[doc(alias = "get_afd")]
pub fn afd(&self) -> crate::VideoAFDValue {
unsafe { from_glib(self.0.afd) }
}
@ -709,6 +735,7 @@ impl VideoBarMeta {
}
}
#[doc(alias = "get_field")]
pub fn field(&self) -> u8 {
self.0.field
}
@ -717,10 +744,12 @@ impl VideoBarMeta {
unsafe { from_glib(self.0.is_letterbox) }
}
#[doc(alias = "get_bar_data1")]
pub fn bar_data1(&self) -> u32 {
self.0.bar_data1
}
#[doc(alias = "get_bar_data2")]
pub fn bar_data2(&self) -> u32 {
self.0.bar_data2
}

View file

@ -53,6 +53,7 @@ impl VideoOverlayRectangle {
}
impl VideoOverlayRectangleRef {
#[doc(alias = "get_flags")]
pub fn flags(&self) -> crate::VideoOverlayFormatFlags {
unsafe {
from_glib(ffi::gst_video_overlay_rectangle_get_flags(
@ -61,6 +62,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_global_alpha")]
pub fn global_alpha(&self) -> f32 {
unsafe { ffi::gst_video_overlay_rectangle_get_global_alpha(self.as_mut_ptr()) }
}
@ -69,10 +71,12 @@ impl VideoOverlayRectangleRef {
unsafe { ffi::gst_video_overlay_rectangle_set_global_alpha(self.as_mut_ptr(), alpha) }
}
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> u32 {
unsafe { ffi::gst_video_overlay_rectangle_get_seqnum(self.as_mut_ptr()) }
}
#[doc(alias = "get_render_rectangle")]
pub fn render_rectangle(&self) -> (i32, i32, u32, u32) {
unsafe {
let mut render_x = mem::MaybeUninit::uninit();
@ -115,6 +119,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_unscaled_raw")]
pub fn pixels_unscaled_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_raw(
@ -124,6 +129,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_unscaled_ayuv")]
pub fn pixels_unscaled_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_ayuv(
@ -133,6 +139,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_unscaled_argb")]
pub fn pixels_unscaled_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_argb(
@ -142,6 +149,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_raw")]
pub fn pixels_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_raw(
@ -151,6 +159,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_ayuv")]
pub fn pixels_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_ayuv(
@ -160,6 +169,7 @@ impl VideoOverlayRectangleRef {
}
}
#[doc(alias = "get_pixels_argb")]
pub fn pixels_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_argb(
@ -226,6 +236,7 @@ impl VideoOverlayCompositionRef {
unsafe { ffi::gst_video_overlay_composition_n_rectangles(self.as_mut_ptr()) }
}
#[doc(alias = "get_rectangle")]
pub fn rectangle(&self, idx: u32) -> Result<VideoOverlayRectangle, glib::error::BoolError> {
if idx >= self.n_rectangles() {
return Err(glib::bool_error!("Invalid index"));
@ -242,6 +253,7 @@ impl VideoOverlayCompositionRef {
}
}
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> u32 {
unsafe { ffi::gst_video_overlay_composition_get_seqnum(self.as_mut_ptr()) }
}

View file

@ -552,6 +552,7 @@ impl VideoTimeCodeMeta {
}
}
#[doc(alias = "get_tc")]
pub fn tc(&self) -> ValidVideoTimeCode {
unsafe { ValidVideoTimeCode::from_glib_none(&self.0.tc as *const _) }
}

View file

@ -21,6 +21,7 @@ impl VideoTimeCodeInterval {
}
}
#[doc(alias = "get_hours")]
pub fn hours(&self) -> u32 {
self.0.hours
}
@ -29,6 +30,7 @@ impl VideoTimeCodeInterval {
self.0.hours = hours
}
#[doc(alias = "get_minutes")]
pub fn minutes(&self) -> u32 {
self.0.minutes
}
@ -38,6 +40,7 @@ impl VideoTimeCodeInterval {
self.0.minutes = minutes
}
#[doc(alias = "get_seconds")]
pub fn seconds(&self) -> u32 {
self.0.seconds
}
@ -47,6 +50,7 @@ impl VideoTimeCodeInterval {
self.0.seconds = seconds
}
#[doc(alias = "get_frames")]
pub fn frames(&self) -> u32 {
self.0.frames
}

View file

@ -17,10 +17,12 @@ impl WebRTCSessionDescription {
}
}
#[doc(alias = "get_type")]
pub fn type_(&self) -> crate::WebRTCSDPType {
unsafe { from_glib((*self.to_glib_none().0).type_) }
}
#[doc(alias = "get_sdp")]
pub fn sdp(&self) -> gst_sdp::SDPMessage {
unsafe { from_glib_none((*self.to_glib_none().0).sdp) }
}

View file

@ -13,18 +13,22 @@ unsafe impl Send for AllocationParams {}
unsafe impl Sync for AllocationParams {}
impl AllocationParams {
#[doc(alias = "get_flags")]
pub fn flags(&self) -> MemoryFlags {
unsafe { from_glib(self.0.flags) }
}
#[doc(alias = "get_align")]
pub fn align(&self) -> usize {
self.0.align
}
#[doc(alias = "get_prefix")]
pub fn prefix(&self) -> usize {
self.0.prefix
}
#[doc(alias = "get_padding")]
pub fn padding(&self) -> usize {
self.0.padding
}

View file

@ -33,6 +33,7 @@ pub trait GstBinExtManual: 'static {
fn iterate_sinks(&self) -> crate::Iterator<Element>;
fn iterate_sorted(&self) -> crate::Iterator<Element>;
fn iterate_sources(&self) -> crate::Iterator<Element>;
#[doc(alias = "get_children")]
fn children(&self) -> Vec<Element>;
fn debug_to_dot_data(&self, details: crate::DebugGraphDetails) -> GString;
@ -51,6 +52,7 @@ pub trait GstBinExtManual: 'static {
fn unset_bin_flags(&self, flags: BinFlags);
#[doc(alias = "get_bin_flags")]
fn bin_flags(&self) -> BinFlags;
}

View file

@ -296,10 +296,12 @@ impl BufferRef {
}
}
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
unsafe { ffi::gst_buffer_get_size(self.as_mut_ptr()) }
}
#[doc(alias = "get_maxsize")]
pub fn maxsize(&self) -> usize {
unsafe {
let mut maxsize = mem::MaybeUninit::uninit();
@ -323,6 +325,7 @@ impl BufferRef {
}
}
#[doc(alias = "get_offset")]
pub fn offset(&self) -> u64 {
self.0.offset
}
@ -331,6 +334,7 @@ impl BufferRef {
self.0.offset = offset;
}
#[doc(alias = "get_offset_end")]
pub fn offset_end(&self) -> u64 {
self.0.offset_end
}
@ -339,6 +343,7 @@ impl BufferRef {
self.0.offset_end = offset_end;
}
#[doc(alias = "get_pts")]
pub fn pts(&self) -> ClockTime {
unsafe { from_glib(self.0.pts) }
}
@ -347,6 +352,7 @@ impl BufferRef {
self.0.pts = pts.into_glib();
}
#[doc(alias = "get_dts")]
pub fn dts(&self) -> ClockTime {
unsafe { from_glib(self.0.dts) }
}
@ -355,6 +361,7 @@ impl BufferRef {
self.0.dts = dts.into_glib();
}
#[doc(alias = "get_dts_or_pts")]
pub fn dts_or_pts(&self) -> ClockTime {
let val = self.dts();
if val.is_none() {
@ -364,6 +371,7 @@ impl BufferRef {
}
}
#[doc(alias = "get_duration")]
pub fn duration(&self) -> ClockTime {
unsafe { from_glib(self.0.duration) }
}
@ -372,6 +380,7 @@ impl BufferRef {
self.0.duration = duration.into_glib();
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> BufferFlags {
BufferFlags::from_bits_truncate(self.0.mini_object.flags)
}
@ -384,6 +393,7 @@ impl BufferRef {
self.0.mini_object.flags &= !flags.bits();
}
#[doc(alias = "get_meta")]
pub fn meta<T: MetaAPI>(&self) -> Option<MetaRef<T>> {
unsafe {
let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::meta_api().into_glib());
@ -395,6 +405,7 @@ impl BufferRef {
}
}
#[doc(alias = "get_meta_mut")]
pub fn meta_mut<T: MetaAPI>(&mut self) -> Option<MetaRefMut<T, crate::meta::Standalone>> {
unsafe {
let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::meta_api().into_glib());
@ -500,6 +511,7 @@ impl BufferRef {
}
}
#[doc(alias = "get_all_memory")]
pub fn all_memory(&self) -> Option<Memory> {
unsafe {
let res = ffi::gst_buffer_get_all_memory(self.as_mut_ptr());
@ -511,10 +523,12 @@ impl BufferRef {
}
}
#[doc(alias = "get_max_memory")]
pub fn max_memory() -> u32 {
unsafe { ffi::gst_buffer_get_max_memory() }
}
#[doc(alias = "get_memory")]
pub fn memory(&self, idx: u32) -> Option<Memory> {
if idx >= self.n_memory() {
None
@ -530,6 +544,7 @@ impl BufferRef {
}
}
#[doc(alias = "get_memory_range")]
pub fn memory_range(&self, idx: u32, length: Option<u32>) -> Option<Memory> {
assert!(idx + length.unwrap_or(0) < self.n_memory());
unsafe {
@ -934,10 +949,12 @@ impl PartialEq for BufferRef {
impl Eq for BufferRef {}
impl<'a, T> BufferMap<'a, T> {
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
self.map_info.size
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> &BufferRef {
self.buffer
}
@ -1009,10 +1026,12 @@ impl<T> MappedBuffer<T> {
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) }
}
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
self.map_info.size
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> &BufferRef {
self.buffer.as_ref().unwrap().as_ref()
}

View file

@ -264,6 +264,7 @@ impl<T> BufferCursor<T> {
Ok(self.cur_offset)
}
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> &BufferRef {
self.buffer.as_ref().unwrap().as_ref()
}
@ -369,6 +370,7 @@ impl<T> BufferRefCursor<T> {
}
impl<'a> BufferRefCursor<&'a BufferRef> {
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> &BufferRef {
self.buffer
}
@ -391,6 +393,7 @@ impl<'a> BufferRefCursor<&'a BufferRef> {
}
impl<'a> BufferRefCursor<&'a mut BufferRef> {
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> &BufferRef {
self.buffer
}

View file

@ -62,6 +62,7 @@ impl BufferPoolConfig {
}
}
#[doc(alias = "get_options")]
pub fn options(&self) -> Vec<String> {
unsafe {
let n = ffi::gst_buffer_pool_config_n_options(self.0.to_glib_none().0) as usize;
@ -96,6 +97,7 @@ impl BufferPoolConfig {
}
}
#[doc(alias = "get_params")]
pub fn params(&self) -> Option<(Option<crate::Caps>, u32, u32, u32)> {
unsafe {
let mut caps = ptr::null_mut();
@ -144,6 +146,7 @@ impl BufferPoolConfig {
}
}
#[doc(alias = "get_allocator")]
pub fn allocator(&self) -> Option<(Option<Allocator>, AllocationParams)> {
unsafe {
let mut allocator = ptr::null_mut();
@ -281,6 +284,7 @@ impl Default for BufferPool {
}
pub trait BufferPoolExtManual: 'static {
#[doc(alias = "get_config")]
fn config(&self) -> BufferPoolConfig;
fn set_config(&self, config: BufferPoolConfig) -> Result<(), glib::error::BoolError>;

View file

@ -63,6 +63,7 @@ impl BufferListRef {
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
#[doc(alias = "gst_buffer_list_get_writable")]
#[doc(alias = "get_writable")]
pub fn get_mut(&mut self, idx: u32) -> Option<&mut BufferRef> {
unsafe {
let ptr = ffi::gst_buffer_list_get_writable(self.as_mut_ptr(), idx);

View file

@ -19,6 +19,7 @@ cfg_if::cfg_if! {
use super::Bus;
pub trait UnixBusExtManual: 'static {
#[doc(alias = "get_pollfd")]
fn pollfd(&self) -> unix::io::RawFd;
}

View file

@ -19,6 +19,7 @@ cfg_if::cfg_if! {
use super::Bus;
pub trait WindowsBusExtManual: 'static {
#[doc(alias = "get_pollfd")]
fn pollfd(&self) -> windows::io::RawHandle;
}

View file

@ -179,6 +179,7 @@ impl CapsRef {
}
}
#[doc(alias = "get_structure")]
pub fn structure(&self, idx: u32) -> Option<&StructureRef> {
if idx >= self.size() {
return None;
@ -194,6 +195,7 @@ impl CapsRef {
}
}
#[doc(alias = "get_mut_structure")]
pub fn structure_mut(&mut self, idx: u32) -> Option<&mut StructureRef> {
if idx >= self.size() {
return None;
@ -209,6 +211,7 @@ impl CapsRef {
}
}
#[doc(alias = "get_features")]
pub fn features(&self, idx: u32) -> Option<&CapsFeaturesRef> {
if idx >= self.size() {
return None;
@ -220,6 +223,7 @@ impl CapsRef {
}
}
#[doc(alias = "get_mut_features")]
pub fn features_mut(&mut self, idx: u32) -> Option<&mut CapsFeaturesRef> {
if idx >= self.size() {
return None;
@ -254,6 +258,7 @@ impl CapsRef {
}
}
#[doc(alias = "get_size")]
pub fn size(&self) -> u32 {
unsafe { ffi::gst_caps_get_size(self.as_ptr()) }
}

View file

@ -326,10 +326,12 @@ impl CapsFeaturesRef {
}
}
#[doc(alias = "get_size")]
pub fn size(&self) -> u32 {
unsafe { ffi::gst_caps_features_get_size(self.as_ptr()) }
}
#[doc(alias = "get_nth")]
pub fn nth(&self, idx: u32) -> Option<&str> {
if idx >= self.size() {
return None;

View file

@ -6,6 +6,7 @@ use glib::translate::*;
use std::ptr;
pub trait ChildProxyExtManual: 'static {
#[doc(alias = "get_child_property")]
fn child_property(&self, name: &str) -> Option<glib::Value>;
fn set_child_property(
&self,

View file

@ -33,6 +33,7 @@ glib::wrapper! {
}
impl ClockId {
#[doc(alias = "get_time")]
pub fn time(&self) -> ClockTime {
unsafe { from_glib(ffi::gst_clock_id_get_time(self.to_glib_none().0)) }
}
@ -59,6 +60,7 @@ impl ClockId {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_clock")]
pub fn clock(&self) -> Option<Clock> {
unsafe { from_glib_full(ffi::gst_clock_id_get_clock(self.to_glib_none().0)) }
}
@ -74,6 +76,7 @@ impl ClockId {
}
}
#[doc(alias = "get_type")]
pub fn type_(&self) -> ClockEntryType {
unsafe {
let ptr: *mut ffi::GstClockEntry = self.to_glib_none().0 as *mut _;
@ -81,6 +84,7 @@ impl ClockId {
}
}
#[doc(alias = "get_status")]
pub fn status(&self) -> &AtomicClockReturn {
unsafe {
let ptr: *mut ffi::GstClockEntry = self.to_glib_none().0 as *mut _;
@ -222,6 +226,7 @@ impl convert::TryFrom<ClockId> for PeriodicClockId {
}
impl PeriodicClockId {
#[doc(alias = "get_interval")]
pub fn interval(&self) -> ClockTime {
unsafe {
let ptr: *mut ffi::GstClockEntry = self.to_glib_none().0 as *mut _;
@ -395,6 +400,7 @@ pub trait ClockExtManual: 'static {
fn unset_clock_flags(&self, flags: ClockFlags);
#[doc(alias = "get_clock_flags")]
fn clock_flags(&self) -> ClockFlags;
}

View file

@ -24,6 +24,7 @@ impl Context {
}
impl ContextRef {
#[doc(alias = "get_context_type")]
pub fn context_type(&self) -> &str {
unsafe {
let raw = ffi::gst_context_get_context_type(self.as_mut_ptr());
@ -44,10 +45,12 @@ impl ContextRef {
unsafe { from_glib(ffi::gst_context_is_persistent(self.as_mut_ptr())) }
}
#[doc(alias = "get_structure")]
pub fn structure(&self) -> &StructureRef {
unsafe { StructureRef::from_glib_borrow(ffi::gst_context_get_structure(self.as_mut_ptr())) }
}
#[doc(alias = "get_mut_structure")]
pub fn structure_mut(&mut self) -> &mut StructureRef {
unsafe {
StructureRef::from_glib_borrow_mut(ffi::gst_context_writable_structure(

View file

@ -6,6 +6,7 @@ use glib::prelude::*;
use glib::translate::*;
pub trait ControlBindingExtManual: 'static {
#[doc(alias = "get_g_value_array")]
fn g_value_array(
&self,
timestamp: ClockTime,

View file

@ -6,6 +6,7 @@ use glib::prelude::*;
use glib::translate::*;
pub trait ControlSourceExtManual: 'static {
#[doc(alias = "get_value_array")]
fn value_array(
&self,
timestamp: ClockTime,

View file

@ -223,6 +223,7 @@ impl DateTime {
}
}
#[doc(alias = "get_day")]
pub fn day(&self) -> Option<i32> {
if !self.has_day() {
return None;
@ -231,6 +232,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_day(self.to_glib_none().0)) }
}
#[doc(alias = "get_hour")]
pub fn hour(&self) -> Option<i32> {
if !self.has_time() {
return None;
@ -239,6 +241,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_hour(self.to_glib_none().0)) }
}
#[doc(alias = "get_microsecond")]
pub fn microsecond(&self) -> Option<i32> {
if !self.has_second() {
return None;
@ -247,6 +250,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_microsecond(self.to_glib_none().0)) }
}
#[doc(alias = "get_minute")]
pub fn minute(&self) -> Option<i32> {
if !self.has_time() {
return None;
@ -255,6 +259,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_minute(self.to_glib_none().0)) }
}
#[doc(alias = "get_month")]
pub fn month(&self) -> Option<i32> {
if !self.has_month() {
return None;
@ -263,6 +268,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_month(self.to_glib_none().0)) }
}
#[doc(alias = "get_second")]
pub fn second(&self) -> Option<i32> {
if !self.has_second() {
return None;
@ -271,6 +277,7 @@ impl DateTime {
unsafe { Some(ffi::gst_date_time_get_second(self.to_glib_none().0)) }
}
#[doc(alias = "get_time_zone_offset")]
pub fn time_zone_offset(&self) -> Option<f32> {
if !self.has_time() {
return None;
@ -352,6 +359,7 @@ impl cmp::PartialOrd for DateTime {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
#[inline]
#[allow(clippy::unnecessary_wraps)]
#[doc(alias = "get_cmp")]
fn cmp(delta: i32) -> Option<cmp::Ordering> {
skip_assert_initialized!();
Some(delta.cmp(&0))

View file

@ -32,6 +32,7 @@ impl DeviceProvider {
}
pub trait DeviceProviderExtManual: 'static {
#[doc(alias = "get_metadata")]
fn metadata<'a>(&self, key: &str) -> Option<&'a str>;
}

View file

@ -113,6 +113,7 @@ impl FromGlib<libc::c_ulong> for NotifyWatchId {
}
pub trait ElementExtManual: 'static {
#[doc(alias = "get_element_class")]
fn element_class(&self) -> &glib::Class<Element>;
fn change_state(&self, transition: StateChange)
@ -122,16 +123,19 @@ pub trait ElementExtManual: 'static {
ret: StateChangeReturn,
) -> Result<StateChangeSuccess, StateChangeError>;
#[doc(alias = "get_state")]
fn state(
&self,
timeout: ClockTime,
) -> (Result<StateChangeSuccess, StateChangeError>, State, State);
fn set_state(&self, state: State) -> Result<StateChangeSuccess, StateChangeError>;
#[doc(alias = "get_current_state")]
fn current_state(&self) -> State {
self.state(ClockTime::from(0)).1
}
#[doc(alias = "get_pending_state")]
fn pending_state(&self) -> State {
self.state(ClockTime::from(0)).2
}
@ -140,9 +144,12 @@ pub trait ElementExtManual: 'static {
fn send_event(&self, event: Event) -> bool;
#[doc(alias = "get_metadata")]
fn metadata<'a>(&self, key: &str) -> Option<&'a str>;
#[doc(alias = "get_pad_template")]
fn pad_template(&self, name: &str) -> Option<PadTemplate>;
#[doc(alias = "get_pad_template_list")]
fn pad_template_list(&self) -> Vec<PadTemplate>;
#[allow(clippy::too_many_arguments)]
@ -161,6 +168,7 @@ pub trait ElementExtManual: 'static {
fn unset_element_flags(&self, flags: ElementFlags);
#[doc(alias = "get_element_flags")]
fn element_flags(&self) -> ElementFlags;
#[cfg(any(feature = "v1_10", feature = "dox"))]
@ -185,8 +193,11 @@ pub trait ElementExtManual: 'static {
fn iterate_sink_pads(&self) -> crate::Iterator<Pad>;
fn iterate_src_pads(&self) -> crate::Iterator<Pad>;
#[doc(alias = "get_pads")]
fn pads(&self) -> Vec<Pad>;
#[doc(alias = "get_sink_pads")]
fn sink_pads(&self) -> Vec<Pad>;
#[doc(alias = "get_src_pads")]
fn src_pads(&self) -> Vec<Pad>;
fn num_pads(&self) -> u16;
@ -257,7 +268,9 @@ pub trait ElementExtManual: 'static {
F: FnOnce(&Self) -> T + Send + 'static,
T: Send + 'static;
#[doc(alias = "get_current_running_time")]
fn current_running_time(&self) -> crate::ClockTime;
#[doc(alias = "get_current_clock_time")]
fn current_clock_time(&self) -> crate::ClockTime;
}
@ -830,6 +843,7 @@ impl<O: IsA<Element>> ElementExtManual for O {
}
pub unsafe trait ElementClassExt {
#[doc(alias = "get_metadata")]
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
unsafe {
let klass = self as *const _ as *const ffi::GstElementClass;
@ -844,6 +858,7 @@ pub unsafe trait ElementClassExt {
}
}
#[doc(alias = "get_pad_template")]
fn pad_template(&self, name: &str) -> Option<PadTemplate> {
unsafe {
let klass = self as *const _ as *const ffi::GstElementClass;
@ -855,6 +870,7 @@ pub unsafe trait ElementClassExt {
}
}
#[doc(alias = "get_pad_template_list")]
fn pad_template_list(&self) -> Vec<PadTemplate> {
unsafe {
let klass = self as *const _ as *const ffi::GstElementClass;

View file

@ -687,6 +687,7 @@ impl StateChange {
}
}
#[doc(alias = "get_name")]
pub fn name<'a>(self) -> &'a str {
cfg_if::cfg_if! {
if #[cfg(feature = "v1_14")] {

View file

@ -134,6 +134,7 @@ mini_object_wrapper!(Event, EventRef, ffi::GstEvent, || {
});
impl EventRef {
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> Seqnum {
unsafe {
let seqnum = ffi::gst_event_get_seqnum(self.as_mut_ptr());
@ -142,6 +143,7 @@ impl EventRef {
}
}
#[doc(alias = "get_running_time_offset")]
pub fn running_time_offset(&self) -> i64 {
unsafe { ffi::gst_event_get_running_time_offset(self.as_mut_ptr()) }
}
@ -150,6 +152,7 @@ impl EventRef {
unsafe { ffi::gst_event_set_running_time_offset(self.as_mut_ptr(), offset) }
}
#[doc(alias = "get_structure")]
pub fn structure(&self) -> Option<&StructureRef> {
unsafe {
let structure = ffi::gst_event_get_structure(self.as_mut_ptr());
@ -187,6 +190,7 @@ impl EventRef {
self.type_().is_sticky_multi()
}
#[doc(alias = "get_type")]
pub fn type_(&self) -> EventType {
unsafe { from_glib((*self.as_ptr()).type_) }
}
@ -327,6 +331,7 @@ impl<'a> FlushStop<'a> {
FlushStopBuilder::new(reset_time)
}
#[doc(alias = "get_reset_time")]
pub fn resets_time(&self) -> bool {
unsafe {
let mut reset_time = mem::MaybeUninit::uninit();
@ -351,6 +356,7 @@ impl<'a> StreamStart<'a> {
StreamStartBuilder::new(stream_id)
}
#[doc(alias = "get_stream_id")]
pub fn stream_id(&self) -> &'a str {
unsafe {
let mut stream_id = ptr::null();
@ -360,6 +366,7 @@ impl<'a> StreamStart<'a> {
}
}
#[doc(alias = "get_stream_flags")]
pub fn stream_flags(&self) -> crate::StreamFlags {
unsafe {
let mut stream_flags = mem::MaybeUninit::uninit();
@ -370,6 +377,7 @@ impl<'a> StreamStart<'a> {
}
}
#[doc(alias = "get_group_id")]
pub fn group_id(&self) -> Option<GroupId> {
unsafe {
let mut group_id = mem::MaybeUninit::uninit();
@ -387,6 +395,7 @@ impl<'a> StreamStart<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_stream")]
pub fn stream(&self) -> Option<crate::Stream> {
unsafe {
let mut stream = ptr::null_mut();
@ -409,6 +418,7 @@ impl<'a> Caps<'a> {
CapsBuilder::new(caps)
}
#[doc(alias = "get_caps")]
pub fn caps(&self) -> &'a crate::CapsRef {
unsafe {
let mut caps = ptr::null_mut();
@ -418,6 +428,7 @@ impl<'a> Caps<'a> {
}
}
#[doc(alias = "get_caps_owned")]
pub fn caps_owned(&self) -> crate::Caps {
unsafe { from_glib_none(self.caps().as_ptr()) }
}
@ -438,6 +449,7 @@ impl<'a> Segment<'a> {
SegmentBuilder::new(segment.as_ref())
}
#[doc(alias = "get_segment")]
pub fn segment(&self) -> &'a crate::Segment {
unsafe {
let mut segment = ptr::null();
@ -467,6 +479,7 @@ impl<'a> StreamCollection<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_stream_collection")]
pub fn stream_collection(&self) -> crate::StreamCollection {
unsafe {
let mut stream_collection = ptr::null_mut();
@ -490,6 +503,7 @@ impl<'a> Tag<'a> {
TagBuilder::new(tags)
}
#[doc(alias = "get_tag")]
pub fn tag(&self) -> &'a crate::TagListRef {
unsafe {
let mut tags = ptr::null_mut();
@ -499,6 +513,7 @@ impl<'a> Tag<'a> {
}
}
#[doc(alias = "get_tag_owned")]
pub fn tag_owned(&self) -> crate::TagList {
unsafe { from_glib_none(self.tag().as_ptr()) }
}
@ -561,6 +576,7 @@ impl<'a> SinkMessage<'a> {
SinkMessageBuilder::new(name, msg)
}
#[doc(alias = "get_message")]
pub fn message(&self) -> crate::Message {
unsafe {
let mut msg = ptr::null_mut();
@ -590,6 +606,7 @@ impl<'a> StreamGroupDone<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_group_id")]
pub fn group_id(&self) -> GroupId {
unsafe {
let mut group_id = mem::MaybeUninit::uninit();
@ -632,6 +649,7 @@ impl<'a> Toc<'a> {
TocBuilder::new(toc, updated)
}
#[doc(alias = "get_toc")]
pub fn toc(&self) -> (&'a crate::TocRef, bool) {
unsafe {
let mut toc = ptr::null_mut();
@ -645,6 +663,7 @@ impl<'a> Toc<'a> {
}
}
#[doc(alias = "get_toc_owned")]
pub fn toc_owned(&self) -> (crate::Toc, bool) {
unsafe {
let (toc, updated) = self.toc();
@ -883,6 +902,7 @@ impl<'a> Seek<'a> {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_trickmode_interval")]
pub fn trickmode_interval(&self) -> crate::ClockTime {
unsafe {
let mut trickmode_interval = mem::MaybeUninit::uninit();
@ -924,6 +944,7 @@ impl<'a> Latency<'a> {
LatencyBuilder::new(latency)
}
#[doc(alias = "get_latency")]
pub fn latency(&self) -> crate::ClockTime {
unsafe {
let mut latency = mem::MaybeUninit::uninit();
@ -1015,6 +1036,7 @@ impl<'a> TocSelect<'a> {
TocSelectBuilder::new(uid)
}
#[doc(alias = "get_uid")]
pub fn uid(&self) -> &'a str {
unsafe {
let mut uid = ptr::null_mut();
@ -1045,6 +1067,7 @@ impl<'a> SelectStreams<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_streams")]
pub fn streams(&self) -> Vec<String> {
unsafe {
let mut streams = ptr::null_mut();

View file

@ -47,7 +47,9 @@ impl_common_ops_for_opt_int!(Percent);
pub struct TryFromGenericFormattedValueError(());
pub trait FormattedValue: Copy + Clone + Sized + Into<GenericFormattedValue> + 'static {
#[doc(alias = "get_default_format")]
fn default_format() -> Format;
#[doc(alias = "get_format")]
fn format(&self) -> Format;
unsafe fn from_raw(format: Format, value: i64) -> Self;
@ -104,6 +106,7 @@ impl GenericFormattedValue {
}
}
#[doc(alias = "get_format")]
pub fn format(&self) -> Format {
match *self {
Self::Undefined(_) => Format::Undefined,
@ -116,6 +119,7 @@ impl GenericFormattedValue {
}
}
#[doc(alias = "get_value")]
pub fn value(&self) -> i64 {
match *self {
Self::Undefined(v) => v.0,

View file

@ -84,6 +84,7 @@ impl DebugCategory {
}
}
#[doc(alias = "get_threshold")]
pub fn threshold(self) -> crate::DebugLevel {
match self.0 {
Some(cat) => unsafe { from_glib(ffi::gst_debug_category_get_threshold(cat.as_ptr())) },
@ -103,6 +104,7 @@ impl DebugCategory {
}
}
#[doc(alias = "get_color")]
pub fn color(self) -> crate::DebugColorFlags {
match self.0 {
Some(cat) => unsafe { from_glib(ffi::gst_debug_category_get_color(cat.as_ptr())) },
@ -110,6 +112,7 @@ impl DebugCategory {
}
}
#[doc(alias = "get_name")]
pub fn name<'a>(self) -> &'a str {
match self.0 {
Some(cat) => unsafe {
@ -121,6 +124,7 @@ impl DebugCategory {
}
}
#[doc(alias = "get_description")]
pub fn description<'a>(self) -> Option<&'a str> {
match self.0 {
Some(cat) => unsafe {
@ -493,6 +497,7 @@ mod tests {
use std::sync::{Arc, Mutex};
#[test]
#[doc(alias = "get_existing")]
fn existing() {
crate::init().unwrap();

View file

@ -166,10 +166,12 @@ impl Memory {
}
impl MemoryRef {
#[doc(alias = "get_allocator")]
pub fn allocator(&self) -> Option<Allocator> {
unsafe { from_glib_none(self.0.allocator) }
}
#[doc(alias = "get_parent")]
pub fn parent(&self) -> Option<&MemoryRef> {
unsafe {
if self.0.parent.is_null() {
@ -180,22 +182,27 @@ impl MemoryRef {
}
}
#[doc(alias = "get_maxsize")]
pub fn maxsize(&self) -> usize {
self.0.maxsize
}
#[doc(alias = "get_align")]
pub fn align(&self) -> usize {
self.0.align
}
#[doc(alias = "get_offset")]
pub fn offset(&self) -> usize {
self.0.offset
}
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
self.0.size
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> MemoryFlags {
unsafe { from_glib(self.0.mini_object.flags) }
}
@ -309,10 +316,12 @@ impl MemoryRef {
}
impl<'a, T> MemoryMap<'a, T> {
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
self.map_info.size
}
#[doc(alias = "get_memory")]
pub fn memory(&self) -> &MemoryRef {
self.memory
}
@ -384,10 +393,12 @@ impl<T> MappedMemory<T> {
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) }
}
#[doc(alias = "get_size")]
pub fn size(&self) -> usize {
self.map_info.size
}
#[doc(alias = "get_memory")]
pub fn memory(&self) -> &MemoryRef {
self.memory.as_ref().unwrap().as_ref()
}

View file

@ -25,10 +25,12 @@ mini_object_wrapper!(Message, MessageRef, ffi::GstMessage, || {
});
impl MessageRef {
#[doc(alias = "get_src")]
pub fn src(&self) -> Option<Object> {
unsafe { from_glib_none((*self.as_ptr()).src) }
}
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> Seqnum {
unsafe {
let seqnum = ffi::gst_message_get_seqnum(self.as_mut_ptr());
@ -52,6 +54,7 @@ impl MessageRef {
}
}
#[doc(alias = "get_structure")]
pub fn structure(&self) -> Option<&StructureRef> {
unsafe {
let structure = ffi::gst_message_get_structure(self.as_mut_ptr());
@ -116,6 +119,7 @@ impl MessageRef {
}
}
#[doc(alias = "get_type")]
pub fn type_(&self) -> MessageType {
unsafe { from_glib((*self.as_ptr()).type_) }
}
@ -247,6 +251,7 @@ impl<'a> Error<'a> {
ErrorBuilder::new(error, message)
}
#[doc(alias = "get_error")]
pub fn error(&self) -> glib::Error {
unsafe {
let mut error = ptr::null_mut();
@ -257,6 +262,7 @@ impl<'a> Error<'a> {
}
}
#[doc(alias = "get_debug")]
pub fn debug(&self) -> Option<String> {
unsafe {
let mut debug = ptr::null_mut();
@ -269,6 +275,7 @@ impl<'a> Error<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_details")]
pub fn details(&self) -> Option<&StructureRef> {
unsafe {
let mut details = ptr::null();
@ -297,6 +304,7 @@ impl<'a> Warning<'a> {
WarningBuilder::new(error, message)
}
#[doc(alias = "get_error")]
pub fn error(&self) -> glib::Error {
unsafe {
let mut error = ptr::null_mut();
@ -307,6 +315,7 @@ impl<'a> Warning<'a> {
}
}
#[doc(alias = "get_debug")]
pub fn debug(&self) -> Option<String> {
unsafe {
let mut debug = ptr::null_mut();
@ -319,6 +328,7 @@ impl<'a> Warning<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_details")]
pub fn details(&self) -> Option<&StructureRef> {
unsafe {
let mut details = ptr::null();
@ -347,6 +357,7 @@ impl<'a> Info<'a> {
InfoBuilder::new(error, message)
}
#[doc(alias = "get_error")]
pub fn error(&self) -> glib::Error {
unsafe {
let mut error = ptr::null_mut();
@ -357,6 +368,7 @@ impl<'a> Info<'a> {
}
}
#[doc(alias = "get_debug")]
pub fn debug(&self) -> Option<String> {
unsafe {
let mut debug = ptr::null_mut();
@ -369,6 +381,7 @@ impl<'a> Info<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_details")]
pub fn details(&self) -> Option<&StructureRef> {
unsafe {
let mut details = ptr::null();
@ -397,6 +410,7 @@ impl<'a> Tag<'a> {
TagBuilder::new(tags)
}
#[doc(alias = "get_tags")]
pub fn tags(&self) -> TagList {
unsafe {
let mut tags = ptr::null_mut();
@ -419,6 +433,7 @@ impl<'a> Buffering<'a> {
BufferingBuilder::new(percent)
}
#[doc(alias = "get_percent")]
pub fn percent(&self) -> i32 {
unsafe {
let mut p = mem::MaybeUninit::uninit();
@ -427,6 +442,7 @@ impl<'a> Buffering<'a> {
}
}
#[doc(alias = "get_buffering_stats")]
pub fn buffering_stats(&self) -> (crate::BufferingMode, i32, i32, i64) {
unsafe {
let mut mode = mem::MaybeUninit::uninit();
@ -469,6 +485,7 @@ impl<'a> StateChanged<'a> {
StateChangedBuilder::new(old, new, pending)
}
#[doc(alias = "get_old")]
pub fn old(&self) -> crate::State {
unsafe {
let mut state = mem::MaybeUninit::uninit();
@ -484,6 +501,7 @@ impl<'a> StateChanged<'a> {
}
}
#[doc(alias = "get_current")]
pub fn current(&self) -> crate::State {
unsafe {
let mut state = mem::MaybeUninit::uninit();
@ -499,6 +517,7 @@ impl<'a> StateChanged<'a> {
}
}
#[doc(alias = "get_pending")]
pub fn pending(&self) -> crate::State {
unsafe {
let mut state = mem::MaybeUninit::uninit();
@ -632,6 +651,7 @@ impl<'a> ClockProvide<'a> {
ClockProvideBuilder::new(clock, ready)
}
#[doc(alias = "get_clock")]
pub fn clock(&self) -> Option<crate::Clock> {
let mut clock = ptr::null_mut();
@ -642,6 +662,7 @@ impl<'a> ClockProvide<'a> {
}
}
#[doc(alias = "get_ready")]
pub fn is_ready(&self) -> bool {
unsafe {
let mut ready = mem::MaybeUninit::uninit();
@ -670,6 +691,7 @@ impl<'a> ClockLost<'a> {
ClockLostBuilder::new(clock)
}
#[doc(alias = "get_clock")]
pub fn clock(&self) -> Option<crate::Clock> {
let mut clock = ptr::null_mut();
@ -694,6 +716,7 @@ impl<'a> NewClock<'a> {
NewClockBuilder::new(clock)
}
#[doc(alias = "get_clock")]
pub fn clock(&self) -> Option<crate::Clock> {
let mut clock = ptr::null_mut();
@ -768,6 +791,7 @@ impl<'a> StreamStatus<'a> {
}
}
#[doc(alias = "get_stream_status_object")]
pub fn stream_status_object(&self) -> Option<glib::Value> {
unsafe {
let value = ffi::gst_message_get_stream_status_object(self.as_mut_ptr());
@ -920,6 +944,7 @@ impl<'a> AsyncDone<'a> {
AsyncDoneBuilder::new(running_time)
}
#[doc(alias = "get_running_time")]
pub fn running_time(&self) -> crate::ClockTime {
unsafe {
let mut running_time = mem::MaybeUninit::uninit();
@ -944,6 +969,7 @@ impl<'a> RequestState<'a> {
RequestStateBuilder::new(state)
}
#[doc(alias = "get_requested_state")]
pub fn requested_state(&self) -> crate::State {
unsafe {
let mut state = mem::MaybeUninit::uninit();
@ -1073,6 +1099,7 @@ impl<'a> Qos<'a> {
}
}
#[doc(alias = "get_values")]
pub fn values(&self) -> (i64, f64, i32) {
unsafe {
let mut jitter = mem::MaybeUninit::uninit();
@ -1094,6 +1121,7 @@ impl<'a> Qos<'a> {
}
}
#[doc(alias = "get_stats")]
pub fn stats(&self) -> (GenericFormattedValue, GenericFormattedValue) {
unsafe {
let mut format = mem::MaybeUninit::uninit();
@ -1174,6 +1202,7 @@ impl<'a> Toc<'a> {
TocBuilder::new(toc, updated)
}
#[doc(alias = "get_toc")]
pub fn toc(&self) -> (crate::Toc, bool) {
unsafe {
let mut toc = ptr::null_mut();
@ -1197,6 +1226,7 @@ impl<'a> ResetTime<'a> {
ResetTimeBuilder::new(running_time)
}
#[doc(alias = "get_running_time")]
pub fn running_time(&self) -> crate::ClockTime {
unsafe {
let mut running_time = mem::MaybeUninit::uninit();
@ -1221,6 +1251,7 @@ impl<'a> StreamStart<'a> {
StreamStartBuilder::new()
}
#[doc(alias = "get_group_id")]
pub fn group_id(&self) -> Option<GroupId> {
unsafe {
let mut group_id = mem::MaybeUninit::uninit();
@ -1255,6 +1286,7 @@ impl<'a> NeedContext<'a> {
NeedContextBuilder::new(context_type)
}
#[doc(alias = "get_context_type")]
pub fn context_type(&self) -> &str {
unsafe {
let mut context_type = ptr::null();
@ -1279,6 +1311,7 @@ impl<'a> HaveContext<'a> {
HaveContextBuilder::new(context)
}
#[doc(alias = "get_context")]
pub fn context(&self) -> crate::Context {
unsafe {
let mut context = ptr::null_mut();
@ -1301,6 +1334,7 @@ impl<'a> DeviceAdded<'a> {
DeviceAddedBuilder::new(device)
}
#[doc(alias = "get_device")]
pub fn device(&self) -> crate::Device {
unsafe {
let mut device = ptr::null_mut();
@ -1325,6 +1359,7 @@ impl<'a> DeviceRemoved<'a> {
DeviceRemovedBuilder::new(device)
}
#[doc(alias = "get_device")]
pub fn device(&self) -> crate::Device {
unsafe {
let mut device = ptr::null_mut();
@ -1400,6 +1435,7 @@ impl<'a> StreamCollection<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_stream_collection")]
pub fn stream_collection(&self) -> crate::StreamCollection {
unsafe {
let mut collection = ptr::null_mut();
@ -1430,6 +1466,7 @@ impl<'a> StreamsSelected<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_stream_collection")]
pub fn stream_collection(&self) -> crate::StreamCollection {
unsafe {
let mut collection = ptr::null_mut();
@ -1442,6 +1479,7 @@ impl<'a> StreamsSelected<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_streams")]
pub fn streams(&self) -> Vec<crate::Stream> {
unsafe {
let n = ffi::gst_message_streams_selected_get_size(self.as_mut_ptr());
@ -1477,6 +1515,7 @@ impl<'a> Redirect<'a> {
#[cfg(any(feature = "v1_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
#[doc(alias = "get_entries")]
pub fn entries(&self) -> Vec<(&str, Option<TagList>, Option<&StructureRef>)> {
unsafe {
let n = ffi::gst_message_get_num_redirect_entries(self.as_mut_ptr());
@ -1534,6 +1573,7 @@ impl<'a> DeviceChanged<'a> {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_device_changed")]
pub fn device_changed(&self) -> (crate::Device, crate::Device) {
unsafe {
let mut device = ptr::null_mut();

View file

@ -24,6 +24,7 @@ use glib::translate::{from_glib, from_glib_none, FromGlib, ToGlibPtr};
pub unsafe trait MetaAPI: Sync + Send + Sized {
type GstType;
#[doc(alias = "get_meta_api")]
fn meta_api() -> glib::Type;
unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef<Self> {
@ -138,6 +139,7 @@ impl<'a, T: MetaAPI, U> AsRef<MetaRef<'a, T>> for MetaRefMut<'a, T, U> {
}
impl<'a, T: MetaAPI> MetaRef<'a, T> {
#[doc(alias = "get_api")]
pub fn api(&self) -> glib::Type {
unsafe {
let meta = self.meta as *const _ as *const ffi::GstMeta;
@ -148,6 +150,7 @@ impl<'a, T: MetaAPI> MetaRef<'a, T> {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> MetaSeqnum {
unsafe {
let meta = self.meta as *const _ as *const ffi::GstMeta;
@ -174,6 +177,7 @@ impl<'a> MetaRef<'a, Meta> {
}
impl<'a, T: MetaAPI, U> MetaRefMut<'a, T, U> {
#[doc(alias = "get_api")]
pub fn api(&self) -> glib::Type {
unsafe {
let meta = self.meta as *const _ as *const ffi::GstMeta;
@ -184,6 +188,7 @@ impl<'a, T: MetaAPI, U> MetaRefMut<'a, T, U> {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_seqnum")]
pub fn seqnum(&self) -> u64 {
unsafe {
let meta = self.meta as *const _ as *const ffi::GstMeta;
@ -232,6 +237,7 @@ unsafe impl Send for Meta {}
unsafe impl Sync for Meta {}
impl Meta {
#[doc(alias = "get_api")]
fn api(&self) -> glib::Type {
unsafe { glib::Type::from_glib((*self.0.info).api) }
}
@ -270,10 +276,12 @@ impl ParentBufferMeta {
}
}
#[doc(alias = "get_parent")]
pub fn parent(&self) -> &BufferRef {
unsafe { BufferRef::from_ptr(self.0.buffer) }
}
#[doc(alias = "get_parent_owned")]
pub fn parent_owned(&self) -> Buffer {
unsafe { from_glib_none(self.0.buffer) }
}
@ -311,10 +319,12 @@ impl ProtectionMeta {
}
}
#[doc(alias = "get_info")]
pub fn info(&self) -> &crate::StructureRef {
unsafe { crate::StructureRef::from_glib_borrow(self.0.info) }
}
#[doc(alias = "get_info_mut")]
pub fn info_mut(&mut self) -> &mut crate::StructureRef {
unsafe { crate::StructureRef::from_glib_borrow_mut(self.0.info) }
}
@ -370,18 +380,22 @@ impl ReferenceTimestampMeta {
}
}
#[doc(alias = "get_reference")]
pub fn reference(&self) -> &CapsRef {
unsafe { CapsRef::from_ptr(self.0.reference) }
}
#[doc(alias = "get_parent_owned")]
pub fn parent_owned(&self) -> Caps {
unsafe { from_glib_none(self.0.reference) }
}
#[doc(alias = "get_timestamp")]
pub fn timestamp(&self) -> ClockTime {
unsafe { from_glib(self.0.timestamp) }
}
#[doc(alias = "get_duration")]
pub fn duration(&self) -> ClockTime {
unsafe { from_glib(self.0.duration) }
}

View file

@ -18,8 +18,10 @@ pub trait GstObjectExtManual: 'static {
fn unset_object_flags(&self, flags: ObjectFlags);
#[doc(alias = "get_object_flags")]
fn object_flags(&self) -> ObjectFlags;
#[doc(alias = "get_g_value_array")]
fn g_value_array(
&self,
property_name: &str,

View file

@ -113,7 +113,9 @@ pub trait PadExtManual: 'static {
buffer: &mut crate::BufferRef,
size: u32,
) -> Result<(), FlowError>;
#[doc(alias = "get_range")]
fn range(&self, offset: u64, size: u32) -> Result<Buffer, FlowError>;
#[doc(alias = "get_range_fill")]
fn range_fill(
&self,
offset: u64,
@ -135,6 +137,7 @@ pub trait PadExtManual: 'static {
fn push_event(&self, event: Event) -> bool;
fn send_event(&self, event: Event) -> bool;
#[doc(alias = "get_last_flow_result")]
fn last_flow_result(&self) -> Result<FlowSuccess, FlowError>;
fn iterate_internal_links(&self) -> crate::Iterator<Pad>;
@ -258,6 +261,7 @@ pub trait PadExtManual: 'static {
fn query_position<T: SpecificFormattedValue>(&self) -> Option<T>;
fn query_position_generic(&self, format: Format) -> Option<GenericFormattedValue>;
#[doc(alias = "get_mode")]
fn mode(&self) -> crate::PadMode;
fn sticky_events_foreach<F: FnMut(Event) -> Result<Option<Event>, Option<Event>>>(
@ -271,6 +275,7 @@ pub trait PadExtManual: 'static {
fn unset_pad_flags(&self, flags: PadFlags);
#[doc(alias = "get_pad_flags")]
fn pad_flags(&self) -> PadFlags;
}

View file

@ -29,6 +29,7 @@ impl ParseContext {
unsafe { from_glib_full(ffi::gst_parse_context_new()) }
}
#[doc(alias = "get_missing_elements")]
pub fn missing_elements(&self) -> Vec<String> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_parse_context_get_missing_elements(

View file

@ -10,6 +10,7 @@ pub trait GstPipelineExtManual: 'static {
fn unset_pipeline_flags(&self, flags: PipelineFlags);
#[doc(alias = "get_pipeline_flags")]
fn pipeline_flags(&self) -> PipelineFlags;
}

View file

@ -9,6 +9,7 @@ use glib::prelude::*;
use glib::translate::*;
impl Plugin {
#[doc(alias = "get_cache_data")]
pub fn cache_data(&self) -> Option<&StructureRef> {
unsafe {
let cache_data = ffi::gst_plugin_get_cache_data(self.to_glib_none().0);
@ -28,8 +29,10 @@ impl Plugin {
}
pub trait GstPluginExtManual: 'static {
#[doc(alias = "get_plugin_flags")]
fn plugin_flags(&self) -> PluginFlags;
#[doc(alias = "get_plugin_name")]
fn plugin_name(&self) -> glib::GString;
}

View file

@ -7,6 +7,7 @@ use glib::prelude::*;
use glib::translate::{from_glib, FromGlibPtrFull, IntoGlib, ToGlibPtr};
pub trait PluginFeatureExtManual: Sized + 'static {
#[doc(alias = "get_rank")]
fn rank(&self) -> Rank;
fn set_rank(&self, rank: Rank);
fn load(&self) -> Result<Self, glib::BoolError>;

View file

@ -16,6 +16,7 @@ mini_object_wrapper!(Query, QueryRef, ffi::GstQuery, || {
});
impl QueryRef {
#[doc(alias = "get_structure")]
pub fn structure(&self) -> Option<&StructureRef> {
unsafe {
let structure = ffi::gst_query_get_structure(self.as_mut_ptr());
@ -27,6 +28,7 @@ impl QueryRef {
}
}
#[doc(alias = "get_mut_structure")]
pub fn structure_mut(&mut self) -> &mut StructureRef {
unsafe {
let structure = ffi::gst_query_writable_structure(self.as_mut_ptr());
@ -223,6 +225,7 @@ impl Position<Query> {
}
impl<T: AsPtr> Position<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> GenericFormattedValue {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -234,6 +237,7 @@ impl<T: AsPtr> Position<T> {
}
}
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::Format {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -264,6 +268,7 @@ impl Duration<Query> {
}
impl<T: AsPtr> Duration<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> GenericFormattedValue {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -275,6 +280,7 @@ impl<T: AsPtr> Duration<T> {
}
}
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::Format {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -311,6 +317,7 @@ impl Default for Latency<Query> {
}
impl<T: AsPtr> Latency<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> (bool, crate::ClockTime, crate::ClockTime) {
unsafe {
let mut live = mem::MaybeUninit::uninit();
@ -355,6 +362,7 @@ impl Seeking<Query> {
}
impl<T: AsPtr> Seeking<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> (bool, GenericFormattedValue, GenericFormattedValue) {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -377,6 +385,7 @@ impl<T: AsPtr> Seeking<T> {
}
}
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::Format {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -422,6 +431,7 @@ impl Segment<Query> {
}
impl<T: AsPtr> Segment<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> (f64, GenericFormattedValue, GenericFormattedValue) {
unsafe {
let mut rate = mem::MaybeUninit::uninit();
@ -444,6 +454,7 @@ impl<T: AsPtr> Segment<T> {
}
}
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::Format {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -495,6 +506,7 @@ impl Convert<Query> {
}
impl<T: AsPtr> Convert<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> (GenericFormattedValue, GenericFormattedValue) {
unsafe {
let mut src_fmt = mem::MaybeUninit::uninit();
@ -569,6 +581,7 @@ impl Default for Formats<Query> {
}
impl<T: AsPtr> Formats<T> {
#[doc(alias = "get_result")]
pub fn result(&self) -> Vec<crate::Format> {
unsafe {
let mut n = mem::MaybeUninit::uninit();
@ -609,6 +622,7 @@ impl Buffering<Query> {
}
impl<T: AsPtr> Buffering<T> {
#[doc(alias = "get_format")]
pub fn format(&self) -> crate::Format {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -625,6 +639,7 @@ impl<T: AsPtr> Buffering<T> {
}
}
#[doc(alias = "get_percent")]
pub fn percent(&self) -> (bool, i32) {
unsafe {
let mut busy = mem::MaybeUninit::uninit();
@ -640,6 +655,7 @@ impl<T: AsPtr> Buffering<T> {
}
}
#[doc(alias = "get_range")]
pub fn range(&self) -> (GenericFormattedValue, GenericFormattedValue, i64) {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -662,6 +678,7 @@ impl<T: AsPtr> Buffering<T> {
}
}
#[doc(alias = "get_stats")]
pub fn stats(&self) -> (crate::BufferingMode, i32, i32, i64) {
unsafe {
let mut mode = mem::MaybeUninit::uninit();
@ -686,6 +703,7 @@ impl<T: AsPtr> Buffering<T> {
}
}
#[doc(alias = "get_ranges")]
pub fn ranges(&self) -> Vec<(GenericFormattedValue, GenericFormattedValue)> {
unsafe {
let mut fmt = mem::MaybeUninit::uninit();
@ -821,6 +839,7 @@ impl Default for Uri<Query> {
}
impl<T: AsPtr> Uri<T> {
#[doc(alias = "get_uri")]
pub fn uri(&self) -> Option<String> {
unsafe {
let mut uri = ptr::null_mut();
@ -829,6 +848,7 @@ impl<T: AsPtr> Uri<T> {
}
}
#[doc(alias = "get_redirection")]
pub fn redirection(&self) -> (Option<String>, bool) {
unsafe {
let mut uri = ptr::null_mut();
@ -895,6 +915,7 @@ impl<T: AsPtr> Allocation<T> {
}
}
#[doc(alias = "get_allocation_pools")]
pub fn allocation_pools(&self) -> Vec<(Option<crate::BufferPool>, u32, u32, u32)> {
unsafe {
let n = ffi::gst_query_get_n_allocation_pools(self.0.as_ptr());
@ -925,6 +946,7 @@ impl<T: AsPtr> Allocation<T> {
}
}
#[doc(alias = "get_allocation_metas")]
pub fn allocation_metas(&self) -> Vec<(glib::Type, Option<&crate::StructureRef>)> {
unsafe {
let n = ffi::gst_query_get_n_allocation_metas(self.0.as_ptr());
@ -1073,6 +1095,7 @@ impl<T: AsPtr> Scheduling<T> {
}
}
#[doc(alias = "get_scheduling_modes")]
pub fn scheduling_modes(&self) -> Vec<crate::PadMode> {
unsafe {
let n = ffi::gst_query_get_n_scheduling_modes(self.0.as_ptr());
@ -1088,6 +1111,7 @@ impl<T: AsPtr> Scheduling<T> {
}
}
#[doc(alias = "get_result")]
pub fn result(&self) -> (crate::SchedulingFlags, i32, i32, i32) {
unsafe {
let mut flags = mem::MaybeUninit::uninit();
@ -1148,6 +1172,7 @@ impl AcceptCaps<Query> {
}
impl<T: AsPtr> AcceptCaps<T> {
#[doc(alias = "get_caps")]
pub fn caps(&self) -> &crate::CapsRef {
unsafe {
let mut caps = ptr::null_mut();
@ -1156,10 +1181,12 @@ impl<T: AsPtr> AcceptCaps<T> {
}
}
#[doc(alias = "get_caps_owned")]
pub fn caps_owned(&self) -> crate::Caps {
unsafe { from_glib_none(self.caps().as_ptr()) }
}
#[doc(alias = "get_result")]
pub fn result(&self) -> bool {
unsafe {
let mut accepted = mem::MaybeUninit::uninit();
@ -1190,6 +1217,7 @@ impl Caps<Query> {
}
impl<T: AsPtr> Caps<T> {
#[doc(alias = "get_filter")]
pub fn filter(&self) -> Option<&crate::CapsRef> {
unsafe {
let mut caps = ptr::null_mut();
@ -1202,10 +1230,12 @@ impl<T: AsPtr> Caps<T> {
}
}
#[doc(alias = "get_filter_owned")]
pub fn filter_owned(&self) -> Option<crate::Caps> {
unsafe { self.filter().map(|caps| from_glib_none(caps.as_ptr())) }
}
#[doc(alias = "get_result")]
pub fn result(&self) -> Option<&crate::CapsRef> {
unsafe {
let mut caps = ptr::null_mut();
@ -1218,6 +1248,7 @@ impl<T: AsPtr> Caps<T> {
}
}
#[doc(alias = "get_result_owned")]
pub fn result_owned(&self) -> Option<crate::Caps> {
unsafe { self.result().map(|caps| from_glib_none(caps.as_ptr())) }
}
@ -1258,6 +1289,7 @@ impl Context<Query> {
}
impl<T: AsPtr> Context<T> {
#[doc(alias = "get_context")]
pub fn context(&self) -> Option<&crate::ContextRef> {
unsafe {
let mut context = ptr::null_mut();
@ -1270,6 +1302,7 @@ impl<T: AsPtr> Context<T> {
}
}
#[doc(alias = "get_context_owned")]
pub fn context_owned(&self) -> Option<crate::Context> {
unsafe {
self.context()
@ -1277,6 +1310,7 @@ impl<T: AsPtr> Context<T> {
}
}
#[doc(alias = "get_context_type")]
pub fn context_type(&self) -> &str {
unsafe {
let mut context_type = ptr::null();
@ -1316,6 +1350,7 @@ impl Default for Bitrate<Query> {
impl<T: AsPtr> Bitrate<T> {
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
#[doc(alias = "get_bitrate")]
pub fn bitrate(&self) -> u32 {
unsafe {
let mut bitrate = mem::MaybeUninit::uninit();

View file

@ -106,6 +106,7 @@ impl Sample {
}
impl SampleRef {
#[doc(alias = "get_buffer")]
pub fn buffer(&self) -> Option<&BufferRef> {
unsafe {
let ptr = ffi::gst_sample_get_buffer(self.as_mut_ptr());
@ -117,10 +118,12 @@ impl SampleRef {
}
}
#[doc(alias = "get_buffer_owned")]
pub fn buffer_owned(&self) -> Option<Buffer> {
unsafe { self.buffer().map(|buffer| from_glib_none(buffer.as_ptr())) }
}
#[doc(alias = "get_buffer_list")]
pub fn buffer_list(&self) -> Option<&BufferListRef> {
unsafe {
let ptr = ffi::gst_sample_get_buffer_list(self.as_mut_ptr());
@ -132,10 +135,12 @@ impl SampleRef {
}
}
#[doc(alias = "get_buffer_list_owned")]
pub fn buffer_list_owned(&self) -> Option<BufferList> {
unsafe { self.buffer_list().map(|list| from_glib_none(list.as_ptr())) }
}
#[doc(alias = "get_caps")]
pub fn caps(&self) -> Option<&CapsRef> {
unsafe {
let ptr = ffi::gst_sample_get_caps(self.as_mut_ptr());
@ -147,14 +152,17 @@ impl SampleRef {
}
}
#[doc(alias = "get_caps_owned")]
pub fn caps_owned(&self) -> Option<Caps> {
unsafe { self.caps().map(|caps| from_glib_none(caps.as_ptr())) }
}
#[doc(alias = "get_segment")]
pub fn segment(&self) -> Option<Segment> {
unsafe { from_glib_none(ffi::gst_sample_get_segment(self.as_mut_ptr())) }
}
#[doc(alias = "get_info")]
pub fn info(&self) -> Option<&StructureRef> {
unsafe {
let ptr = ffi::gst_sample_get_info(self.as_mut_ptr());

View file

@ -352,6 +352,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
}
}
#[doc(alias = "get_flags")]
pub fn flags(&self) -> crate::SegmentFlags {
unsafe { from_glib(self.0.flags) }
}
@ -360,6 +361,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.flags = flags.into_glib();
}
#[doc(alias = "get_rate")]
pub fn rate(&self) -> f64 {
self.0.rate
}
@ -370,6 +372,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.rate = rate;
}
#[doc(alias = "get_applied_rate")]
pub fn applied_rate(&self) -> f64 {
self.0.applied_rate
}
@ -380,10 +383,12 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.applied_rate = applied_rate;
}
#[doc(alias = "get_format")]
pub fn format(&self) -> Format {
unsafe { from_glib(self.0.format) }
}
#[doc(alias = "get_base")]
pub fn base(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.base as i64) }
}
@ -398,6 +403,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.base = unsafe { base.to_raw_value() } as u64;
}
#[doc(alias = "get_offset")]
pub fn offset(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.offset as i64) }
}
@ -412,6 +418,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.offset = unsafe { offset.to_raw_value() } as u64;
}
#[doc(alias = "get_start")]
pub fn start(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.start as i64) }
}
@ -426,6 +433,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.start = unsafe { start.to_raw_value() } as u64;
}
#[doc(alias = "get_stop")]
pub fn stop(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.stop as i64) }
}
@ -440,6 +448,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.stop = unsafe { stop.to_raw_value() } as u64;
}
#[doc(alias = "get_time")]
pub fn time(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.time as i64) }
}
@ -454,6 +463,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.time = unsafe { time.to_raw_value() } as u64;
}
#[doc(alias = "get_position")]
pub fn position(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.position as i64) }
}
@ -468,6 +478,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.position = unsafe { position.to_raw_value() } as u64;
}
#[doc(alias = "get_duration")]
pub fn duration(&self) -> T {
unsafe { T::from_raw(self.format(), self.0.duration as i64) }
}

View file

@ -17,6 +17,7 @@ impl StaticPadTemplate {
unsafe { from_glib_full(ffi::gst_static_pad_template_get(self.0.as_ptr())) }
}
#[doc(alias = "get_caps")]
pub fn caps(&self) -> Caps {
unsafe { from_glib_full(ffi::gst_static_pad_template_get_caps(self.0.as_ptr())) }
}

View file

@ -394,6 +394,7 @@ impl StructureRef {
self.get_optional_by_quark(name)
}
#[doc(alias = "get_value")]
pub fn value(&self, name: &str) -> Result<&SendValue, GetError> {
let name = glib::Quark::from_string(name);
self.value_by_quark(name)
@ -458,6 +459,7 @@ impl StructureRef {
}
}
#[doc(alias = "get_name")]
pub fn name<'a>(&self) -> &'a str {
unsafe {
CStr::from_ptr(ffi::gst_structure_get_name(&self.0))
@ -533,6 +535,7 @@ impl StructureRef {
Iter::new(self)
}
#[doc(alias = "get_nth_field_name")]
pub fn nth_field_name<'a>(&self, idx: u32) -> Option<&'a str> {
unsafe {
let field_name = ffi::gst_structure_nth_field_name(&self.0, idx);

View file

@ -433,6 +433,7 @@ impl TagListRef {
})
}
#[doc(alias = "get_generic")]
pub fn generic(&self, tag_name: &str) -> Option<SendValue> {
unsafe {
let mut value: mem::MaybeUninit<SendValue> = mem::MaybeUninit::zeroed();
@ -463,6 +464,7 @@ impl TagListRef {
}
}
#[doc(alias = "get_index")]
pub fn index<'a, T: Tag<'a>>(&self, idx: u32) -> Option<&'a TagValue<T::TagType>> {
self.index_generic(T::tag_name(), idx).map(|value| {
if !value.is::<T::TagType>() {
@ -476,6 +478,7 @@ impl TagListRef {
})
}
#[doc(alias = "get_index_generic")]
pub fn index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> {
unsafe {
let value =
@ -489,10 +492,12 @@ impl TagListRef {
}
}
#[doc(alias = "get_size")]
pub fn size<'a, T: Tag<'a>>(&self) -> u32 {
self.size_by_name(T::tag_name())
}
#[doc(alias = "get_size_by_name")]
pub fn size_by_name(&self, tag_name: &str) -> u32 {
unsafe { ffi::gst_tag_list_get_tag_size(self.as_ptr(), tag_name.to_glib_none().0) }
}
@ -527,6 +532,7 @@ impl TagListRef {
}
}
#[doc(alias = "get_scope")]
pub fn scope(&self) -> TagScope {
unsafe { from_glib(ffi::gst_tag_list_get_scope(self.as_ptr())) }
}

View file

@ -24,6 +24,7 @@ impl Toc {
}
impl TocRef {
#[doc(alias = "get_scope")]
pub fn scope(&self) -> TocScope {
unsafe { from_glib(ffi::gst_toc_get_scope(self.as_ptr())) }
}
@ -32,6 +33,7 @@ impl TocRef {
unsafe { from_glib_none(ffi::gst_toc_find_entry(self.as_ptr(), uid.to_glib_none().0)) }
}
#[doc(alias = "get_entries")]
pub fn entries(&self) -> Vec<TocEntry> {
unsafe { FromGlibPtrContainer::from_glib_none(ffi::gst_toc_get_entries(self.as_ptr())) }
}
@ -42,6 +44,7 @@ impl TocRef {
}
}
#[doc(alias = "get_tags")]
pub fn tags(&self) -> Option<TagList> {
unsafe { from_glib_none(ffi::gst_toc_get_tags(self.as_ptr())) }
}
@ -98,10 +101,12 @@ impl TocEntry {
}
impl TocEntryRef {
#[doc(alias = "get_entry_type")]
pub fn entry_type(&self) -> TocEntryType {
unsafe { from_glib(ffi::gst_toc_entry_get_entry_type(self.as_ptr())) }
}
#[doc(alias = "get_uid")]
pub fn uid(&self) -> &str {
unsafe {
CStr::from_ptr(ffi::gst_toc_entry_get_uid(self.as_ptr()))
@ -116,16 +121,19 @@ impl TocEntryRef {
}
}
#[doc(alias = "get_sub_entries")]
pub fn sub_entries(&self) -> Vec<TocEntry> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_toc_entry_get_sub_entries(self.as_ptr()))
}
}
#[doc(alias = "get_parent")]
pub fn parent(&self) -> Option<TocEntry> {
unsafe { from_glib_none(ffi::gst_toc_entry_get_parent(self.as_mut_ptr())) }
}
#[doc(alias = "get_start_stop_times")]
pub fn start_stop_times(&self) -> Option<(i64, i64)> {
unsafe {
let mut start = mem::MaybeUninit::uninit();
@ -149,6 +157,7 @@ impl TocEntryRef {
}
}
#[doc(alias = "get_tags")]
pub fn tags(&self) -> Option<TagList> {
unsafe { from_glib_none(ffi::gst_toc_entry_get_tags(self.as_ptr())) }
}
@ -177,6 +186,7 @@ impl TocEntryRef {
unsafe { from_glib(ffi::gst_toc_entry_is_sequence(self.as_ptr())) }
}
#[doc(alias = "get_loop")]
pub fn loop_(&self) -> Option<(TocLoopType, i32)> {
unsafe {
let mut loop_type = mem::MaybeUninit::uninit();

View file

@ -17,6 +17,7 @@ pub struct TypeFind(ffi::GstTypeFind);
pub trait TypeFindImpl {
fn peek(&mut self, offset: i64, size: u32) -> Option<&[u8]>;
fn suggest(&mut self, probability: TypeFindProbability, caps: &Caps);
#[doc(alias = "get_length")]
fn length(&self) -> Option<u64> {
None
}
@ -75,6 +76,7 @@ impl TypeFind {
}
}
#[doc(alias = "get_length")]
pub fn length(&mut self) -> Option<u64> {
unsafe {
let len = ffi::gst_type_find_get_length(&mut self.0);

View file

@ -20,6 +20,7 @@ mod runloop {
}
}
#[doc(alias = "get_main")]
pub fn main() -> CFRunLoop {
unsafe {
let r = CFRunLoopGetMain();