fix-getters-def 0.3.0 pass

This commit is contained in:
François Laignel 2021-04-20 12:23:24 +02:00
parent b8b944b72b
commit e80a29372a
43 changed files with 128 additions and 128 deletions

View file

@ -54,7 +54,7 @@ mod custom_meta {
unsafe impl MetaAPI for CustomMeta {
type GstType = imp::CustomMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
imp::custom_meta_api_get_type()
}
}

View file

@ -44,7 +44,7 @@ fn make_element(
}
}
fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.get_static_pad(pad_name) {
Some(pad) => Ok(pad),
None => {
@ -54,7 +54,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst:
}
}
fn get_request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.get_request_pad(pad_name) {
Some(pad) => Ok(pad),
None => {

View file

@ -40,7 +40,7 @@ fn make_element(
}
}
fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
fn static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.get_static_pad(pad_name) {
Some(pad) => Ok(pad),
None => {
@ -50,7 +50,7 @@ fn get_static_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst:
}
}
fn get_request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
fn request_pad(element: &gst::Element, pad_name: &'static str) -> Result<gst::Pad, Error> {
match element.get_request_pad(pad_name) {
Some(pad) => Ok(pad),
None => {

View file

@ -140,7 +140,7 @@ mod fir_filter {
// Returns the size of one processing unit (i.e. a frame in our case) corresponding
// to the given caps. This is used for allocating a big enough output buffer and
// sanity checking the input buffer size, among other things.
fn get_unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option<usize> {
fn unit_size(&self, _element: &Self::Type, caps: &gst::Caps) -> Option<usize> {
let audio_info = gst_audio::AudioInfo::from_caps(caps).ok();
audio_info.map(|info| info.bpf() as usize)
}

View file

@ -20,7 +20,7 @@ mod runloop {
}
}
pub fn get_main() -> CFRunLoop {
pub fn main() -> CFRunLoop {
unsafe {
let r = CFRunLoopGetMain();
assert!(!r.is_null());

View file

@ -123,7 +123,7 @@ impl AudioChannelPosition {
}
}
pub fn get_fallback_mask(channels: u32) -> u64 {
pub fn fallback_mask(channels: u32) -> u64 {
assert_initialized_main_thread!();
unsafe { ffi::gst_audio_channel_get_fallback_mask(channels as i32) }
@ -257,7 +257,7 @@ pub fn reorder_channels(
}
}
pub fn get_channel_reorder_map(
pub fn channel_reorder_map(
from: &[AudioChannelPosition],
to: &[AudioChannelPosition],
reorder_map: &mut [usize],

View file

@ -54,7 +54,7 @@ impl AudioClippingMeta {
unsafe impl MetaAPI for AudioClippingMeta {
type GstType = ffi::GstAudioClippingMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_audio_clipping_meta_api_get_type()) }
}
}
@ -191,7 +191,7 @@ impl AudioMeta {
unsafe impl MetaAPI for AudioMeta {
type GstType = ffi::GstAudioMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_audio_meta_api_get_type()) }
}
}

View file

@ -60,7 +60,7 @@ impl Adapter {
}
}
pub fn get_buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
pub fn buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -70,7 +70,7 @@ impl Adapter {
}
}
pub fn get_buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
pub fn buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -83,7 +83,7 @@ impl Adapter {
}
}
pub fn get_buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
pub fn buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -96,7 +96,7 @@ impl Adapter {
}
}
pub fn get_list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
pub fn list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
assert!(nbytes <= self.available());
assert!(nbytes != 0);
@ -292,19 +292,19 @@ impl UniqueAdapter {
self.0.flush(flush);
}
pub fn get_buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
pub fn buffer(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
self.0.get_buffer(nbytes)
}
pub fn get_buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
pub fn buffer_fast(&self, nbytes: usize) -> Result<gst::Buffer, glib::BoolError> {
self.0.get_buffer_fast(nbytes)
}
pub fn get_buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
pub fn buffer_list(&self, nbytes: usize) -> Result<gst::BufferList, glib::BoolError> {
self.0.get_buffer_list(nbytes)
}
pub fn get_list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
pub fn list(&self, nbytes: usize) -> Result<Vec<gst::Buffer>, glib::BoolError> {
self.0.get_list(nbytes)
}

View file

@ -35,7 +35,7 @@ pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl {
self.parent_size(element)
}
fn get_times(
fn times(
&self,
element: &Self::Type,
buffer: &gst::BufferRef,

View file

@ -6,7 +6,7 @@ use glib::translate::*;
use std::ptr;
pub trait TimelineElementExtManual: 'static {
fn get_child_property(&self, name: &str) -> Option<glib::Value>;
fn child_property(&self, name: &str) -> Option<glib::Value>;
fn set_child_property(
&self,
name: &str,
@ -15,7 +15,7 @@ pub trait TimelineElementExtManual: 'static {
}
impl<O: IsA<TimelineElement>> TimelineElementExtManual for O {
fn get_child_property(&self, name: &str) -> Option<glib::Value> {
fn child_property(&self, name: &str) -> Option<glib::Value> {
unsafe {
let found: bool = from_glib(ffi::ges_timeline_element_lookup_child(
self.as_ref().to_glib_none().0,

View file

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

View file

@ -23,12 +23,12 @@ impl GLContext {
))
}
pub fn get_current_gl_context(context_type: GLPlatform) -> uintptr_t {
pub fn current_gl_context(context_type: GLPlatform) -> uintptr_t {
skip_assert_initialized!();
unsafe { ffi::gst_gl_context_get_current_gl_context(context_type.to_glib()) as uintptr_t }
}
pub fn get_proc_address_with_platform(
pub fn proc_address_with_platform(
context_type: GLPlatform,
gl_api: GLAPI,
name: &str,
@ -47,7 +47,7 @@ impl GLContext {
pub trait GLContextExtManual: 'static {
fn gl_context(&self) -> uintptr_t;
fn get_proc_address(&self, name: &str) -> uintptr_t;
fn proc_address(&self, name: &str) -> uintptr_t;
}
impl<O: IsA<GLContext>> GLContextExtManual for O {
@ -55,7 +55,7 @@ impl<O: IsA<GLContext>> GLContextExtManual for O {
unsafe { ffi::gst_gl_context_get_gl_context(self.as_ref().to_glib_none().0) as uintptr_t }
}
fn get_proc_address(&self, name: &str) -> uintptr_t {
fn proc_address(&self, name: &str) -> uintptr_t {
unsafe {
ffi::gst_gl_context_get_proc_address(
self.as_ref().to_glib_none().0,

View file

@ -63,7 +63,7 @@ impl GLSyncMeta {
unsafe impl MetaAPI for GLSyncMeta {
type GstType = ffi::GstGLSyncMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_gl_sync_meta_api_get_type()) }
}
}

View file

@ -17,7 +17,7 @@ pub trait VideoFrameGLExt {
info: &'b gst_video::VideoInfo,
) -> Result<gst_video::VideoFrameRef<&'a gst::BufferRef>, glib::error::BoolError>;
fn get_texture_id(&self, idx: u32) -> Option<u32>;
fn texture_id(&self, idx: u32) -> Option<u32>;
}
impl VideoFrameGLExt for gst_video::VideoFrame<Readable> {
@ -37,7 +37,7 @@ impl VideoFrameGLExt for gst_video::VideoFrame<Readable> {
gst_video::VideoFrameRef::<&gst::BufferRef>::from_buffer_ref_readable_gl(buffer, info)
}
fn get_texture_id(&self, idx: u32) -> Option<u32> {
fn texture_id(&self, idx: u32) -> Option<u32> {
self.as_video_frame_ref().get_texture_id(idx)
}
}
@ -123,7 +123,7 @@ impl<'a> VideoFrameGLExt for gst_video::VideoFrameRef<&'a gst::BufferRef> {
}
}
fn get_texture_id(&self, idx: u32) -> Option<u32> {
fn texture_id(&self, idx: u32) -> Option<u32> {
let len = buffer_n_gl_memory(self.buffer())?;
if idx >= len {

View file

@ -42,7 +42,7 @@ impl NetAddressMeta {
unsafe impl MetaAPI for NetAddressMeta {
type GstType = ffi::GstNetAddressMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_net_address_meta_api_get_type()) }
}
}

View file

@ -194,7 +194,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
pub fn get_csrc(&self, idx: u8) -> Option<u32> {
pub fn csrc(&self, idx: u8) -> Option<u32> {
if idx < self.csrc_count() {
unsafe {
Some(ffi::gst_rtp_buffer_get_csrc(
@ -265,7 +265,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
pub fn get_extension_onebyte_header(&self, id: u8, nth: u32) -> Option<&[u8]> {
pub fn extension_onebyte_header(&self, id: u8, nth: u32) -> Option<&[u8]> {
unsafe {
let mut data = ptr::null_mut();
// FIXME: Workaround for gstreamer-rtp-sys having the wrong type for this parameter
@ -286,7 +286,7 @@ impl<'a, T> RTPBuffer<'a, T> {
}
}
pub fn get_extension_twobytes_header(&self, id: u8, nth: u32) -> Option<(u8, &[u8])> {
pub fn extension_twobytes_header(&self, id: u8, nth: u32) -> Option<(u8, &[u8])> {
unsafe {
let mut data = ptr::null_mut();
// FIXME: Workaround for gstreamer-rtp-sys having the wrong type for this parameter

View file

@ -33,7 +33,7 @@ impl RTSPToken {
}
impl RTSPTokenRef {
pub fn get_string(&self, field: &str) -> Option<String> {
pub fn string(&self, field: &str) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_rtsp_token_get_string(
self.as_mut_ptr(),

View file

@ -207,7 +207,7 @@ impl SDPMediaRef {
unsafe { ffi::gst_sdp_media_formats_len(&self.0) }
}
pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> {
pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> {
if idx >= self.attributes_len() {
return None;
}
@ -222,7 +222,7 @@ impl SDPMediaRef {
}
}
pub fn get_attribute_val(&self, key: &str) -> Option<&str> {
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);
if ptr.is_null() {
@ -233,7 +233,7 @@ impl SDPMediaRef {
}
}
pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
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);
if ptr.is_null() {
@ -244,7 +244,7 @@ impl SDPMediaRef {
}
}
pub fn get_bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
if idx >= self.bandwidths_len() {
return None;
}
@ -259,11 +259,11 @@ impl SDPMediaRef {
}
}
pub fn get_caps_from_media(&self, pt: i32) -> Option<gst::Caps> {
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)) }
}
pub fn get_connection(&self, idx: u32) -> Option<&SDPConnection> {
pub fn connection(&self, idx: u32) -> Option<&SDPConnection> {
if idx >= self.connections_len() {
return None;
}
@ -278,7 +278,7 @@ impl SDPMediaRef {
}
}
pub fn get_format(&self, idx: u32) -> Option<&str> {
pub fn format(&self, idx: u32) -> Option<&str> {
if idx >= self.formats_len() {
return None;
}

View file

@ -245,7 +245,7 @@ impl SDPMessageRef {
unsafe { ffi::gst_sdp_message_emails_len(&self.0) }
}
pub fn get_attribute(&self, idx: u32) -> Option<&SDPAttribute> {
pub fn attribute(&self, idx: u32) -> Option<&SDPAttribute> {
if idx >= self.attributes_len() {
return None;
}
@ -260,7 +260,7 @@ impl SDPMessageRef {
}
}
pub fn get_attribute_val(&self, key: &str) -> Option<&str> {
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);
if ptr.is_null() {
@ -271,7 +271,7 @@ impl SDPMessageRef {
}
}
pub fn get_attribute_val_n(&self, key: &str, nth: u32) -> Option<&str> {
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);
if ptr.is_null() {
@ -282,7 +282,7 @@ impl SDPMessageRef {
}
}
pub fn get_bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
pub fn bandwidth(&self, idx: u32) -> Option<&SDPBandwidth> {
if idx >= self.bandwidths_len() {
return None;
}
@ -308,7 +308,7 @@ impl SDPMessageRef {
}
}
pub fn get_email(&self, idx: u32) -> Option<&str> {
pub fn email(&self, idx: u32) -> Option<&str> {
if idx >= self.emails_len() {
return None;
}
@ -345,7 +345,7 @@ impl SDPMessageRef {
}
}
pub fn get_media(&self, idx: u32) -> Option<&SDPMediaRef> {
pub fn media(&self, idx: u32) -> Option<&SDPMediaRef> {
if idx >= self.medias_len() {
return None;
}
@ -360,7 +360,7 @@ impl SDPMessageRef {
}
}
pub fn get_media_mut(&mut self, idx: u32) -> Option<&mut SDPMediaRef> {
pub fn media_mut(&mut self, idx: u32) -> Option<&mut SDPMediaRef> {
if idx >= self.medias_len() {
return None;
}
@ -386,7 +386,7 @@ impl SDPMessageRef {
}
}
pub fn get_phone(&self, idx: u32) -> Option<&str> {
pub fn phone(&self, idx: u32) -> Option<&str> {
if idx >= self.phones_len() {
return None;
}
@ -412,7 +412,7 @@ impl SDPMessageRef {
}
}
pub fn get_time(&self, idx: u32) -> Option<&SDPTime> {
pub fn time(&self, idx: u32) -> Option<&SDPTime> {
if idx >= self.times_len() {
return None;
}
@ -449,7 +449,7 @@ impl SDPMessageRef {
}
}
pub fn get_zone(&self, idx: u32) -> Option<&SDPZone> {
pub fn zone(&self, idx: u32) -> Option<&SDPZone> {
if idx >= self.zones_len() {
return None;
}

View file

@ -36,7 +36,7 @@ pub trait VideoDecoderExtManual: 'static {
params: Option<&gst::BufferPoolAcquireParams>,
) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn frames(&self) -> Vec<VideoCodecFrame>;
fn oldest_frame(&self) -> Option<VideoCodecFrame>;
@ -179,7 +179,7 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
}
}
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
let frame = unsafe {
ffi::gst_video_decoder_get_frame(self.as_ref().to_glib_none().0, frame_number)
};

View file

@ -18,7 +18,7 @@ pub trait VideoEncoderExtManual: 'static {
size: usize,
) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame>;
fn frames(&self) -> Vec<VideoCodecFrame>;
fn oldest_frame(&self) -> Option<VideoCodecFrame>;
@ -130,7 +130,7 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
}
}
fn get_frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
fn frame(&self, frame_number: i32) -> Option<VideoCodecFrame> {
let frame = unsafe {
ffi::gst_video_encoder_get_frame(self.as_ref().to_glib_none().0, frame_number)
};

View file

@ -208,7 +208,7 @@ impl VideoMeta {
unsafe impl MetaAPI for VideoMeta {
type GstType = ffi::GstVideoMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_meta_api_get_type()) }
}
}
@ -274,7 +274,7 @@ impl VideoCropMeta {
unsafe impl MetaAPI for VideoCropMeta {
type GstType = ffi::GstVideoCropMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_crop_meta_api_get_type()) }
}
}
@ -339,7 +339,7 @@ impl VideoRegionOfInterestMeta {
}
#[cfg(feature = "v1_14")]
pub fn get_param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> {
pub fn param<'b>(&self, name: &'b str) -> Option<&gst::StructureRef> {
self.params().find(|s| s.name() == name)
}
@ -396,7 +396,7 @@ impl<'a> Iterator for ParamsIter<'a> {
unsafe impl MetaAPI for VideoRegionOfInterestMeta {
type GstType = ffi::GstVideoRegionOfInterestMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_region_of_interest_meta_api_get_type()) }
}
}
@ -465,7 +465,7 @@ impl VideoAffineTransformationMeta {
unsafe impl MetaAPI for VideoAffineTransformationMeta {
type GstType = ffi::GstVideoAffineTransformationMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_affine_transformation_meta_api_get_type()) }
}
}
@ -521,7 +521,7 @@ impl VideoOverlayCompositionMeta {
unsafe impl MetaAPI for VideoOverlayCompositionMeta {
type GstType = ffi::GstVideoOverlayCompositionMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_overlay_composition_meta_api_get_type()) }
}
}
@ -586,7 +586,7 @@ impl VideoCaptionMeta {
unsafe impl MetaAPI for VideoCaptionMeta {
type GstType = ffi::GstVideoCaptionMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_caption_meta_api_get_type()) }
}
}
@ -655,7 +655,7 @@ impl VideoAFDMeta {
unsafe impl MetaAPI for VideoAFDMeta {
type GstType = ffi::GstVideoAFDMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_afd_meta_api_get_type()) }
}
}
@ -731,7 +731,7 @@ impl VideoBarMeta {
unsafe impl MetaAPI for VideoBarMeta {
type GstType = ffi::GstVideoBarMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_bar_meta_api_get_type()) }
}
}

View file

@ -115,7 +115,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_unscaled_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_unscaled_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_raw(
self.as_mut_ptr(),
@ -124,7 +124,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_unscaled_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_unscaled_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_ayuv(
self.as_mut_ptr(),
@ -133,7 +133,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_unscaled_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_unscaled_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_unscaled_argb(
self.as_mut_ptr(),
@ -142,7 +142,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_raw(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_raw(
self.as_mut_ptr(),
@ -151,7 +151,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_ayuv(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_ayuv(
self.as_mut_ptr(),
@ -160,7 +160,7 @@ impl VideoOverlayRectangleRef {
}
}
pub fn get_pixels_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
pub fn pixels_argb(&self, flags: crate::VideoOverlayFormatFlags) -> gst::Buffer {
unsafe {
from_glib_none(ffi::gst_video_overlay_rectangle_get_pixels_argb(
self.as_mut_ptr(),
@ -226,7 +226,7 @@ impl VideoOverlayCompositionRef {
unsafe { ffi::gst_video_overlay_composition_n_rectangles(self.as_mut_ptr()) }
}
pub fn get_rectangle(&self, idx: u32) -> Result<VideoOverlayRectangle, glib::error::BoolError> {
pub fn rectangle(&self, idx: u32) -> Result<VideoOverlayRectangle, glib::error::BoolError> {
if idx >= self.n_rectangles() {
return Err(glib::bool_error!("Invalid index"));
}

View file

@ -557,7 +557,7 @@ impl VideoTimeCodeMeta {
unsafe impl MetaAPI for VideoTimeCodeMeta {
type GstType = ffi::GstVideoTimeCodeMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_video_time_code_meta_api_get_type()) }
}
}

View file

@ -384,7 +384,7 @@ impl BufferRef {
self.0.mini_object.flags &= !flags.bits();
}
pub fn get_meta<T: MetaAPI>(&self) -> Option<MetaRef<T>> {
pub fn meta<T: MetaAPI>(&self) -> Option<MetaRef<T>> {
unsafe {
let meta = ffi::gst_buffer_get_meta(self.as_mut_ptr(), T::get_meta_api().to_glib());
if meta.is_null() {
@ -395,7 +395,7 @@ impl BufferRef {
}
}
pub fn get_meta_mut<T: MetaAPI>(&mut self) -> Option<MetaRefMut<T, crate::meta::Standalone>> {
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::get_meta_api().to_glib());
if meta.is_null() {
@ -511,11 +511,11 @@ impl BufferRef {
}
}
pub fn get_max_memory() -> u32 {
pub fn max_memory() -> u32 {
unsafe { ffi::gst_buffer_get_max_memory() }
}
pub fn get_memory(&self, idx: u32) -> Option<Memory> {
pub fn memory(&self, idx: u32) -> Option<Memory> {
if idx >= self.n_memory() {
None
} else {
@ -530,7 +530,7 @@ impl BufferRef {
}
}
pub fn get_memory_range(&self, idx: u32, length: Option<u32>) -> Option<Memory> {
pub fn memory_range(&self, idx: u32, length: Option<u32>) -> Option<Memory> {
assert!(idx + length.unwrap_or(0) < self.n_memory());
unsafe {
let res = ffi::gst_buffer_get_memory_range(

View file

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

View file

@ -179,7 +179,7 @@ impl CapsRef {
}
}
pub fn get_structure(&self, idx: u32) -> Option<&StructureRef> {
pub fn structure(&self, idx: u32) -> Option<&StructureRef> {
if idx >= self.size() {
return None;
}
@ -194,7 +194,7 @@ impl CapsRef {
}
}
pub fn get_mut_structure(&mut self, idx: u32) -> Option<&mut StructureRef> {
pub fn structure_mut(&mut self, idx: u32) -> Option<&mut StructureRef> {
if idx >= self.size() {
return None;
}
@ -209,7 +209,7 @@ impl CapsRef {
}
}
pub fn get_features(&self, idx: u32) -> Option<&CapsFeaturesRef> {
pub fn features(&self, idx: u32) -> Option<&CapsFeaturesRef> {
if idx >= self.size() {
return None;
}
@ -220,7 +220,7 @@ impl CapsRef {
}
}
pub fn get_mut_features(&mut self, idx: u32) -> Option<&mut CapsFeaturesRef> {
pub fn features_mut(&mut self, idx: u32) -> Option<&mut CapsFeaturesRef> {
if idx >= self.size() {
return None;
}

View file

@ -290,7 +290,7 @@ impl CapsFeaturesRef {
unsafe { ffi::gst_caps_features_get_size(self.as_ptr()) }
}
pub fn get_nth(&self, idx: u32) -> Option<&str> {
pub fn nth(&self, idx: u32) -> Option<&str> {
if idx >= self.size() {
return None;
}

View file

@ -6,7 +6,7 @@ use glib::translate::*;
use std::ptr;
pub trait ChildProxyExtManual: 'static {
fn get_child_property(&self, name: &str) -> Option<glib::Value>;
fn child_property(&self, name: &str) -> Option<glib::Value>;
fn set_child_property(
&self,
name: &str,
@ -15,7 +15,7 @@ pub trait ChildProxyExtManual: 'static {
}
impl<O: IsA<ChildProxy>> ChildProxyExtManual for O {
fn get_child_property(&self, name: &str) -> Option<glib::Value> {
fn child_property(&self, name: &str) -> Option<glib::Value> {
unsafe {
let found: bool = from_glib(ffi::gst_child_proxy_lookup(
self.as_ref().to_glib_none().0,

View file

@ -6,7 +6,7 @@ use glib::object::IsA;
use glib::translate::*;
pub trait ControlBindingExtManual: 'static {
fn get_g_value_array(
fn g_value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,
@ -15,7 +15,7 @@ pub trait ControlBindingExtManual: 'static {
}
impl<O: IsA<ControlBinding>> ControlBindingExtManual for O {
fn get_g_value_array(
fn g_value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,

View file

@ -6,7 +6,7 @@ use glib::object::IsA;
use glib::translate::*;
pub trait ControlSourceExtManual: 'static {
fn get_value_array(
fn value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,
@ -15,7 +15,7 @@ pub trait ControlSourceExtManual: 'static {
}
impl<O: IsA<ControlSource>> ControlSourceExtManual for O {
fn get_value_array(
fn value_array(
&self,
timestamp: ClockTime,
interval: ClockTime,

View file

@ -352,7 +352,7 @@ impl cmp::PartialOrd for DateTime {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
#[inline]
#[allow(clippy::unnecessary_wraps)]
fn get_cmp(delta: i32) -> Option<cmp::Ordering> {
fn cmp(delta: i32) -> Option<cmp::Ordering> {
skip_assert_initialized!();
Some(delta.cmp(&0))
}

View file

@ -33,11 +33,11 @@ impl DeviceProvider {
}
pub trait DeviceProviderExtManual: 'static {
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str>;
fn metadata<'a>(&self, key: &str) -> Option<&'a str>;
}
impl<O: IsA<DeviceProvider>> DeviceProviderExtManual for O {
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> {
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
unsafe {
let klass = (*(self.as_ptr() as *mut glib::gobject_ffi::GTypeInstance)).g_class
as *mut ffi::GstDeviceProviderClass;

View file

@ -129,7 +129,7 @@ pub trait ElementExtManual: 'static {
ret: StateChangeReturn,
) -> Result<StateChangeSuccess, StateChangeError>;
fn get_state(
fn state(
&self,
timeout: ClockTime,
) -> (Result<StateChangeSuccess, StateChangeError>, State, State);
@ -147,9 +147,9 @@ pub trait ElementExtManual: 'static {
fn send_event(&self, event: Event) -> bool;
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str>;
fn metadata<'a>(&self, key: &str) -> Option<&'a str>;
fn get_pad_template(&self, name: &str) -> Option<PadTemplate>;
fn pad_template(&self, name: &str) -> Option<PadTemplate>;
fn pad_template_list(&self) -> Vec<PadTemplate>;
#[allow(clippy::too_many_arguments)]
@ -303,7 +303,7 @@ impl<O: IsA<Element>> ElementExtManual for O {
ret.into_result()
}
fn get_state(
fn state(
&self,
timeout: ClockTime,
) -> (Result<StateChangeSuccess, StateChangeError>, State, State) {
@ -352,11 +352,11 @@ impl<O: IsA<Element>> ElementExtManual for O {
}
}
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> {
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
self.element_class().get_metadata(key)
}
fn get_pad_template(&self, name: &str) -> Option<PadTemplate> {
fn pad_template(&self, name: &str) -> Option<PadTemplate> {
self.element_class().get_pad_template(name)
}
@ -842,7 +842,7 @@ impl<O: IsA<Element>> ElementExtManual for O {
}
pub unsafe trait ElementClassExt {
fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> {
fn metadata<'a>(&self, key: &str) -> Option<&'a str> {
unsafe {
let klass = self as *const _ as *const ffi::GstElementClass;
@ -856,7 +856,7 @@ pub unsafe trait ElementClassExt {
}
}
fn get_pad_template(&self, name: &str) -> Option<PadTemplate> {
fn pad_template(&self, name: &str) -> Option<PadTemplate> {
unsafe {
let klass = self as *const _ as *const ffi::GstElementClass;

View file

@ -47,7 +47,7 @@ impl_common_ops_for_opt_int!(Percent);
pub struct TryFromGenericFormattedValueError(());
pub trait FormattedValue: Copy + Clone + Sized + Into<GenericFormattedValue> + 'static {
fn get_default_format() -> Format;
fn default_format() -> Format;
fn format(&self) -> Format;
unsafe fn from_raw(format: Format, value: i64) -> Self;
@ -57,7 +57,7 @@ pub trait FormattedValue: Copy + Clone + Sized + Into<GenericFormattedValue> + '
pub trait SpecificFormattedValue: FormattedValue + TryFrom<GenericFormattedValue> {}
impl FormattedValue for GenericFormattedValue {
fn get_default_format() -> Format {
fn default_format() -> Format {
Format::Undefined
}
@ -274,7 +274,7 @@ macro_rules! impl_op_u64(
macro_rules! impl_format_value_traits(
($name:ident, $format:ident, $format_value:ident) => {
impl FormattedValue for $name {
fn get_default_format() -> Format {
fn default_format() -> Format {
Format::$format
}
@ -520,7 +520,7 @@ impl_format_value_traits!(ClockTime, Time, Time);
impl_format_value_traits!(Buffers, Buffers, Buffers);
impl FormattedValue for Undefined {
fn get_default_format() -> Format {
fn default_format() -> Format {
Format::Undefined
}
@ -601,7 +601,7 @@ impl AsMut<i64> for Undefined {
}
impl FormattedValue for Percent {
fn get_default_format() -> Format {
fn default_format() -> Format {
Format::Percent
}

View file

@ -493,7 +493,7 @@ mod tests {
use std::sync::{Arc, Mutex};
#[test]
fn get_existing() {
fn existing() {
crate::init().unwrap();
let perf_cat = DebugCategory::get("GST_PERFORMANCE")

View file

@ -24,7 +24,7 @@ use glib::translate::{from_glib, from_glib_none, FromGlib, ToGlibPtr};
pub unsafe trait MetaAPI: Sync + Send + Sized {
type GstType;
fn get_meta_api() -> glib::Type;
fn meta_api() -> glib::Type;
unsafe fn from_ptr(buffer: &BufferRef, ptr: *const Self::GstType) -> MetaRef<Self> {
assert!(!ptr.is_null());
@ -240,7 +240,7 @@ impl Meta {
unsafe impl MetaAPI for Meta {
type GstType = ffi::GstMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
glib::Type::INVALID
}
}
@ -282,7 +282,7 @@ impl ParentBufferMeta {
unsafe impl MetaAPI for ParentBufferMeta {
type GstType = ffi::GstParentBufferMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_parent_buffer_meta_api_get_type()) }
}
}
@ -323,7 +323,7 @@ impl ProtectionMeta {
unsafe impl MetaAPI for ProtectionMeta {
type GstType = ffi::GstProtectionMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_protection_meta_api_get_type()) }
}
}
@ -392,7 +392,7 @@ impl ReferenceTimestampMeta {
unsafe impl MetaAPI for ReferenceTimestampMeta {
type GstType = ffi::GstReferenceTimestampMeta;
fn get_meta_api() -> glib::Type {
fn meta_api() -> glib::Type {
unsafe { from_glib(ffi::gst_reference_timestamp_meta_api_get_type()) }
}
}

View file

@ -21,7 +21,7 @@ pub trait GstObjectExtManual: 'static {
fn object_flags(&self) -> ObjectFlags;
fn get_g_value_array(
fn g_value_array(
&self,
property_name: &str,
timestamp: ClockTime,
@ -101,7 +101,7 @@ impl<O: IsA<crate::Object>> GstObjectExtManual for O {
}
}
fn get_g_value_array(
fn g_value_array(
&self,
property_name: &str,
timestamp: ClockTime,

View file

@ -114,8 +114,8 @@ pub trait PadExtManual: 'static {
buffer: &mut crate::BufferRef,
size: u32,
) -> Result<(), FlowError>;
fn get_range(&self, offset: u64, size: u32) -> Result<Buffer, FlowError>;
fn get_range_fill(
fn range(&self, offset: u64, size: u32) -> Result<Buffer, FlowError>;
fn range_fill(
&self,
offset: u64,
buffer: &mut crate::BufferRef,
@ -344,7 +344,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
}
}
fn get_range(&self, offset: u64, size: u32) -> Result<Buffer, FlowError> {
fn range(&self, offset: u64, size: u32) -> Result<Buffer, FlowError> {
unsafe {
let mut buffer = ptr::null_mut();
let ret: FlowReturn = from_glib(ffi::gst_pad_get_range(
@ -357,7 +357,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
}
}
fn get_range_fill(
fn range_fill(
&self,
offset: u64,
buffer: &mut crate::BufferRef,

View file

@ -103,7 +103,7 @@ impl Promise {
}
}
pub fn get_reply(&self) -> Option<&StructureRef> {
pub fn reply(&self) -> Option<&StructureRef> {
unsafe {
let s = ffi::gst_promise_get_reply(self.to_glib_none().0);
if s.is_null() {

View file

@ -368,7 +368,7 @@ impl StructureRef {
.map_err(|err| GetError::from_value_get_error(name, err))
}
pub fn get_value<'structure, 'name>(
pub fn value<'structure, 'name>(
&'structure self,
name: &'name str,
) -> Result<&SendValue, GetError<'name>> {
@ -452,7 +452,7 @@ impl StructureRef {
Iter::new(self)
}
pub fn get_nth_field_name<'a>(&self, idx: u32) -> Option<&'a str> {
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);
if field_name.is_null() {

View file

@ -444,7 +444,7 @@ impl TagListRef {
})
}
pub fn get_generic(&self, tag_name: &str) -> Option<SendValue> {
pub fn generic(&self, tag_name: &str) -> Option<SendValue> {
unsafe {
let mut value: mem::MaybeUninit<SendValue> = mem::MaybeUninit::zeroed();
@ -474,7 +474,7 @@ impl TagListRef {
}
}
pub fn get_index<'a, T: Tag<'a>>(&self, idx: u32) -> Option<&'a TagValue<T::TagType>> {
pub fn index<'a, T: Tag<'a>>(&self, idx: u32) -> Option<&'a TagValue<T::TagType>> {
self.get_index_generic(T::tag_name(), idx).map(|value| {
if !value.is::<T::TagType>() {
panic!(
@ -487,7 +487,7 @@ impl TagListRef {
})
}
pub fn get_index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> {
pub fn index_generic<'a>(&'a self, tag_name: &str, idx: u32) -> Option<&'a SendValue> {
unsafe {
let value =
ffi::gst_tag_list_get_value_index(self.as_ptr(), tag_name.to_glib_none().0, idx);
@ -500,11 +500,11 @@ impl TagListRef {
}
}
pub fn get_size<'a, T: Tag<'a>>(&self) -> u32 {
pub fn size<'a, T: Tag<'a>>(&self) -> u32 {
self.get_size_by_name(T::tag_name())
}
pub fn get_size_by_name(&self, tag_name: &str) -> u32 {
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) }
}

View file

@ -20,7 +20,7 @@ mod runloop {
}
}
pub fn get_main() -> CFRunLoop {
pub fn main() -> CFRunLoop {
unsafe {
let r = CFRunLoopGetMain();
assert!(!r.is_null());